Changeset 3263746
- Timestamp:
- 03/29/2025 08:36:07 AM (12 months ago)
- Location:
- interactive-globes/trunk
- Files:
-
- 336 added
- 1 deleted
- 62 edited
-
README.txt (modified) (5 diffs)
-
dist/assets/css/admin/admin-style.min.css (modified) (1 diff)
-
dist/assets/css/features/cptmanager (added)
-
dist/assets/css/features/cptmanager/modal.min.css (added)
-
dist/assets/css/public/itt-globes-style.min.css (modified) (1 diff)
-
dist/assets/js/admin/admin.min.js (modified) (1 diff)
-
dist/assets/js/admin/cpt-list-events.min.js (modified) (1 diff)
-
dist/assets/js/admin/cpt-modal-events.min.js (modified) (1 diff)
-
dist/assets/js/public/globe.min.js (modified) (1 diff)
-
dist/assets/js/vendor/public/globe.gl.min.js (modified) (2 diffs)
-
interactive-globes.php (modified) (5 diffs)
-
languages/interactive-globes.pot (modified) (57 diffs)
-
src/Core.php (modified) (1 diff)
-
src/Exception/SaltusFrameworkThrowable.php (added)
-
src/Features/CptManager/CptManagerCore.php (modified) (5 diffs)
-
src/Features/CptManager/CptManagerFeature.php (modified) (1 diff)
-
src/Features/Duplicate/DuplicateCore.php (modified) (5 diffs)
-
src/Features/Duplicate/DuplicateFeature.php (modified) (1 diff)
-
src/Features/Meta/MetaCore.php (modified) (8 diffs)
-
src/Features/Meta/MetaFeature.php (modified) (1 diff)
-
src/Features/Sales/UpsellPage.php (modified) (5 diffs)
-
src/Features/Sales/UpsellPageFeature.php (modified) (1 diff)
-
src/Features/Shortcode/ShortcodeCore.php (modified) (7 diffs)
-
src/Features/Shortcode/ShortcodeFeature.php (modified) (1 diff)
-
src/Features/SinglePage/SinglePageCore.php (modified) (1 diff)
-
src/Features/SinglePage/SinglePageFeature.php (modified) (1 diff)
-
src/Features/Tooltip/TooltipCore.php (modified) (3 diffs)
-
src/Features/Tooltip/TooltipFeature.php (modified) (1 diff)
-
src/Features/Updater/UpdateCore.php (modified) (1 diff)
-
src/Features/Updater/UpdateFeature.php (modified) (1 diff)
-
src/Loader.php (modified) (1 diff)
-
src/Plugin/Assets.php (modified) (11 diffs)
-
src/Plugin/I18n.php (modified) (1 diff)
-
src/Plugin/Lifecycle.php (modified) (1 diff)
-
src/Project.php (modified) (1 diff)
-
src/Services/Assets/AssetsCore.php (modified) (1 diff)
-
src/Services/Assets/AssetsService.php (modified) (2 diffs)
-
src/Services/Assets/HasAssets.php (modified) (1 diff)
-
src/Services/Creatable.php (added)
-
src/Services/Model/Assembler.php (modified) (1 diff)
-
src/Services/Model/Base/Features.php (modified) (1 diff)
-
src/Services/Model/Base/Labels.php (modified) (1 diff)
-
src/Services/Model/Base/Meta.php (modified) (3 diffs)
-
src/Services/Model/Base/MetaDotLabel.php (modified) (1 diff)
-
src/Services/Model/Base/MetaPoint.php (modified) (4 diffs)
-
src/Services/Model/Base/Model.php (modified) (1 diff)
-
src/Services/Model/Base/Options.php (modified) (1 diff)
-
src/Services/Model/Base/SafeNL2BR.php (modified) (1 diff)
-
src/Services/Model/Base/Settings.php (modified) (1 diff)
-
src/models/00-globe-free.php (modified) (1 diff)
-
src/models/01-globe-dotlabel.php (modified) (2 diffs)
-
src/models/02-globe-point.php (modified) (7 diffs)
-
vendor-prefixed (added)
-
vendor-prefixed/autoload.php (added)
-
vendor-prefixed/composer (added)
-
vendor-prefixed/composer/ClassLoader.php (added)
-
vendor-prefixed/composer/LICENSE (added)
-
vendor-prefixed/composer/autoload_classmap.php (added)
-
vendor-prefixed/composer/autoload_namespaces.php (added)
-
vendor-prefixed/composer/autoload_psr4.php (added)
-
vendor-prefixed/composer/autoload_real.php (added)
-
vendor-prefixed/composer/autoload_static.php (added)
-
vendor-prefixed/composer/installed.json (added)
-
vendor-prefixed/composer/platform_check.php (added)
-
vendor-prefixed/hassankhan (added)
-
vendor-prefixed/hassankhan/config (added)
-
vendor-prefixed/hassankhan/config/src (added)
-
vendor-prefixed/hassankhan/config/src/AbstractConfig.php (added)
-
vendor-prefixed/hassankhan/config/src/Config.php (added)
-
vendor-prefixed/hassankhan/config/src/ConfigInterface.php (added)
-
vendor-prefixed/hassankhan/config/src/ErrorException.php (added)
-
vendor-prefixed/hassankhan/config/src/Exception (added)
-
vendor-prefixed/hassankhan/config/src/Exception.php (added)
-
vendor-prefixed/hassankhan/config/src/Exception/EmptyDirectoryException.php (added)
-
vendor-prefixed/hassankhan/config/src/Exception/FileNotFoundException.php (added)
-
vendor-prefixed/hassankhan/config/src/Exception/ParseException.php (added)
-
vendor-prefixed/hassankhan/config/src/Exception/UnsupportedFormatException.php (added)
-
vendor-prefixed/hassankhan/config/src/Exception/WriteException.php (added)
-
vendor-prefixed/hassankhan/config/src/Parser (added)
-
vendor-prefixed/hassankhan/config/src/Parser/AbstractParser.php (added)
-
vendor-prefixed/hassankhan/config/src/Parser/Ini.php (added)
-
vendor-prefixed/hassankhan/config/src/Parser/Json.php (added)
-
vendor-prefixed/hassankhan/config/src/Parser/ParserInterface.php (added)
-
vendor-prefixed/hassankhan/config/src/Parser/Php.php (added)
-
vendor-prefixed/hassankhan/config/src/Parser/Properties.php (added)
-
vendor-prefixed/hassankhan/config/src/Parser/Serialize.php (added)
-
vendor-prefixed/hassankhan/config/src/Parser/Xml.php (added)
-
vendor-prefixed/hassankhan/config/src/Parser/Yaml.php (added)
-
vendor-prefixed/hassankhan/config/src/Writer (added)
-
vendor-prefixed/hassankhan/config/src/Writer/AbstractWriter.php (added)
-
vendor-prefixed/hassankhan/config/src/Writer/Ini.php (added)
-
vendor-prefixed/hassankhan/config/src/Writer/Json.php (added)
-
vendor-prefixed/hassankhan/config/src/Writer/Properties.php (added)
-
vendor-prefixed/hassankhan/config/src/Writer/Serialize.php (added)
-
vendor-prefixed/hassankhan/config/src/Writer/WriterInterface.php (added)
-
vendor-prefixed/hassankhan/config/src/Writer/Xml.php (added)
-
vendor-prefixed/hassankhan/config/src/Writer/Yaml.php (added)
-
vendor-prefixed/saltus (added)
-
vendor-prefixed/saltus/framework (added)
-
vendor-prefixed/saltus/framework/lib (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/css (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/css/style-rtl.css (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/css/style-rtl.min.css (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/css/style.css (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/css/style.min.css (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/images (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/images/checkerboard.png (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/images/wp-logo.svg (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/images/wp-plugin-logo.svg (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/js (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/js/gutenberg.js (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/js/main.js (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/js/main.min.js (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/js/plugins.js (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/js/plugins.min.js (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/scss (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/scss/partials (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/scss/partials/_base.scss (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/scss/partials/_chosen.scss (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/scss/partials/_customizer.scss (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/scss/partials/_fields.scss (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/scss/partials/_flatpickr.scss (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/scss/partials/_helper.scss (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/scss/partials/_modal.scss (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/scss/partials/_navmenu.scss (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/scss/partials/_profile.scss (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/scss/partials/_responsive.scss (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/scss/partials/_taxonomy.scss (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/scss/partials/_themes.scss (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/scss/partials/_welcome.scss (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/scss/partials/_widget.scss (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/scss/style-rtl.scss (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/assets/scss/style.scss (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/classes (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/classes/abstract.class.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/classes/admin-options.class.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/classes/comment-options.class.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/classes/customize-options.class.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/classes/fields.class.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/classes/metabox-options.class.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/classes/nav-menu-options.class.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/classes/profile-options.class.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/classes/setup.class.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/classes/shortcode-options.class.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/classes/taxonomy-options.class.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/classes/widget-options.class.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/codestar-framework.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/accordion (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/accordion/accordion.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/backup (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/backup/backup.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/border (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/border/border.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/button_set (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/button_set/button_set.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/callback (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/callback/callback.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/checkbox (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/checkbox/checkbox.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/code_editor (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/code_editor/code_editor.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/color (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/color/color.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/color_group (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/color_group/color_group.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/content (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/content/content.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/date (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/date/date.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/datetime (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/datetime/datetime.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/dimensions (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/dimensions/dimensions.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/fieldset (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/fieldset/fieldset.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/gallery (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/gallery/gallery.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/group (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/group/group.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/heading (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/heading/heading.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/icon (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/icon/fa4-icons.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/icon/fa5-icons.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/icon/icon.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/image_select (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/image_select/image_select.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/index.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/link (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/link/link.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/link_color (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/link_color/link_color.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/map (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/map/map.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/media (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/media/media.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/notice (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/notice/notice.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/number (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/number/number.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/palette (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/palette/palette.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/radio (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/radio/radio.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/repeater (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/repeater/repeater.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/select (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/select/select.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/slider (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/slider/slider.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/sortable (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/sortable/sortable.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/sorter (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/sorter/sorter.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/spacing (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/spacing/spacing.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/spinner (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/spinner/spinner.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/subheading (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/subheading/subheading.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/submessage (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/submessage/submessage.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/switcher (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/switcher/switcher.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/tabbed (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/tabbed/tabbed.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/text (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/text/text.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/textarea (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/textarea/textarea.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/google-fonts.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/upload (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/upload/upload.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/wp_editor (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/fields/wp_editor/wp_editor.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/functions (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/functions/actions.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/functions/customize.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/functions/helpers.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/functions/sanitize.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/functions/validate.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/functions/walker.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/index.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/ar.mo (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/ar.po (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/az.mo (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/az.po (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/bn_BD.mo (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/bn_BD.po (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/de_DE.mo (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/de_DE.po (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/default.pot (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/es_ES.mo (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/es_ES.po (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/fr_FR.mo (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/fr_FR.po (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/hi_IN.mo (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/hi_IN.po (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/id_ID.mo (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/id_ID.po (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/it_IT.mo (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/it_IT.po (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/ja.mo (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/ja.po (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/ko_KR.mo (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/ko_KR.po (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/ne_NP.mo (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/ne_NP.po (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/nl_NL.mo (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/nl_NL.po (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/pl_PL.mo (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/pl_PL.po (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/pt_PT.mo (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/pt_PT.po (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/ru_RU.mo (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/ru_RU.po (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/th.mo (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/th.po (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/tr_TR.mo (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/tr_TR.po (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/vi.mo (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/vi.po (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/zh_CN.mo (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/languages/zh_CN.po (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/patches (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/patches/0001-Fix-missing-properties.patch.txt (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/patches/0002.fix-fontawesome5.patch (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/patches/0003.fix-image-select-name-attr.patch (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/patches/0004.fix-codestar-return-not-die (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/samples (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/samples/admin-options.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/samples/comment-options.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/samples/customize-options.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/samples/metabox-options.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/samples/nav-menu-options.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/samples/profile-options.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/samples/shortcode-options.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/samples/taxonomy-options.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/samples/widget-options.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/views (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/views/about.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/views/documentation.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/views/footer.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/views/free-vs-premium.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/views/header.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/views/quickstart.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/views/relnotes.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/views/support.php (added)
-
vendor-prefixed/saltus/framework/lib/codestar-framework/views/welcome.php (added)
-
vendor-prefixed/saltus/framework/src (added)
-
vendor-prefixed/saltus/framework/src/Core.php (added)
-
vendor-prefixed/saltus/framework/src/Exception (added)
-
vendor-prefixed/saltus/framework/src/Exception/SaltusFrameworkThrowable.php (added)
-
vendor-prefixed/saltus/framework/src/Features (added)
-
vendor-prefixed/saltus/framework/src/Features/AdminCols (added)
-
vendor-prefixed/saltus/framework/src/Features/AdminCols/AdminCols.php (added)
-
vendor-prefixed/saltus/framework/src/Features/AdminCols/SaltusAdminCols.php (added)
-
vendor-prefixed/saltus/framework/src/Features/AdminFilters (added)
-
vendor-prefixed/saltus/framework/src/Features/AdminFilters/AdminFilters.php (added)
-
vendor-prefixed/saltus/framework/src/Features/AdminFilters/SaltusAdminFilters.php (added)
-
vendor-prefixed/saltus/framework/src/Features/AdminFilters/WalkerTaxonomyDropdown.php (added)
-
vendor-prefixed/saltus/framework/src/Features/DragAndDrop (added)
-
vendor-prefixed/saltus/framework/src/Features/DragAndDrop/DragAndDrop.php (added)
-
vendor-prefixed/saltus/framework/src/Features/DragAndDrop/SaltusDragAndDrop.php (added)
-
vendor-prefixed/saltus/framework/src/Features/DragAndDrop/UpdateMenuDragAndDrop.php (added)
-
vendor-prefixed/saltus/framework/src/Features/Duplicate (added)
-
vendor-prefixed/saltus/framework/src/Features/Duplicate/Duplicate.php (added)
-
vendor-prefixed/saltus/framework/src/Features/Duplicate/SaltusDuplicate.php (added)
-
vendor-prefixed/saltus/framework/src/Features/FeatureA (added)
-
vendor-prefixed/saltus/framework/src/Features/FeatureA/FeatureA.php (added)
-
vendor-prefixed/saltus/framework/src/Features/FeatureA/SaltusFeatureA.php (added)
-
vendor-prefixed/saltus/framework/src/Features/Meta (added)
-
vendor-prefixed/saltus/framework/src/Features/Meta/CMB2Meta.php (added)
-
vendor-prefixed/saltus/framework/src/Features/Meta/CodestarMeta.php (added)
-
vendor-prefixed/saltus/framework/src/Features/Meta/Meta.php (added)
-
vendor-prefixed/saltus/framework/src/Features/RememberTabs (added)
-
vendor-prefixed/saltus/framework/src/Features/RememberTabs/RememberTabs.php (added)
-
vendor-prefixed/saltus/framework/src/Features/RememberTabs/SaltusRememberTabs.php (added)
-
vendor-prefixed/saltus/framework/src/Features/Settings (added)
-
vendor-prefixed/saltus/framework/src/Features/Settings/CodestarSettings.php (added)
-
vendor-prefixed/saltus/framework/src/Features/Settings/Settings.php (added)
-
vendor-prefixed/saltus/framework/src/Features/SingleExport (added)
-
vendor-prefixed/saltus/framework/src/Features/SingleExport/SaltusSingleExport.php (added)
-
vendor-prefixed/saltus/framework/src/Features/SingleExport/SingleExport.php (added)
-
vendor-prefixed/saltus/framework/src/Infrastructure (added)
-
vendor-prefixed/saltus/framework/src/Infrastructure/Container (added)
-
vendor-prefixed/saltus/framework/src/Infrastructure/Container/CanRegister.php (added)
-
vendor-prefixed/saltus/framework/src/Infrastructure/Container/Container.php (added)
-
vendor-prefixed/saltus/framework/src/Infrastructure/Container/ContainerAssembler.php (added)
-
vendor-prefixed/saltus/framework/src/Infrastructure/Container/FailedToMakeInstance.php (added)
-
vendor-prefixed/saltus/framework/src/Infrastructure/Container/GenericContainer.php (added)
-
vendor-prefixed/saltus/framework/src/Infrastructure/Container/Instantiator.php (added)
-
vendor-prefixed/saltus/framework/src/Infrastructure/Container/Invalid.php (added)
-
vendor-prefixed/saltus/framework/src/Infrastructure/Container/ServiceContainer.php (added)
-
vendor-prefixed/saltus/framework/src/Infrastructure/Plugin (added)
-
vendor-prefixed/saltus/framework/src/Infrastructure/Plugin/Activateable.php (added)
-
vendor-prefixed/saltus/framework/src/Infrastructure/Plugin/Deactivateable.php (added)
-
vendor-prefixed/saltus/framework/src/Infrastructure/Plugin/Plugin.php (added)
-
vendor-prefixed/saltus/framework/src/Infrastructure/Plugin/Registerable.php (added)
-
vendor-prefixed/saltus/framework/src/Infrastructure/Service (added)
-
vendor-prefixed/saltus/framework/src/Infrastructure/Service/Actionable.php (added)
-
vendor-prefixed/saltus/framework/src/Infrastructure/Service/App.php (added)
-
vendor-prefixed/saltus/framework/src/Infrastructure/Service/Assembly.php (added)
-
vendor-prefixed/saltus/framework/src/Infrastructure/Service/Conditional.php (added)
-
vendor-prefixed/saltus/framework/src/Infrastructure/Service/Processable.php (added)
-
vendor-prefixed/saltus/framework/src/Infrastructure/Service/Service.php (added)
-
vendor-prefixed/saltus/framework/src/Modeler.php (added)
-
vendor-prefixed/saltus/framework/src/Models (added)
-
vendor-prefixed/saltus/framework/src/Models/BaseModel.php (added)
-
vendor-prefixed/saltus/framework/src/Models/Config (added)
-
vendor-prefixed/saltus/framework/src/Models/Config/NoFile.php (added)
-
vendor-prefixed/saltus/framework/src/Models/Model.php (added)
-
vendor-prefixed/saltus/framework/src/Models/ModelFactory.php (added)
-
vendor-prefixed/saltus/framework/src/Models/PostType.php (added)
-
vendor-prefixed/saltus/framework/src/Models/Taxonomy.php (added)
-
vendor/autoload.php (modified) (1 diff)
-
vendor/composer/InstalledVersions.php (modified) (5 diffs)
-
vendor/composer/LICENSE (modified) (2 diffs)
-
vendor/composer/autoload_classmap.php (modified) (2 diffs)
-
vendor/composer/autoload_files.php (deleted)
-
vendor/composer/autoload_psr4.php (modified) (1 diff)
-
vendor/composer/autoload_real.php (modified) (2 diffs)
-
vendor/composer/autoload_static.php (modified) (5 diffs)
-
vendor/composer/installed.json (modified) (4 diffs)
-
vendor/composer/installed.php (modified) (4 diffs)
-
vendor/saltus/framework/CHANGELOG.md (added)
-
vendor/saltus/framework/README.md (modified) (2 diffs)
-
vendor/saltus/framework/composer.json (modified) (1 diff)
-
vendor/saltus/framework/composer.lock (modified) (26 diffs)
-
vendor/saltus/framework/lib/codestar-framework/classes/setup.class.php (modified) (26 diffs)
-
vendor/saltus/framework/lib/codestar-framework/functions/actions.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
interactive-globes/trunk/README.txt
r3209508 r3263746 3 3 Tags: map, globe, globes, world, planet earth 4 4 Requires at least: 5.0 5 Tested up to: 6. 65 Tested up to: 6.8 6 6 Requires PHP: 7.0 7 7 Stable tag: 1.4.3 … … 27 27 The globes are generated using globe.gl, a library that is able to create 3-dimensional globes in a spherical projection, using ThreeJS/WebGL for the 3D rendering. 28 28 29 If you need to display locations on a world map, this is the solution for you. 30 31 Create your first world map in minutes! Use it to highlight locations, offices, projects, representatives, statistics, or other interactive marker visualization you need!29 If you need to display locations on a world map, this is the solution for you. There are different world map representations, night and day, you can choose from different globe images. 30 31 Create your first 3D interactive world map in minutes! Use this powerful 3D map WordPress plugin to highlight locations, offices, projects, representatives, statistics, or any interactive marker visualizations you need, such as visited cities map, etc! 32 32 33 33 After you create a globe you'll get a unique shortcode that you can use in all popular page builders, including the block editor, elementor and others. 34 34 35 = F eatures =35 = Free Features = 36 36 - Create as many globe maps as you want 37 37 - Responsive and cross-device 38 - Add round coloured markers38 - Add coloured markers and dot text labels 39 39 - Set hover color change 40 40 - Set click actions, like open a new window … … 44 44 The plugin generates interactive, responsive, touch-enabled map globes which are embedded directly into your HTML5 pages and compatible with all modern browsers and devices. 45 45 46 = Introducing PRO version=47 - Regions - Colour countries or regions in the globe 46 = PRO version Features = 47 - Regions - Colour countries or regions in the globe - great for visited countries map 48 48 - Arc Lines - Add lines connecting two or more points on the globe 49 49 - More Globe appearance options: Hollow Globe, Custom Color, Custom Globe Image 50 - More marker types: custom images, html markers, 3d pins 50 51 - Advanced Click Actions: Display Content Below, Above, Right, Left, in a Lightbox and in an Iframe. 51 52 - Priority support … … 76 77 77 78 == Changelog == 79 80 = 1.4.7 = 81 - Fix: Use wp functions to in rest api route for delete method 82 - Fix: Better responsive click areas 83 - Fix: Shortcode copy button title translatable 84 - Fix: Enqueue styles in features 85 86 87 = 1.4.6 = 88 - New: Add modal styles 89 - New: Set Maximum Allowed Zoom 90 - New: Add percentage placeholder in Region Counter 91 - Fix: Flag pole is not rendering altitude correctly 92 - Fix: Change wording in altitude field description 93 - Fix: Selecting WP Rich Text editor for any field in the settings causes PHP error 94 - Fix: HTML Markers are showing up in Free version 95 - Fix: Only include active regions in Region Counter 96 - Fix: Streamline the dimensions of Click Action areas 97 - Maintenance: Improve vendor prefix 98 99 100 = 1.4.5 = 101 - New: HTML marker 102 - New: 3D pins: Pin, Flag, Image and Marker 103 - New: Region Counter 104 - Fix: Trigger actions in modal 105 - Fix: Improve modal styles 106 - Fix: Click actions array 107 - Fix: Add click actions to point 108 - Fix: Ignore globe id 0 when hooking meta data 109 - Maintenance: Update readme 110 - Maintenance: Simplify namespace and add prefix to vendors 111 112 113 = 1.4.4 = 114 - New: Double tap/click zooms in 115 - New: Region stroke color 116 - Fix: Button styles in modal 117 - Fix: Prevent globe library to load where is not needed 118 - Fix: Prevent loading multiple instances of Three.js 119 - Fix: clean up code 78 120 79 121 = 1.4.3 = … … 188 230 * [Codestar Framework](http://codestarframework.com/) 189 231 * [Saltus Framework](https://saltus.dev) 232 -
interactive-globes/trunk/dist/assets/css/admin/admin-style.min.css
r3207680 r3263746 1 .itt_globe_info .csf-field-image_select img{max-width:125px}.geocoding-hide{display:none}.itt_globe_admin_example{display:flex}.itt_globe_admin_example img{max-width:220px}.itt_globe_meta .csf-section-title{display:none!important}.itt_globe_preview_container{display:flex}.itt_globe_preview{position:relative;width:80%}@media(max-width:960px){.itt_globe_preview{width:60%}}.itt_globe_preview_info{max-width:400px;min-height:200px;padding:5px}#poststuff .itt_globe_preview_info .inside{display:flex;flex-wrap:nowrap;justify-content:left;margin:6px}.itt_globe_preview_info .itt_globe_preview_action{margin-left:auto}#itt_globe_preview_data_clicked .postbox-header{padding-right:20px}.itt_globe_preview_action,.itt_globe_preview_data{display:inline-block}.itt_globe_preview_title{--wp-admin--admin-bar--height:32px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;-webkit-font-smoothing:subpixel-antialiased;color:#1d2327;display:block;font-size:14px;font-weight:400;line-height:1.4;margin:0;padding:8px 12px}.itt_globe_preview_info .ittglobe_altitude_s,.itt_globe_preview_info .ittglobe_lat_s,.itt_globe_preview_info .ittglobe_lng_s{color:#1f1f1f}.itt_globe_preview_info .ittglobe_lat,.itt_globe_preview_info .ittglobe_lng{display:inline-block;min-width:50px}.itt_globe_preview_info pre{font-size:.8em}.itt_globe_save_warning{background:#ab4545a8;box-sizing:border-box;color:#fff;display:none;left:0;padding:10px;position:absolute;text-align:center;top:0;width:100%;z-index:10}.itt_globe_preview_needs_update .itt_globe_save_warning{display:block}.itt_globes_cpt_manager_table{border:1px solid #ccd0d4;border-collapse:collapse;margin-bottom:15px;width:100%}.itt_globes_cpt_manager_table thead{border-bottom:1px solid #ccc}.itt_globes_cpt_manager_table td,.itt_globes_cpt_manager_table th{padding:10px;text-align:left}.itt_globes_cpt_manager_table tr:nth-child(2n){background-color:#f9f9f9}.itt_globes_cpt_manager_table tr:nth-child(odd){background-color:#fff}.itt_globes_cpt_manager_table :not(thead) tr:hover{background-color:#f1f1f1}.itt_globes_cpt_manager_table .buttons{text-align:right}.itt_globes_cpt_manager_table .buttons a.button{margin-left:5px}. modal{font-family:-apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica neue,helvetica,ubuntu,roboto,noto,segoe ui,arial,sans-serif}.modal__overlay{align-items:center;background:rgba(0,0,0,.6);bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:11}.modal__container{background-color:#fff;border-radius:4px;box-sizing:border-box;max-height:100vh;max-width:500px;overflow-y:auto;padding:30px}.modal__header{align-items:center;display:flex;justify-content:space-between}.modal__title{box-sizing:border-box;color:#00449e;font-size:1.25rem;font-weight:600;line-height:1.25;margin-bottom:0;margin-top:0}.modal__close{background:transparent;border:0}.modal__header .modal__close:before{content:"\2715"}.modal__content{color:rgba(0,0,0,.8);line-height:1.5;margin-bottom:2rem;margin-top:2rem}.modal__btn{-webkit-appearance:button;background-color:#e6e6e6;border-radius:.25rem;border-style:none;border-width:0;color:rgba(0,0,0,.8);cursor:pointer;font-size:.875rem;line-height:1.15;margin:0;overflow:visible;padding:.5rem 1rem;text-transform:none;will-change:transform;-moz-osx-font-smoothing:grayscale;backface-visibility:hidden;transform:translateZ(0);transition:transform .25s ease-out}.modal__btn:focus,.modal__btn:hover{transform:scale(1.05)}.modal__btn-primary{background-color:#00449e;color:#fff}@keyframes mmfadeIn{0%{opacity:0}to{opacity:1}}@keyframes mmfadeOut{0%{opacity:1}to{opacity:0}}@keyframes mmslideIn{0%{transform:translateY(15%)}to{transform:translateY(0)}}@keyframes mmslideOut{0%{transform:translateY(0)}to{transform:translateY(-10%)}}.modal__title__block{display:flex}.modal__title__input{display:none}#pencil-icon{cursor:pointer;margin-left:1em}.modal__title__input.visible{display:block}.edit_mode__static.invisible{display:none}.postbox .csf-field-image_select figure:before,.postbox .csf-field-spinner .ui-spinner .ui-spinner-button:before{font-family:Font Awesome\ 5 Pro,Font Awesome\ 5 Free,Font Awesome\ 6 Free,FontAwesome}1 .itt_globe_info .csf-field-image_select img{max-width:125px}.geocoding-hide{display:none}.itt_globe_admin_example{display:flex}.itt_globe_admin_example img{max-width:220px}.itt_globe_meta .csf-section-title{display:none!important}.itt_globe_preview_container{display:flex}.itt_globe_preview{position:relative;width:80%}@media(max-width:960px){.itt_globe_preview{width:60%}}.itt_globe_preview_info{max-width:400px;min-height:200px;padding:5px}#poststuff .itt_globe_preview_info .inside{display:flex;flex-wrap:nowrap;justify-content:left;margin:6px}.itt_globe_preview_info .itt_globe_preview_action{margin-left:auto}#itt_globe_preview_data_clicked .postbox-header{padding-right:20px}.itt_globe_preview_action,.itt_globe_preview_data{display:inline-block}.itt_globe_preview_title{--wp-admin--admin-bar--height:32px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;-webkit-font-smoothing:subpixel-antialiased;color:#1d2327;display:block;font-size:14px;font-weight:400;line-height:1.4;margin:0;padding:8px 12px}.itt_globe_preview_info .ittglobe_altitude_s,.itt_globe_preview_info .ittglobe_lat_s,.itt_globe_preview_info .ittglobe_lng_s{color:#1f1f1f}.itt_globe_preview_info .ittglobe_lat,.itt_globe_preview_info .ittglobe_lng{display:inline-block;min-width:50px}.itt_globe_preview_info pre{font-size:.8em}.itt_globe_save_warning{background:#ab4545a8;box-sizing:border-box;color:#fff;display:none;left:0;padding:10px;position:absolute;text-align:center;top:0;width:100%;z-index:10}.itt_globe_preview_needs_update .itt_globe_save_warning{display:block}.itt_globes_cpt_manager_table{border:1px solid #ccd0d4;border-collapse:collapse;margin-bottom:15px;width:100%}.itt_globes_cpt_manager_table thead{border-bottom:1px solid #ccc}.itt_globes_cpt_manager_table td,.itt_globes_cpt_manager_table th{padding:10px;text-align:left}.itt_globes_cpt_manager_table tr:nth-child(2n){background-color:#f9f9f9}.itt_globes_cpt_manager_table tr:nth-child(odd){background-color:#fff}.itt_globes_cpt_manager_table :not(thead) tr:hover{background-color:#f1f1f1}.itt_globes_cpt_manager_table .buttons{text-align:right}.itt_globes_cpt_manager_table .buttons a.button{margin-left:5px}.postbox .csf-field-image_select figure:before,.postbox .csf-field-spinner .ui-spinner .ui-spinner-button:before{font-family:Font Awesome\ 5 Pro,Font Awesome\ 5 Free,Font Awesome\ 6 Free,FontAwesome} -
interactive-globes/trunk/dist/assets/css/public/itt-globes-style.min.css
r3207680 r3263746 1 .itt_globe_wrapper{margin:0 auto;width:100%}.itt_globe_aspect_ratio{height:0;position:relative;width:100%}.itt_globe{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:0;width:100%}.itt_globe_tooltip{b ackground:#fff;border-radius:3px;box-shadow:0 3px 15px rgba(0,0,0,.2);color:#000;padding:8px}.gbtn.disabled.glightbox-button-hidden{display:none}.itt_globe_display_content_left,.itt_globe_display_content_right{align-content:normal;align-items:normal;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between}.itt_globe_display_content_left .itt_globe_content_left,.itt_globe_display_content_right .itt_globe_container,.itt_globe_display_content_right .itt_globe_content_right{width:48%}.itt_globe_display_content_above .itt_globe_content_above,.itt_globe_display_content_below .itt_globe_content_below{flex-basis:100%;width:100%}.itt_globe_content{padding:1%}1 .itt_globe_wrapper{margin:0 auto;width:100%}.itt_globe_aspect_ratio{height:0;position:relative;width:100%}.itt_globe{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:0;width:100%}.itt_globe_tooltip{box-shadow:0 3px 15px rgba(0,0,0,.2);padding:8px}.itt_globe_html_marker,.itt_globe_tooltip{background:#fff;border-radius:3px;color:#000}.itt_globe_html_marker{box-shadow:0 3px 6px rgba(0,0,0,.2);font-size:.75em;padding:2px 4px}.gbtn.disabled.glightbox-button-hidden{display:none}.itt_globe_display_content_left,.itt_globe_display_content_right{align-content:normal;align-items:normal;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between}.itt_globe_display_content_left .itt_globe_container,.itt_globe_display_content_right .itt_globe_container{width:68%}.itt_globe_display_content_left .itt_globe_content_left,.itt_globe_display_content_right .itt_globe_content_right{width:30%}.itt_globe_display_content_right.itt_globe_display_content_left .itt_globe_container{width:50%}.itt_globe_display_content_right.itt_globe_display_content_left .itt_globe_content_left,.itt_globe_display_content_right.itt_globe_display_content_left .itt_globe_content_right{width:22%}.itt_globe_display_content_left .itt_globe_container,.itt_globe_display_content_right .itt_globe_container{flex-grow:1}.itt_globe_display_content_above .itt_globe_content_above,.itt_globe_display_content_below .itt_globe_content_below{flex-basis:100%;width:100%}.itt_globe_content{padding:1%}.itt-globe-region-counter{font-size:1.1em;margin:0 auto;text-align:center;width:100%}@media only screen and (max-width:768px){.itt_globe_container,.itt_globe_content,.itt_globe_display_content_left .itt_globe_content_left,.itt_globe_display_content_right .itt_globe_content_right{width:100%}.itt_globe_display_content_left{display:flex;flex-direction:column-reverse}.itt_globe_display_content_left .itt_globe_container,.itt_globe_display_content_right .itt_globe_container{width:100%}} -
interactive-globes/trunk/dist/assets/js/admin/admin.min.js
r3207712 r3263746 1 const globe_ut_prepareURL=function(e){if("string"!=typeof e)return e;var t;(e=e.replace(/&/gi,"&")).replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(t)}));try{t=new URL(e)}catch(e){t=!1}return t&&![null,"http:","https:","mailto:","tel:"].includes(t.protocol)?(console.log("URL protocol not allowed"),""):e};function setupClickEvent(e,t,i){let n={arcLines:"arcLineDefaults",points:"pointDefaults",dotLabels:"labelDefaults",regions:"regionDefaults" };if("regions"===i.type&&(i={...i.properties}),new URLSearchParams(window.location.search).has("debug")&&console.debug(i),"default"===i.action&&(i.action=t[n[i.type]].action),"none"===i.action)return;const o=i.action;o&&"function"==typeof window.ittGlobes.clickActions[o]&&window.ittGlobes.clickActions[o](e,t,i),ittGlobeData.isAdmin||("open_url"!==i.action&&"open_url_new"!==i.action||(i.content=globe_ut_prepareURL(i.content)),"open_url"===i.action&&""!==i.content?document.location=i.content:"open_url_new"===i.action&&""!==i.content&&window.open(i.content))}function addShortcodeCopyEvent(){document.getElementById("ittglobe-copy-button").addEventListener("click",(function(){const e=document.getElementById("meta_box_shortcode-code");if(navigator.clipboard)navigator.clipboard.writeText(e.innerText);else{var t=document.createRange();t.selectNode(e),window.getSelection().removeAllRanges(),window.getSelection().addRange(t),document.execCommand("copy"),window.getSelection().removeAllRanges()}this.classList.remove("dashicons-admin-page"),this.classList.add("dashicons-yes"),setTimeout((()=>{this.classList.remove("dashicons-yes"),this.classList.add("dashicons-admin-page")}),2e3)}))}let ittGlobesAdmin={preview:{},globeMeta:{},cptTabIndex:{itt_globe_point:2,itt_globe_dotlabel:3,itt_globe_region:4,itt_globe_line:5},init:function(){ittGlobesAdmin.buildPreview(),ittGlobesAdmin.setupGlobeReady(),ittGlobesAdmin.setMeta()},setMeta:function(){let e=document.querySelector(".itt_globe_render");e&&(ittGlobesAdmin.meta=e.dataset.globe_meta)},round:function(e){return Math.round(100*e)/100},setupGlobeReady:function(){document.addEventListener("adminGlobeReady",(function(){let e=Object.values(ittGlobes.globesIndex)[0];const t=JSON.parse(ittGlobesAdmin.meta);ittGlobesAdmin.preview.centerCoordinates={lat:0,lng:0,altitude:1.7},e.ringColor((()=>e=>`rgba(255,100,50,${1-e})`)).ringMaxRadius(3.5).ringAltitude(.006).ringPropagationSpeed(5).ringRepeatPeriod(400/3),e.onGlobeClick((function(t,i){t.latitude=ittGlobesAdmin.round(t.lat),t.longitude=ittGlobesAdmin.round(t.lng);const n={lat:t.lat,lng:t.lng};e.ringsData([...e.ringsData(),n]),setTimeout((()=>e.ringsData(e.ringsData().filter((e=>e!==n)))),400),ittGlobesAdmin.preview.clickedCoordinates=t,delete ittGlobesAdmin.preview.clickedElement,delete ittGlobesAdmin.preview.clickedDataset,ittGlobesAdmin.updateClickedPreviewInfo()})),e.onZoom((function(e){ittGlobesAdmin.preview.centerCoordinates=e,ittGlobesAdmin.updateCenterPreviewInfo()})),e.onPointClick((function(i,n,o){ittGlobesAdmin.preview.clickedElement=Object.assign({},i),ittGlobesAdmin.preview.clickedElement.type="Point",ittGlobesAdmin.preview.clickedElement.post_type="itt_globe_point",delete ittGlobesAdmin.preview.clickedElement.__threeObj,delete ittGlobesAdmin.preview.clickedCoordinates,delete ittGlobesAdmin.preview.clickedDataset,ittGlobesAdmin.updateClickedPreviewInfo(),setupClickEvent(e,t,i)})),e.onLabelClick((function(i,n,o){ittGlobesAdmin.preview.clickedElement=Object.assign({},i),ittGlobesAdmin.preview.clickedElement.type="Dot Label",ittGlobesAdmin.preview.clickedElement.post_type="itt_globe_dotlabel",delete ittGlobesAdmin.preview.clickedElement.__threeObj,delete ittGlobesAdmin.preview.clickedCoordinates,delete ittGlobesAdmin.preview.clickedDataset,ittGlobesAdmin.updateClickedPreviewInfo(),setupClickEvent(e,t,i)}))}))},setCenter:function(e){if(e.target){document.getElementsByName("globe_info[altitude]")[0].value=e.target.dataset.altitude,document.getElementsByName("globe_info[centerCoordinates][latitude]")[0].value=e.target.dataset.lat,document.getElementsByName("globe_info[centerCoordinates][longitude]")[0].value=e.target.dataset.lng,ittGlobesAdmin.onChange(),e.target.innerHTML=itt_admin_labels.newCenterSaved,e.target.setAttribute("disabled","disabled"),setTimeout((function(){e.target.innerHTML=itt_admin_labels.setInitialCenter,e.target.removeAttribute("disabled")}),2e3)}},updateClickedPreviewInfo:function(){let e=ittGlobesAdmin.preview;if(void 0!==e.clickedCoordinates){ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .itt_globe_preview_title").innerHTML="Clicked Location";let t=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .inside .itt_globe_preview_data"),i='<span class="ittglobe_lat_s">Lat: </span><span class="ittglobe_lat">'+e.clickedCoordinates.latitude+'</span><span class="ittglobe_lng_s">Long: </span><span class="ittglobe_lng">'+e.clickedCoordinates.longitude+"</span>";t.innerHTML=i,ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .itt_globe_preview_action_edit").style.display="none";let n=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .inside .itt_globe_preview_action_add_new"),o=n.dataset.latitude,l=n.dataset.longitude;Object.keys(n.dataset).forEach((e=>{delete n.dataset[e]})),n.dataset.prevlatitude=o,n.dataset.prevlongitude=l,n.dataset.latitude=e.clickedCoordinates.latitude,n.dataset.longitude=e.clickedCoordinates.longitude,void 0!==ittGlobesAdmin.preview.clickedDataset&&(Object.keys(ittGlobesAdmin.preview.clickedDataset).forEach((e=>{n.dataset[e]=ittGlobesAdmin.preview.clickedDataset[e]})),delete ittGlobesAdmin.preview.clickedDataset),n.style.display="inline-block"}if(void 0!==e.clickedElement){ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .itt_globe_preview_title").innerHTML="Clicked "+e.clickedElement.type+" : "+e.clickedElement.title;let t=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .inside .itt_globe_preview_data"),i='<span class="ittglobe_lat_s">Lat: </span><span class="ittglobe_lat">'+ittGlobesAdmin.round(e.clickedElement.coordinates.latitude)+'</span><span class="ittglobe_lng_s">Long: </span><span class="ittglobe_lng">'+ittGlobesAdmin.round(e.clickedElement.coordinates.longitude)+"</span>";if(t.innerHTML=i,"itt_globe_point"===e.clickedElement.post_type||"itt_globe_dotlabel"===e.clickedElement.post_type||void 0!==e.clickedElement.post_id){let t=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .itt_globe_preview_action_edit");t.dataset.id=e.clickedElement.post_id?e.clickedElement.post_id:e.clickedElement.id,t.dataset.post_type=e.clickedElement.post_type,t.style.display="inline-block";let i=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .inside .itt_globe_preview_action_add_new");i.style.display="inline-block",i.dataset.prevlatitude=i.dataset.latitude,i.dataset.prevlongitude=i.dataset.longitude,i.dataset.latitude=ittGlobesAdmin.round(e.clickedElement.coordinates.latitude),i.dataset.longitude=ittGlobesAdmin.round(e.clickedElement.coordinates.longitude)}}},updateCenterPreviewInfo:function(){let e=ittGlobesAdmin.preview;e.centerCoordinates.latitude=ittGlobesAdmin.round(ittGlobesAdmin.preview.centerCoordinates.lat),e.centerCoordinates.longitude=ittGlobesAdmin.round(ittGlobesAdmin.preview.centerCoordinates.lng),e.centerCoordinates.altitude=ittGlobesAdmin.round(ittGlobesAdmin.preview.centerCoordinates.altitude);let t=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_center .inside .itt_globe_preview_data"),i='<span class="ittglobe_lat_s">Lat: </span><span class="ittglobe_lat">'+e.centerCoordinates.latitude+'</span><span class="ittglobe_lng_s">Long: </span><span class="ittglobe_lng">'+e.centerCoordinates.longitude+'</span><span class="ittglobe_altitude_s">Scale: </span><span class="ittglobe_altitude">'+e.centerCoordinates.altitude+"</span>";ittGlobesAdmin.setCenterButton.dataset.lat=e.centerCoordinates.lat,ittGlobesAdmin.setCenterButton.dataset.lng=e.centerCoordinates.lng,ittGlobesAdmin.setCenterButton.dataset.altitude=e.centerCoordinates.altitude,t.innerHTML=i},buildPreview:function(){let e=".itt_globe_info input, .itt_globe_info select, .itt_globe_info textarea",t=document.querySelectorAll(e);t.forEach((function(e){e.onchange=ittGlobesAdmin.onChange})),document.querySelectorAll(".csf-cloneable-add").forEach((function(i){i.addEventListener("click",(function(i){t.forEach((function(e){e.onchange=null})),setTimeout((function(){t=document.querySelectorAll(e),t.forEach((function(e){e.onchange=ittGlobesAdmin.onChange}))}),500)}))})),ittGlobesAdmin.preview.centerCoordinates={lat:void 0===ittGlobesAdmin.globeMeta.centerCoordinates?0:ittGlobesAdmin.globeMeta.centerCoordinates.latitude,lng:void 0===ittGlobesAdmin.globeMeta.centerCoordinates?0:ittGlobesAdmin.globeMeta.centerCoordinates.longitude,altitude:void 0===ittGlobesAdmin.globeMeta.altitude?1.7:ittGlobesAdmin.globeMeta.altitude};let i=document.getElementsByClassName("itt_globe_preview_info");i.length<1?ittGlobesAdmin.infoContainer=null:(ittGlobesAdmin.infoContainer=i[0],ittGlobesAdmin.setCenterButton=document.querySelector(".itt_globe_preview_info #itt_globe_preview_data_center .itt_globe_preview_action button"),ittGlobesAdmin.setCenterButton.addEventListener("click",ittGlobesAdmin.setCenter),ittGlobesAdmin.updateCenterPreviewInfo())},onChange:function(){let e=document.querySelector(".itt_globe_preview");e instanceof HTMLElement&&e.classList.add("itt_globe_preview_needs_update")},addNew:function(e){if(e){let t=document.getElementById("post_ID").value;console.log("Add new "+JSON.stringify(e.dataset)+" dataType:"+e.value+" parentGlobe: "+t);let i=ittGlobesAdmin.cptTabIndex[e.value],n=document.querySelectorAll(".csf-nav-metabox ul li a");if(n&&n[i].click(),"undefined"!=typeof addNew){let i=[];for(const t in e.dataset)e.dataset.hasOwnProperty(t)&&i.push([t,e.dataset[t]]);i.push(["post_type",e.value]),i.push(["parent_id",t]),addNew(e.value,t,i),e.value=""}else console.log("something went wrong")}},edit:function(e){if(e&&(console.log("edit "+JSON.stringify(e.dataset)),"undefined"!=typeof editEntry)){let t=[];for(const i in e.dataset)e.dataset.hasOwnProperty(i)&&t.push([i,e.dataset[i]]);let i=ittGlobesAdmin.cptTabIndex[e.dataset.post_type],n=document.querySelectorAll(".csf-nav-metabox ul li a");n&&n[i].click();let o=document.getElementById("post_ID").value;editEntry(e.dataset.post_type,e.dataset.id,o,t)}}};ittGlobesAdmin.init(),window.ittGlobesAdmin=ittGlobesAdmin,addShortcodeCopyEvent();export{ittGlobesAdmin};1 const globe_ut_prepareURL=function(e){if("string"!=typeof e)return e;var t;(e=e.replace(/&/gi,"&")).replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(t)}));try{t=new URL(e)}catch(e){t=!1}return t&&![null,"http:","https:","mailto:","tel:"].includes(t.protocol)?(console.log("URL protocol not allowed"),""):e};function setupClickEvent(e,t,i){let n={arcLines:"arcLineDefaults",points:"pointDefaults",dotLabels:"labelDefaults",regions:"regionDefaults",html:"htmlDefaults"};if("regions"===i.type&&(i={...i.properties}),new URLSearchParams(window.location.search).has("debug")&&console.debug(i),"default"===i.action&&(i.action=t[n[i.type]].action),"none"===i.action)return;const o=i.action;o&&"function"==typeof window.ittGlobes.clickActions[o]&&window.ittGlobes.clickActions[o](e,t,i),ittGlobeData.isAdmin||("open_url"!==i.action&&"open_url_new"!==i.action||(i.content=globe_ut_prepareURL(i.content)),"open_url"===i.action&&""!==i.content?document.location=i.content:"open_url_new"===i.action&&""!==i.content&&window.open(i.content))}function addShortcodeCopyEvent(){document.getElementById("ittglobe-copy-button").addEventListener("click",(function(){const e=document.getElementById("meta_box_shortcode-code");if(navigator.clipboard)navigator.clipboard.writeText(e.innerText);else{var t=document.createRange();t.selectNode(e),window.getSelection().removeAllRanges(),window.getSelection().addRange(t),document.execCommand("copy"),window.getSelection().removeAllRanges()}this.classList.remove("dashicons-admin-page"),this.classList.add("dashicons-yes"),setTimeout((()=>{this.classList.remove("dashicons-yes"),this.classList.add("dashicons-admin-page")}),2e3)}))}let ittGlobesAdmin={preview:{},globeMeta:{},cptTabIndex:{itt_globe_point:2,itt_globe_dotlabel:3,itt_globe_html:4,itt_globe_region:5,itt_globe_line:6}};ittGlobesAdmin.globeMeta=function(){let e=document.querySelector(".js-itt-globe-render");if(e&&e.dataset.globe_meta)try{return JSON.parse(e.dataset.globe_meta)}catch(e){return console.error("Error parsing globe meta data:",e),{}}return{}}(),ittGlobesAdmin.init=function(){ittGlobesAdmin.buildPreview(),ittGlobesAdmin.setupGlobeReady(),ittGlobesAdmin.setMeta()},ittGlobesAdmin.setMeta=function(){let e=document.querySelector(".itt_globe_render");e&&(ittGlobesAdmin.meta=e.dataset.globe_meta)},ittGlobesAdmin.round=function(e){return Math.round(100*e)/100},ittGlobesAdmin.setupGlobeReady=function(){document.addEventListener("adminGlobeReady",(function(){let e=Object.values(ittGlobes.globesIndex)[0];const t=JSON.parse(ittGlobesAdmin.meta);ittGlobesAdmin.preview.centerCoordinates={lat:0,lng:0,altitude:1.7},e.ringColor((()=>e=>`rgba(255,100,50,${1-e})`)).ringMaxRadius(3.5).ringAltitude(.006).ringPropagationSpeed(5).ringRepeatPeriod(400/3);const i=e.onGlobeClick();e.onGlobeClick((function(t,n){i&&i(t,n),t.latitude=ittGlobesAdmin.round(t.lat),t.longitude=ittGlobesAdmin.round(t.lng);const o={lat:t.lat,lng:t.lng};e.ringsData([...e.ringsData(),o]),setTimeout((()=>e.ringsData(e.ringsData().filter((e=>e!==o)))),400),ittGlobesAdmin.preview.clickedCoordinates=t,delete ittGlobesAdmin.preview.clickedElement,delete ittGlobesAdmin.preview.clickedDataset,ittGlobesAdmin.updateClickedPreviewInfo()}));const n=e.onZoom();e.onZoom((function(e){n&&n(e),ittGlobesAdmin.preview.centerCoordinates=e,ittGlobesAdmin.updateCenterPreviewInfo()})),e.onPointClick((function(i,n,o){ittGlobesAdmin.preview.clickedElement=Object.assign({},i),ittGlobesAdmin.preview.clickedElement.type="Point",ittGlobesAdmin.preview.clickedElement.post_type="itt_globe_point",delete ittGlobesAdmin.preview.clickedElement.__threeObj,delete ittGlobesAdmin.preview.clickedCoordinates,delete ittGlobesAdmin.preview.clickedDataset,ittGlobesAdmin.updateClickedPreviewInfo(),setupClickEvent(e,t,i)})),e.onLabelClick((function(i,n,o){ittGlobesAdmin.preview.clickedElement=Object.assign({},i),ittGlobesAdmin.preview.clickedElement.type="Dot Label",ittGlobesAdmin.preview.clickedElement.post_type="itt_globe_dotlabel",delete ittGlobesAdmin.preview.clickedElement.__threeObj,delete ittGlobesAdmin.preview.clickedCoordinates,delete ittGlobesAdmin.preview.clickedDataset,ittGlobesAdmin.updateClickedPreviewInfo(),setupClickEvent(e,t,i)}))}))},ittGlobesAdmin.setCenter=function(e){if(e.target){document.getElementsByName("globe_info[altitudeOptions][altitude]")[0].value=e.target.dataset.altitude,document.getElementsByName("globe_info[centerCoordinates][latitude]")[0].value=e.target.dataset.lat,document.getElementsByName("globe_info[centerCoordinates][longitude]")[0].value=e.target.dataset.lng,ittGlobesAdmin.onChange(),e.target.innerHTML=itt_admin_labels.newCenterSaved,e.target.setAttribute("disabled","disabled"),setTimeout((function(){e.target.innerHTML=itt_admin_labels.setInitialCenter,e.target.removeAttribute("disabled")}),2e3)}},ittGlobesAdmin.updateClickedPreviewInfo=function(){let e=ittGlobesAdmin.preview;if(void 0!==e.clickedCoordinates){ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .itt_globe_preview_title").innerHTML="Clicked Location";let t=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .inside .itt_globe_preview_data"),i='<span class="ittglobe_lat_s">Lat: </span><span class="ittglobe_lat">'+e.clickedCoordinates.latitude+'</span><span class="ittglobe_lng_s">Long: </span><span class="ittglobe_lng">'+e.clickedCoordinates.longitude+"</span>";t.innerHTML=i,ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .itt_globe_preview_action_edit").style.display="none";let n=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .inside .itt_globe_preview_action_add_new"),o=n.dataset.latitude,l=n.dataset.longitude;Object.keys(n.dataset).forEach((e=>{delete n.dataset[e]})),n.dataset.prevlatitude=o,n.dataset.prevlongitude=l,n.dataset.latitude=e.clickedCoordinates.latitude,n.dataset.longitude=e.clickedCoordinates.longitude,void 0!==ittGlobesAdmin.preview.clickedDataset&&(Object.keys(ittGlobesAdmin.preview.clickedDataset).forEach((e=>{n.dataset[e]=ittGlobesAdmin.preview.clickedDataset[e]})),delete ittGlobesAdmin.preview.clickedDataset),n.style.display="inline-block"}if(void 0!==e.clickedElement){ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .itt_globe_preview_title").innerHTML="Clicked "+e.clickedElement.type+" : "+e.clickedElement.title;let t=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .inside .itt_globe_preview_data"),i='<span class="ittglobe_lat_s">Lat: </span><span class="ittglobe_lat">'+ittGlobesAdmin.round(e.clickedElement.coordinates.latitude)+'</span><span class="ittglobe_lng_s">Long: </span><span class="ittglobe_lng">'+ittGlobesAdmin.round(e.clickedElement.coordinates.longitude)+"</span>";if(t.innerHTML=i,"itt_globe_point"===e.clickedElement.post_type||"itt_globe_dotlabel"===e.clickedElement.post_type||void 0!==e.clickedElement.post_id){let t=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .itt_globe_preview_action_edit");t.dataset.id=e.clickedElement.post_id?e.clickedElement.post_id:e.clickedElement.id,t.dataset.post_type=e.clickedElement.post_type,t.style.display="inline-block";let i=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .inside .itt_globe_preview_action_add_new");i.style.display="inline-block",i.dataset.prevlatitude=i.dataset.latitude,i.dataset.prevlongitude=i.dataset.longitude,i.dataset.latitude=ittGlobesAdmin.round(e.clickedElement.coordinates.latitude),i.dataset.longitude=ittGlobesAdmin.round(e.clickedElement.coordinates.longitude)}}},ittGlobesAdmin.updateCenterPreviewInfo=function(){let e=ittGlobesAdmin.preview;e.centerCoordinates.latitude=ittGlobesAdmin.round(ittGlobesAdmin.preview.centerCoordinates.lat),e.centerCoordinates.longitude=ittGlobesAdmin.round(ittGlobesAdmin.preview.centerCoordinates.lng),e.centerCoordinates.altitude=ittGlobesAdmin.round(ittGlobesAdmin.preview.centerCoordinates.altitude);let t=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_center .inside .itt_globe_preview_data"),i='<span class="ittglobe_lat_s">Lat: </span><span class="ittglobe_lat">'+e.centerCoordinates.latitude+'</span><span class="ittglobe_lng_s">Long: </span><span class="ittglobe_lng">'+e.centerCoordinates.longitude+'</span><span class="ittglobe_altitude_s">Altitude/Scale: </span><span class="ittglobe_altitude">'+e.centerCoordinates.altitude+"</span>";ittGlobesAdmin.setCenterButton.dataset.lat=e.centerCoordinates.lat,ittGlobesAdmin.setCenterButton.dataset.lng=e.centerCoordinates.lng,ittGlobesAdmin.setCenterButton.dataset.altitude=e.centerCoordinates.altitude,t.innerHTML=i},ittGlobesAdmin.buildPreview=function(){let e=".itt_globe_info input, .itt_globe_info select, .itt_globe_info textarea",t=document.querySelectorAll(e);t.forEach((function(e){e.onchange=ittGlobesAdmin.onChange})),document.querySelectorAll(".csf-cloneable-add").forEach((function(i){i.addEventListener("click",(function(i){t.forEach((function(e){e.onchange=null})),setTimeout((function(){t=document.querySelectorAll(e),t.forEach((function(e){e.onchange=ittGlobesAdmin.onChange}))}),500)}))}));let i=void 0===ittGlobesAdmin.globeMeta.altitudeOptions?ittGlobesAdmin.globeMeta.altitude:ittGlobesAdmin.globeMeta.altitudeOptions.altitude;ittGlobesAdmin.preview.centerCoordinates={lat:void 0===ittGlobesAdmin.globeMeta.centerCoordinates?0:ittGlobesAdmin.globeMeta.centerCoordinates.latitude,lng:void 0===ittGlobesAdmin.globeMeta.centerCoordinates?0:ittGlobesAdmin.globeMeta.centerCoordinates.longitude,altitude:void 0===i?1.7:i};let n=document.getElementsByClassName("itt_globe_preview_info");n.length<1?ittGlobesAdmin.infoContainer=null:(ittGlobesAdmin.infoContainer=n[0],ittGlobesAdmin.setCenterButton=document.querySelector(".itt_globe_preview_info #itt_globe_preview_data_center .itt_globe_preview_action button"),ittGlobesAdmin.setCenterButton.addEventListener("click",ittGlobesAdmin.setCenter),ittGlobesAdmin.updateCenterPreviewInfo())},ittGlobesAdmin.onChange=function(){let e=document.querySelector(".itt_globe_preview");e instanceof HTMLElement&&e.classList.add("itt_globe_preview_needs_update")},ittGlobesAdmin.addNew=function(e){if(e){let t=document.getElementById("post_ID").value;console.log("Add new "+JSON.stringify(e.dataset)+" dataType:"+e.value+" parentGlobe: "+t);let i=ittGlobesAdmin.cptTabIndex[e.value],n=document.querySelectorAll(".csf-nav-metabox ul li a");if(n&&n[i].click(),"undefined"!=typeof addNew){let i=[];for(const t in e.dataset)e.dataset.hasOwnProperty(t)&&i.push([t,e.dataset[t]]);i.push(["post_type",e.value]),i.push(["parent_id",t]),addNew(e.value,t,i),e.value=""}else console.log("something went wrong")}},ittGlobesAdmin.edit=function(e){if(e&&(console.log("edit "+JSON.stringify(e.dataset)),"undefined"!=typeof editEntry)){let t=[];for(const i in e.dataset)e.dataset.hasOwnProperty(i)&&t.push([i,e.dataset[i]]);let i=ittGlobesAdmin.cptTabIndex[e.dataset.post_type],n=document.querySelectorAll(".csf-nav-metabox ul li a");n&&n[i].click();let o=document.getElementById("post_ID").value;editEntry(e.dataset.post_type,e.dataset.id,o,t)}},ittGlobesAdmin.init(),window.ittGlobesAdmin=ittGlobesAdmin,addShortcodeCopyEvent();export{ittGlobesAdmin}; -
interactive-globes/trunk/dist/assets/js/admin/cpt-list-events.min.js
r3207680 r3263746 1 function refresh_cpt_list(t,e){get_cpt_list(t,e).then((e=>{var o=document.getElementById("fill_"+t);return!!o&&(o.innerHTML=e,init_cpt_events(t),ittGlobesAdmin.onChange(),!0)}))}async function get_cpt_list(t,e){try{const o=itt_globe_rest.namespace+e+"/"+t+itt_globe_rest.list_part, n=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json","X-WP-Nonce":itt_globe_rest.nonce}});if(!n.ok)throw new Error("Network response was not OK");return await n.json()}catch(t){console.error("There has been a problem with your fetch operation:",t)}}function init_cpt_events(t){let e="#block_"+t,o=document.querySelector(e);o&&(o.querySelectorAll(".js-remove-cpt").forEach((function(t){t.addEventListener("click",do_remove_event)})),o.querySelectorAll(".js-modal-edit-cpt").forEach((function(t){t.addEventListener("click",(function(t){let e=[];for(const t in this.dataset)this.dataset.hasOwnProperty(t)&&e.push([t,this.dataset[t]]);const o=this.getAttribute("data-cpt_post_id"),n=this.getAttribute("data-parent_id");editEntry(this.getAttribute("data-post_type"),o,n,e)}))})),o.querySelectorAll(".js-modal-add-new-cpt").forEach((function(t){t.addEventListener("click",(function(t){t.preventDefault();const e=this.getAttribute("data-parent_id"),o=this.getAttribute("data-post_type");let n=[];for(const t in this.dataset)this.dataset.hasOwnProperty(t)&&n.push([t,this.dataset[t]]);addNew(o,e,n)}))})),o.querySelectorAll(".js-modal-close").forEach((function(t){t.addEventListener("click",(function(t){t.preventDefault();closeModal(this.getAttribute("data-post_type"))}))})))}function do_remove_event(t){if(!confirm("Are you sure?"))return;t.preventDefault();const e=this.getAttribute("data-cpt_post_id"),o=this.getAttribute("data-parent_id"),n=this.getAttribute("data-post_type"),r=new XMLHttpRequest;r.open("POST",`/wp-json/wp/v2/${n}/${e}?_method=DELETE`,!0),r.setRequestHeader("Content-Type","application/json"),r.setRequestHeader("X-WP-Nonce",wpApiSettings.nonce),r.onload=function(){r.status>=200&&r.status<300?(JSON.parse(r.responseText),refresh_cpt_list(n,o)):console.error("Error trashing post:",r.statusText)},r.onerror=function(){console.error("Network error occurred")},r.send()}function editEntry(t,e,o,n){query_params=[["action","edit"],["iframe",""],["post",e],["parent_id",o]].concat(n);const r=build_modal_url(itt_globe_data.admin_url,"post.php",query_params),a=document.querySelector("#"+t+"_modal iframe");a.setAttribute("src",r),a.addEventListener("load",(function(){document.querySelector("#"+t+"_modal .overlay-content-loading").style.display="none",a.style.display="block"})),document.getElementById(t+"_modal").style.display="block"}function addNew(t,e,o){let n=[["iframe",""]].concat(o);const r=build_modal_url(itt_globe_data.admin_url,"post-new.php",n),a=document.querySelector("#"+t+"_modal iframe");a.setAttribute("src",r),a.addEventListener("load",(function(){document.querySelector("#"+t+"_modal .overlay-content-loading").style.display="none",a.style.display="block"})),document.getElementById(t+"_modal").style.display="block"}function closeModal(t){document.getElementById(t+"_modal").style.display="none",document.querySelector("#"+t+"_modal .overlay-content-loading").style.display="block",document.querySelector("#"+t+"_modal iframe").setAttribute("src","")}function build_modal_url(t,e,o){const n=new URLSearchParams;return o.forEach((t=>{if(!Array.isArray(t)||2!==t.length)throw new Error("Each param should be an array with two elements: [key, value]");n.append(t[0],t[1])})),t+e+"?"+n.toString()}window.addEventListener("message",(function(t){if(!t.data.hasOwnProperty("message")||!t.data.hasOwnProperty("params"))return;if("refresh-cpt-list"!==t.data.message)return;const e=t.data.params;(e.hasOwnProperty("post_type")||e.hasOwnProperty("parent_id"))&&refresh_cpt_list(e.post_type,e.parent_id)}));1 function refresh_cpt_list(t,e){get_cpt_list(t,e).then((e=>{var o=document.getElementById("fill_"+t);return!!o&&(o.innerHTML=e,init_cpt_events(t),ittGlobesAdmin.onChange(),!0)}))}async function get_cpt_list(t,e){try{const o=itt_globe_rest.namespace+e+"/"+t+itt_globe_rest.list_part,r=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json","X-WP-Nonce":itt_globe_rest.nonce}});if(!r.ok)throw new Error("Network response was not OK");return await r.json()}catch(t){console.error("There has been a problem with your fetch operation:",t)}}function init_cpt_events(t){let e="#block_"+t,o=document.querySelector(e);o&&(o.querySelectorAll(".js-remove-cpt").forEach((function(t){t.addEventListener("click",do_remove_event)})),o.querySelectorAll(".js-modal-edit-cpt").forEach((function(t){t.addEventListener("click",(function(t){let e=[];for(const t in this.dataset)this.dataset.hasOwnProperty(t)&&e.push([t,this.dataset[t]]);const o=this.getAttribute("data-cpt_post_id"),r=this.getAttribute("data-parent_id");editEntry(this.getAttribute("data-post_type"),o,r,e)}))})),o.querySelectorAll(".js-modal-add-new-cpt").forEach((function(t){t.addEventListener("click",(function(t){t.preventDefault();const e=this.getAttribute("data-parent_id"),o=this.getAttribute("data-post_type");let r=[];for(const t in this.dataset)this.dataset.hasOwnProperty(t)&&r.push([t,this.dataset[t]]);addNew(o,e,r)}))})),o.querySelectorAll(".js-modal-close").forEach((function(t){t.addEventListener("click",(function(t){t.preventDefault();closeModal(this.getAttribute("data-post_type"))}))})))}function do_remove_event(t){if(!confirm("Are you sure?"))return;t.preventDefault();const e=this.getAttribute("data-cpt_post_id"),o=this.getAttribute("data-parent_id"),r=this.getAttribute("data-post_type"),n=new XMLHttpRequest,a=itt_globe_rest.url+r+"/"+e+"?_method=DELETE";n.open("POST",a,!0),n.setRequestHeader("Content-Type","application/json"),n.setRequestHeader("X-WP-Nonce",wpApiSettings.nonce),n.onload=function(){n.status>=200&&n.status<300?(JSON.parse(n.responseText),refresh_cpt_list(r,o)):console.error("Error trashing post:",n.statusText)},n.onerror=function(){console.error("Network error occurred")},n.send()}function setupModalObserver(t,e){const o=e.contentDocument||e.contentWindow.document;new MutationObserver((e=>{e.forEach((e=>{if("class"===e.attributeName){const e=o.body.classList.contains("modal-open"),r=document.querySelector("#"+t+"_modal .overlay-controls"),n=document.querySelector("#"+t+"_modal .closebtn");e?(r.classList.add("disabled"),r.querySelectorAll("a.button").forEach((t=>{t.setAttribute("disabled","disabled")})),n.classList.add("disabled")):(r.classList.remove("disabled"),r.querySelectorAll("a.button").forEach((t=>{t.removeAttribute("disabled")})),n.classList.remove("disabled"))}}))})).observe(o.body,{attributes:!0,attributeFilter:["class"]})}function editEntry(t,e,o,r){query_params=[["action","edit"],["iframe",""],["post",e],["parent_id",o]].concat(r);const n=build_modal_url(itt_globe_data.admin_url,"post.php",query_params),a=document.querySelector("#"+t+"_modal iframe");a.setAttribute("src",n),a.addEventListener("load",(function(){document.querySelector("#"+t+"_modal .overlay-content-loading").style.display="none",a.style.display="block",setupModalObserver(t,a)})),document.getElementById(t+"_modal").style.display="block"}function addNew(t,e,o){let r=[["iframe",""]].concat(o);const n=build_modal_url(itt_globe_data.admin_url,"post-new.php",r),a=document.querySelector("#"+t+"_modal iframe");a.setAttribute("src",n),a.addEventListener("load",(function(){document.querySelector("#"+t+"_modal .overlay-content-loading").style.display="none",a.style.display="block",setupModalObserver(t,a)})),document.getElementById(t+"_modal").style.display="block"}function closeModal(t){document.getElementById(t+"_modal").style.display="none",document.querySelector("#"+t+"_modal .overlay-content-loading").style.display="block",document.querySelector("#"+t+"_modal iframe").setAttribute("src","")}function build_modal_url(t,e,o){const r=new URLSearchParams;return o.forEach((t=>{if(!Array.isArray(t)||2!==t.length)throw new Error("Each param should be an array with two elements: [key, value]");r.append(t[0],t[1])})),t+e+"?"+r.toString()}window.addEventListener("message",(function(t){if(!t.data.hasOwnProperty("message")||!t.data.hasOwnProperty("params"))return;if("refresh-cpt-list"!==t.data.message)return;const e=t.data.params;(e.hasOwnProperty("post_type")||e.hasOwnProperty("parent_id"))&&refresh_cpt_list(e.post_type,e.parent_id)})); -
interactive-globes/trunk/dist/assets/js/admin/cpt-modal-events.min.js
r3207680 r3263746 1 function jsonToObject(t){const e={};for(let n=0;n<t.length;n++){setObjectValue(e,t[n][0],t[n][1])}return e}function setObjectValue(t,e,n){const r=e.split("[").map((t=>t.replace("]","")));let o=t;for(let t=0;t<r.length;t++){const e=r[t];t===r.length-1?o[e]=n:(o[e]||(o[e]={}),o=o[e])}}async function submit_unserialized(t,e,n){try{const r=itt_globe_rest.url+t+"/"+e,o=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":itt_globe_rest.nonce},body:JSON.stringify(n)});if(!o.ok)throw new Error("Network response was not OK");return await o.json()}catch(t){console.error("There has been a problem with your fetch operation:",t)}}async function submit_data_as_meta(t,e,n){let r={meta:n};return await submit_unserialized(t,e,r)}async function submit_unserialized_meta_objet(t,e,n){const r={};for(let o in n)if(n.hasOwnProperty(o)){if("object"!=typeof n[o]||null===n[o])return r[o]=n[o],await submit_data_as_meta(t,e,r);submit_unserialized_meta_objet(t,e,n[o])}}async function submit_meta(t,e,n,r){const o=[],a=Array.from(n),i={};a.forEach((([t,e])=>{t=t.replace("[]",""),i[t]?(Array.isArray(i[t])||(i[t]=[i[t]]),i[t].push(e)):i[t]=e}));const s=Object.entries(i);return console.log(a),console.log(s),Object.entries(r).forEach((async function(n){var r=n[0],a=n[1];if(void 0!==a.args){if("unserialize"===a.args.data_type){let n=jsonToObject(s.filter((([t])=>t.startsWith(r))));o.push(submit_unserialized_meta_objet(t,e,n))}if("serialize"===a.args.data_type){let n=jsonToObject(s.filter((([t])=>t.startsWith(r))));o.push(submit_data_as_meta(t,e,n))}}})),await Promise.all(o),!0}async function submit_cpt(t){const e=t.get("cpt_post_id");0==e&&(e=null);const n=t.get("relationship_parent_id");let r=Array.from(t).filter((([t])=>t.includes(itt_globe_meta.relationship_key)));r.length>0&&r[0].hasOwnProperty(0)&&r[0].hasOwnProperty(1)&&""===r[0][1]&&t.set(r[0][0],n);let o=t.get("extra_values");o=JSON.parse(o);let a=t.get("cpt_meta_boxes");a=JSON.parse(a);const i=t.get("post_type");if(!i)return;const s=o.map((async n=>{let r={};return r[n]=t.get(n),r.status="publish",await submit_unserialized(i,e,r)})),l=await Promise.all(s);if(l.length>0){const n=l[0];0==e&&void 0!==n.id&&(e=n.id),await submit_meta(i,e,t,a)}return e}async function saveModal(t){const e=document.querySelector("#"+t+"_modal iframe");if(!e)return null;let n=e.contentWindow.document.getElementById("cpt-post"),r=new FormData(n);try{return await submit_cpt(r)}catch(t){console.error("Error:",t)}}function notifyParent(t,e){let n={message:t,params:e};window.parent.postMessage(n,"*")}document.addEventListener("DOMContentLoaded",(function(){document.querySelectorAll(".js-modal-save").forEach((function(t){t.addEventListener("click",(function(t){t.preventDefault();let e=null;const n=this.getAttribute("data-post_type"),r=this.getAttribute("data-parent_id");this.innerHTML="Saving...",this.setAttribute("disabled","disabled"),saveModal(n).then((o=>void 0===o?null:(e=o,notifyParent("refresh-cpt-list",{post_type:n,parent_id:r}),t.target.innerHTML="Save",t.target.removeAttribute("disabled"),closeModal(n),e))).catch((t=>(console.error("Error processing items:",t),notifyParent("form-with-error",{error:t,post_type:n}),null)))}))}))}));const pencilIcons=document.querySelectorAll(".edit_mode__trigger");pencilIcons.forEach((t=>{t.addEventListener("click",(()=>{t.parentNode.querySelectorAll(".modal__title__input").forEach((function(t){t.classList.toggle("visible")})),t.parentNode.querySelectorAll(".edit_mode__static").forEach((function(t){t.classList.toggle("invisible")}))}))}));1 function jsonToObject(t){const e={};for(let n=0;n<t.length;n++){setObjectValue(e,t[n][0],t[n][1])}return e}function setObjectValue(t,e,n){const r=e.split("[").map((t=>t.replace("]","")));let a=t;for(let t=0;t<r.length;t++){const e=r[t];t===r.length-1?a[e]=n:(a[e]||(a[e]={}),a=a[e])}}async function submit_unserialized(t,e,n){try{const r=itt_globe_rest.url+t+"/"+e,a=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":itt_globe_rest.nonce},body:JSON.stringify(n)});if(!a.ok)throw new Error("Network response was not OK");return await a.json()}catch(t){console.error("There has been a problem with your fetch operation:",t)}}async function submit_data_as_meta(t,e,n){let r={meta:n};return await submit_unserialized(t,e,r)}async function submit_unserialized_meta_objet(t,e,n){const r={};for(let a in n)if(n.hasOwnProperty(a)){if("object"!=typeof n[a]||null===n[a])return r[a]=n[a],await submit_data_as_meta(t,e,r);submit_unserialized_meta_objet(t,e,n[a])}}async function submit_meta(t,e,n,r){const a=[],o=Array.from(n),s={};o.forEach((([t,e])=>{t=t.replace("[]",""),s[t]?(Array.isArray(s[t])||(s[t]=[s[t]]),s[t].push(e)):s[t]=e}));const i=Object.entries(s);return console.log(o),console.log(i),Object.entries(r).forEach((async function(n){var r=n[0],o=n[1];if(void 0!==o.args){if("unserialize"===o.args.data_type){let n=jsonToObject(i.filter((([t])=>t.startsWith(r))));a.push(submit_unserialized_meta_objet(t,e,n))}if("serialize"===o.args.data_type){let n=jsonToObject(i.filter((([t])=>t.startsWith(r))));a.push(submit_data_as_meta(t,e,n))}}})),await Promise.all(a),!0}async function submit_cpt(t){const e=t.get("cpt_post_id");0==e&&(e=null);const n=t.get("relationship_parent_id");let r=Array.from(t).filter((([t])=>t.includes(itt_globe_meta.relationship_key)));r.length>0&&r[0].hasOwnProperty(0)&&r[0].hasOwnProperty(1)&&""===r[0][1]&&t.set(r[0][0],n);let a=t.get("extra_values");a=JSON.parse(a);let o=t.get("cpt_meta_boxes");o=JSON.parse(o);const s=t.get("post_type");if(!s)return;const i=a.map((async n=>{let r={};return r[n]=t.get(n),r.status="publish",await submit_unserialized(s,e,r)})),l=await Promise.all(i);if(l.length>0){const n=l[0];0==e&&void 0!==n.id&&(e=n.id),await submit_meta(s,e,t,o)}return e}async function saveModal(t){const e=document.querySelector("#"+t+"_modal iframe");if(!e)return null;let n=e.contentWindow.document.getElementById("cpt-post"),r=new FormData(n);try{return await submit_cpt(r)}catch(t){console.error("Error:",t)}}function notifyParent(t,e){let n={message:t,params:e};window.parent.postMessage(n,"*")}document.addEventListener("DOMContentLoaded",(function(){document.querySelectorAll(".js-modal-save").forEach((function(t){t.addEventListener("click",(function(t){t.preventDefault();let e=null;const n=this.getAttribute("data-post_type"),r=this.getAttribute("data-parent_id");this.innerHTML="Saving...",this.setAttribute("disabled","disabled"),saveModal(n).then((a=>void 0===a?null:(e=a,notifyParent("refresh-cpt-list",{post_type:n,parent_id:r}),t.target.innerHTML="Save",t.target.removeAttribute("disabled"),closeModal(n),e))).catch((t=>(console.error("Error processing items:",t),notifyParent("form-with-error",{error:t,post_type:n}),null)))}))}))})); -
interactive-globes/trunk/dist/assets/js/public/globe.min.js
r3207680 r3263746 1 function setupTooltip(t,e){let o=t.tooltipContent??"";return void 0!==e&&"{tooltipContent}"!==e&&e.length>0&&(o=e.replace(/\{([^}]+)\}/g,(function(e,o){const n=o.split(".");let i=t;for(let t=0;t<n.length;t++)i=i?i[n[t]]:void 0;return void 0!==i?i:""}))),""!==o&&(o='<div class="itt_globe_'+t.globe_id+' itt_globe_tooltip">'+o+"</div>"),o}const globe_ut_prepareURL=function(t){if("string"!=typeof t)return t;var e;(t=t.replace(/&/gi,"&")).replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(e)}));try{e=new URL(t)}catch(t){e=!1}return e&&![null,"http:","https:","mailto:","tel:"].includes(e.protocol)?(console.log("URL protocol not allowed"),""):t},globe_ut_prepareData=function(t){t.hasOwnProperty("dotLabels")&&t.dotLabels||(t.dotlabels=[]),t.hasOwnProperty("points")&&t.points||(t.points=[]);let e={showGraticules:!1,backgroundColor:"transparent",atmosphere:{enabled:!1,atmosphereColor:null,atmosphereAltitude:null},globeImage:"earth-day.jpg"};return(0===Object.keys(t).length||t.emptyPreview)&&Object.assign(t,e),t.pointOfView={lat:0,lng:0,altitude:1.5},t.centerCoordinates&&(t.pointOfView.lat=globe_ut_float(t.centerCoordinates.latitude),t.pointOfView.lng=globe_ut_float(t.centerCoordinates.longitude),t.pointOfView.altitude=globe_ut_float(t.altitude)),t},globe_ut_setupData=function(t,e){for(const o in e){let n=e[o];Array.isArray(t[o])&&t[o]&&t[o].map((function(e){(void 0===e.useCustom||void 0!==e.useCustom&&!globe_ut_bool(e.useCustom))&&Object.assign(e,t[n]),e.action&&"default"===e.action&&(e.action=t[n].action)}))}},globe_ut_prepareViewport=function(t,e){var o=t.closest(".itt_globe_aspect_ratio");window.innerWidth<=780&&void 0!==e.paddingTop&&""!==e.paddingTop?o.style.paddingTop=String(e.paddingTopMobile)+"%":o.style.paddingTop=String(e.paddingTop)+"%"},globe_ut_float=function(t){var e=parseFloat(t);return isNaN(e)?0:e},globe_ut_bool=function(t){return 0!==Number(t)&&"false"!==t&&void 0!==t},globe_ut_prepare_coordinates=function(t,e){return void 0!==e.coordinates&&e.coordinates[t]?parseFloat(e.coordinates[t]):void 0!==e[t]&&parseFloat(e[t])};function setupClickEvent(t,e,o){let n={arcLines:"arcLineDefaults",points:"pointDefaults",dotLabels:"labelDefaults",regions:"regionDefaults"};if("regions"===o.type&&(o={...o.properties}),new URLSearchParams(window.location.search).has("debug")&&console.debug(o),"default"===o.action&&(o.action=e[n[o.type]].action),"none"===o.action)return;const i=o.action;i&&"function"==typeof window.ittGlobes.clickActions[i]&&window.ittGlobes.clickActions[i](t,e,o),ittGlobeData.isAdmin||("open_url"!==o.action&&"open_url_new"!==o.action||(o.content=globe_ut_prepareURL(o.content)),"open_url"===o.action&&""!==o.content?document.location=o.content:"open_url_new"===o.action&&""!==o.content&&window.open(o.content))}function setupHoverEvent(t,e,o){let n=t.meta;return"regions"===o?t.polygonCapColor((function(t){return void 0===e||e&&void 0===e.properties?t.properties.color?t.properties.color:n.regionDefaults.inactive:t===e||t.properties.originalId&&e&&e.properties&&e.properties.id&&t.properties.originalId.includes(e.properties.id)||t.properties.originalId&&e&&e.properties&&Array.isArray(e.properties.id)&&e.properties.id.includes(t.properties.id)?t.properties.hover:t.properties.color?t.properties.color:n.regionDefaults.inactive})):(t.labelColor((function(t){return e&&t.id===e.id?t.hover:t.color})),t.pointColor((function(t){return e&&t.id===e.id?t.hover:t.color})),void 0!==n.rotate&&globe_ut_bool(n.rotate.enabled)&&(t.controls().autoRotate=!e)),t}function addPointsLayer(t,e){t.pointsData(e.points).pointLat((t=>globe_ut_prepare_coordinates("latitude",t))).pointLng((t=>globe_ut_prepare_coordinates("longitude",t))).pointRadius((t=>t.radius/10)).pointAltitude((t=>t.altitude/100)).pointColor((t=>t.color)).pointResolution(20),t.pointLabel((function(t){let o=e.tooltipTemplate??"{tooltipContent}";return e.pointsTooltipTemplate&&(o=e.pointsTooltipTemplate),setupTooltip(t,o)})),t.onPointClick((function(o){setupClickEvent(t,e,o)})),t.onPointHover((function(e){setupHoverEvent(t,e,"point")}))}function addLabelsLayer(t,e){if(t.labelsData(e.dotLabels).labelLat((t=>globe_ut_prepare_coordinates("latitude",t))).labelLng((t=>globe_ut_prepare_coordinates("longitude",t))).labelText((t=>t.title&&t.title.trim()?t.title:"_")).labelAltitude((t=>t.altitude/100)).labelSize((t=>t.size/10)).labelColor((t=>t.color)).labelResolution(20).labelIncludeDot((t=>globe_ut_bool(t.includeDot))).labelDotRadius((t=>t.radius/10)).labelDotOrientation((t=>t.dotOrientation)),e.labelFont&&"default"!==e.labelFont){let o=ittGlobeData.assetsUrl+"fonts/"+e.labelFont+".json";fetch(o).then((t=>t.json())).then((e=>{t.labelTypeFace(e)})).catch((t=>{console.error("Fetch error:",t)}))}t.labelLabel((function(t){let o=e.tooltipTemplate??"{tooltipContent}";return e.dotLabelsTooltipTemplate&&(o=e.dotLabelsTooltipTemplate),setupTooltip(t,o)})),t.onLabelClick((function(o,n,i){setupClickEvent(t,e,o)})),t.onLabelHover((function(e){setupHoverEvent(t,e,"label")}))}function setupResizeEvent(t,e,o){var n=e.closest(".itt_globe_aspect_ratio");window.addEventListener("resize",(function(){window.innerWidth<=780&&void 0!==o.paddingTop&&""!==o.paddingTop?n.style.paddingTop=String(o.paddingTopMobile)+"%":n.style.paddingTop=String(o.paddingTop)+"%",t.width()!==e.offsetWidth&&t.width(e.offsetWidth).height(e.offsetHeight)}))}function setupInteractions(t,e){void 0!==e.interactions&&(t.controls().enableZoom=globe_ut_bool(e.interactions.zoom),t.controls().enablePan=globe_ut_bool(e.interactions.pan),t.controls().enableRotate=globe_ut_bool(e.interactions.pan))}let ittGlobes={globes:[],globesIndex:{},clickActions:{},init:function(){if("undefined"==typeof Globe)return void console.error("Globe lib not loaded properly");let t=document.getElementsByClassName("js-itt-globe-render");for(const e of t){if(!e.dataset.hasOwnProperty("globe_id"))continue;let t=0;try{t=parseInt(JSON.parse(e.dataset.globe_id))}catch(t){continue}if(void 0!==ittGlobes.globesIndex[t])continue;if(!e.dataset.hasOwnProperty("globe_meta"))continue;let o={};try{o=JSON.parse(e.dataset.globe_meta)}catch(t){o={}}create_globe(t,o)}}};var create_globe=function(t,e){let o=document.getElementById("itt_globe_"+t);globe_ut_prepareData(e),globe_ut_setupData(e,{points:"pointDefaults",dotLabels:"labelDefaults"}),globe_ut_prepareViewport(o,e);let n={rendererConfig:{antialias:!0,alpha:!0},waitForGlobeReady:!0,animateIn:void 0===e.animateIn||globe_ut_bool(e.animateIn)},i=Globe(n)(document.getElementById("itt_globe_"+t));i.meta=e,"transparent"===e.backgroundColor&&(e.backgroundColor="rgba(0,0,0,0)"),null!==e.globeImage&&""!==e.globeImage&&"earth-hollow"!==e.globeImage&&"noImage"!==e.globeImage&&"customImage"!==e.globeImage&&i.globeImageUrl(ittGlobeData.imagesUrl+e.globeImage),i.backgroundColor(e.backgroundColor).width(o.offsetWidth).height(o.offsetHeight).showGraticules(globe_ut_bool(e.showGraticules)).showAtmosphere(globe_ut_bool(e.atmosphere.enabled)).atmosphereColor(e.atmosphere.atmosphereColor).atmosphereAltitude(e.atmosphere.atmosphereAltitude).pointOfView(e.pointOfView),setupInteractions(i,e),setupResizeEvent(i,o,e),ittGlobeData.isAdmin&&i.onGlobeReady((function(){const t=new Event("adminGlobeReady");document.dispatchEvent(t)})),e.points&&addPointsLayer(i,e),e.dotLabels&&addLabelsLayer(i,e),i.setupClickEvent=setupClickEvent,i.setupHoverEvent=setupHoverEvent,ittGlobes.globes.push(i),ittGlobes.globesIndex[t]=i};ittGlobes.init(),window.ittGlobes=ittGlobes;export{ittGlobes};1 import"https://unpkg.com/three/build/three.module.js";function setupTooltip(t,e){let o=t.tooltipContent??"";return void 0!==e&&"{tooltipContent}"!==e&&e.length>0&&(o=e.replace(/\{([^}]+)\}/g,(function(e,o){const i=o.split(".");let n=t;for(let t=0;t<i.length;t++)n=n?n[i[t]]:void 0;return void 0!==n?n:""}))),""!==o&&(o='<div class="itt_globe_'+t.globe_id+' itt_globe_tooltip">'+o+"</div>"),o}const globe_ut_prepareURL=function(t){if("string"!=typeof t)return t;var e;(t=t.replace(/&/gi,"&")).replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(e)}));try{e=new URL(t)}catch(t){e=!1}return e&&![null,"http:","https:","mailto:","tel:"].includes(e.protocol)?(console.log("URL protocol not allowed"),""):t},globe_ut_prepareData=function(t){t.hasOwnProperty("dotLabels")&&t.dotLabels||(t.dotlabels=[]),t.hasOwnProperty("points")&&t.points||(t.points=[]);let e={showGraticules:!1,backgroundColor:"transparent",atmosphere:{enabled:!1,atmosphereColor:null,atmosphereAltitude:null},globeImage:"earth-day.jpg"};if((0===Object.keys(t).length||t.emptyPreview)&&Object.assign(t,e),t.pointOfView={lat:0,lng:0,altitude:1.5},t.centerCoordinates){let e=void 0!==t.altitudeOptions?t.altitudeOptions.altitude:t.altitude;t.pointOfView.lat=globe_ut_float(t.centerCoordinates.latitude),t.pointOfView.lng=globe_ut_float(t.centerCoordinates.longitude),t.pointOfView.altitude=globe_ut_float(e)}return t},globe_ut_setupData=function(t,e){for(const o in e){let i=e[o];t[o]&&Array.isArray(t[o])&&t[o].map((function(e){(void 0===e.useCustom||void 0!==e.useCustom&&!globe_ut_bool(e.useCustom))&&Object.assign(e,t[i]),Array.isArray(e.action)&&(e.action=e.action[0]),t[i]&&e.action&&"default"===e.action&&(e.action=t[i].action)}))}},globe_ut_prepareViewport=function(t,e){var o=t.closest(".itt_globe_aspect_ratio");window.innerWidth<=780&&void 0!==e.paddingTop&&""!==e.paddingTop?o.style.paddingTop=String(e.paddingTopMobile)+"%":o.style.paddingTop=String(e.paddingTop)+"%"},globe_ut_float=function(t){var e=parseFloat(t);return isNaN(e)?0:e},globe_ut_bool=function(t){return 0!==Number(t)&&"false"!==t&&void 0!==t},globe_ut_prepare_coordinates=function(t,e){return void 0!==e.coordinates&&e.coordinates[t]?parseFloat(e.coordinates[t]):void 0!==e[t]&&parseFloat(e[t])};function setupClickEvent(t,e,o){let i={arcLines:"arcLineDefaults",points:"pointDefaults",dotLabels:"labelDefaults",regions:"regionDefaults",html:"htmlDefaults"};if("regions"===o.type&&(o={...o.properties}),new URLSearchParams(window.location.search).has("debug")&&console.debug(o),"default"===o.action&&(o.action=e[i[o.type]].action),"none"===o.action)return;const n=o.action;n&&"function"==typeof window.ittGlobes.clickActions[n]&&window.ittGlobes.clickActions[n](t,e,o),ittGlobeData.isAdmin||("open_url"!==o.action&&"open_url_new"!==o.action||(o.content=globe_ut_prepareURL(o.content)),"open_url"===o.action&&""!==o.content?document.location=o.content:"open_url_new"===o.action&&""!==o.content&&window.open(o.content))}function setupHoverEvent(t,e,o,i){let n=t.meta;if("regions"===i)t.polygonCapColor((function(t){return void 0===e||e&&void 0===e.properties?t.properties.color?t.properties.color:n.regionDefaults.inactive:t===e||t.properties.originalId&&e&&e.properties&&e.properties.id&&t.properties.originalId.includes(e.properties.id)||t.properties.originalId&&e&&e.properties&&Array.isArray(e.properties.id)&&e.properties.id.includes(t.properties.id)?t.properties.hover:t.properties.color?t.properties.color:n.regionDefaults.inactive}));else if("pin"===i||"marker"===i){if(e){const t=parseInt(e.hover.replace("#","0x"),16);parseInt(e.color.replace("#","0x"),16);let o=e.__threeObjObject?e.__threeObjObject:e.__threeObj;"pin"===i?o.children[0].children.forEach((e=>{e.material.color.setHex(t)})):"marker"===i&&o.children[0].material.color.setHex(t)}if(o&&o!==e){const t=parseInt(o.color.replace("#","0x"),16);let e=o.__threeObjObject?o.__threeObjObject:o.__threeObj;"pin"===i?e.children[0].children.forEach((e=>{e.material.color.setHex(t)})):"marker"===i&&"marker"===o.type&&e.children[0].material.color.setHex(t)}void 0!==n.rotate&&globe_ut_bool(n.rotate.enabled)&&(t.controls().autoRotate=!e)}else t.labelColor((function(t){return e&&t.id===e.id?t.hover:t.color})),t.pointColor((function(t){return e&&t.id===e.id?t.hover:t.color})),void 0!==n.rotate&&globe_ut_bool(n.rotate.enabled)&&(t.controls().autoRotate=!e);return t}function addPointsLayer(t,e){t.pointsData(e.points).pointLat((t=>globe_ut_prepare_coordinates("latitude",t))).pointLng((t=>globe_ut_prepare_coordinates("longitude",t))).pointRadius((t=>t.radius/10)).pointAltitude((t=>t.altitude/100)).pointColor((t=>t.color)).pointResolution(20),t.pointLabel((function(t){let o=e.tooltipTemplate??"{tooltipContent}";return e.pointsTooltipTemplate&&(o=e.pointsTooltipTemplate),setupTooltip(t,o)})),t.onPointClick((function(o){setupClickEvent(t,e,o)})),t.onPointHover((function(e){setupHoverEvent(t,e,"point")})),t.onObjectClick((function(o){setupClickEvent(t,e,o)}))}function addLabelsLayer(t,e){if(t.labelsData(e.dotLabels).labelLat((t=>globe_ut_prepare_coordinates("latitude",t))).labelLng((t=>globe_ut_prepare_coordinates("longitude",t))).labelText((t=>t.title&&t.title.trim()?t.title:"_")).labelAltitude((t=>t.altitude/100)).labelSize((t=>t.size/10)).labelColor((t=>t.color)).labelResolution(20).labelIncludeDot((t=>globe_ut_bool(t.includeDot))).labelDotRadius((t=>t.radius/10)).labelDotOrientation((t=>t.dotOrientation)),e.labelFont&&"default"!==e.labelFont){let o=ittGlobeData.assetsUrl+"fonts/"+e.labelFont+".json";fetch(o).then((t=>t.json())).then((e=>{t.labelTypeFace(e)})).catch((t=>{console.error("Fetch error:",t)}))}t.labelLabel((function(t){let o=e.tooltipTemplate??"{tooltipContent}";return e.dotLabelsTooltipTemplate&&(o=e.dotLabelsTooltipTemplate),setupTooltip(t,o)})),t.onLabelClick((function(o,i,n){setupClickEvent(t,e,o)})),t.onLabelHover((function(e){setupHoverEvent(t,e,"label")}))}function setupResizeEvent(t,e,o){var i=e.closest(".itt_globe_aspect_ratio");window.addEventListener("resize",(function(){window.innerWidth<=780&&void 0!==o.paddingTop&&""!==o.paddingTop?i.style.paddingTop=String(o.paddingTopMobile)+"%":i.style.paddingTop=String(o.paddingTop)+"%",t.width()!==e.offsetWidth&&t.width(e.offsetWidth).height(e.offsetHeight)}))}function setupInteractions(t,e){if(void 0!==e.interactions&&(t.controls().enableZoom=globe_ut_bool(e.interactions.zoom),t.controls().enablePan=globe_ut_bool(e.interactions.pan),t.controls().enableRotate=globe_ut_bool(e.interactions.pan)),void 0===e.interactions||globe_ut_bool(e.interactions.zoom)){let e=0;const o=300;t.onGlobeClick((function(i,n){const l=(new Date).getTime();if(l-e<o){let e=t.pointOfView();e.altitude=.6*e.altitude,e.lat=i.lat,e.lng=i.lng,t.pointOfView(e,800)}e=l}))}}function setupZoomEvent(t){let e=t.meta;t.onZoom((function(o){if(e.altitudeOptions){const i=parseFloat(e.altitudeOptions.minAltitude),n=parseFloat(e.altitudeOptions.maxAltitude);!isNaN(i)&&0!==i&&o.altitude<i?t.pointOfView({...o,altitude:i}):!isNaN(n)&&0!==n&&o.altitude>n&&t.pointOfView({...o,altitude:n})}}))}let ittGlobes={globes:[],globesIndex:{},clickActions:{},init:function(){if("undefined"==typeof Globe)return void console.error("Globe lib not loaded properly");let t=document.getElementsByClassName("js-itt-globe-render");for(const e of t){if(!e.dataset.hasOwnProperty("globe_id"))continue;let t=0;try{t=parseInt(JSON.parse(e.dataset.globe_id))}catch(t){continue}if(void 0!==ittGlobes.globesIndex[t])continue;if(!e.dataset.hasOwnProperty("globe_meta"))continue;let o={};try{o=JSON.parse(e.dataset.globe_meta)}catch(t){o={}}create_globe(t,o)}}};var create_globe=function(t,e){let o=document.getElementById("itt_globe_"+t);globe_ut_prepareData(e),globe_ut_setupData(e,{points:"pointDefaults",dotLabels:"labelDefaults"}),globe_ut_prepareViewport(o,e);let i={rendererConfig:{antialias:!0,alpha:!0},waitForGlobeReady:!0,animateIn:void 0===e.animateIn||globe_ut_bool(e.animateIn)},n=Globe(i)(document.getElementById("itt_globe_"+t));n.meta=e,"transparent"===e.backgroundColor&&(e.backgroundColor="rgba(0,0,0,0)"),null!==e.globeImage&&""!==e.globeImage&&"earth-hollow"!==e.globeImage&&"noImage"!==e.globeImage&&"customImage"!==e.globeImage&&n.globeImageUrl(ittGlobeData.imagesUrl+e.globeImage),n.backgroundColor(e.backgroundColor).width(o.offsetWidth).height(o.offsetHeight).showGraticules(globe_ut_bool(e.showGraticules)).showAtmosphere(globe_ut_bool(e.atmosphere.enabled)).atmosphereColor(e.atmosphere.atmosphereColor).atmosphereAltitude(e.atmosphere.atmosphereAltitude).pointOfView(e.pointOfView),setupInteractions(n,e),setupResizeEvent(n,o,e),setupZoomEvent(n),ittGlobeData.isAdmin&&n.onGlobeReady((function(){const t=new Event("adminGlobeReady");document.dispatchEvent(t)})),e.points&&addPointsLayer(n,e),e.dotLabels&&addLabelsLayer(n,e),n.setupClickEvent=setupClickEvent,n.setupHoverEvent=setupHoverEvent,ittGlobes.globes.push(n),ittGlobes.globesIndex[t]=n,e.altitudeOptions&&(n.altitudeOptions=e.altitudeOptions)};ittGlobes.init(),window.ittGlobes=ittGlobes;export{ittGlobes}; -
interactive-globes/trunk/dist/assets/js/vendor/public/globe.gl.min.js
r3207680 r3263746 1 // Version 2.3 3.1globe.gl - https://github.com/vasturiano/globe.gl2 !function( t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Globe=e()}(this,(function(){"use strict";function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function e(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function i(t){for(var i=1;i<arguments.length;i++){var r=null!=arguments[i]?arguments[i]:{};i%2?n(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function r(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||function(e,n){if(e){if("string"==typeof e)return t(e,n);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?t(e,n):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}!function(t,e){void 0===e&&(e={});var n=e.insertAt;if("undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}(".scene-container .clickable {\n cursor: pointer;\n}");const s="169",a={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},o=0,l=1,u=2,h=3,c=0,A=1,d=2,p=100,f=101,m=102,g=200,y=201,v=202,_=203,x=204,b=205,S=206,M=207,w=208,T=209,E=210,C=211,R=212,N=213,P=214,D=0,I=1,L=2,B=3,U=4,O=5,F=6,k=7,z=301,q=302,G=306,V=1e3,H=1001,j=1002,W=1003,X=1004,Y=1005,Q=1006,$=1007,Z=1008,K=1009,J=1010,tt=1011,et=1012,nt=1013,it=1014,rt=1015,st=1016,at=1017,ot=1018,lt=1020,ut=35902,ht=1023,ct=1026,At=1027,dt=1029,pt=1031,ft=1033,mt=33776,gt=33777,yt=33778,vt=33779,_t=35840,xt=35841,bt=35842,St=35843,Mt=36196,wt=37492,Tt=37496,Et=37808,Ct=37809,Rt=37810,Nt=37811,Pt=37812,Dt=37813,It=37814,Lt=37815,Bt=37816,Ut=37817,Ot=37818,Ft=37819,kt=37820,zt=37821,qt=36492,Gt=36494,Vt=36495,Ht=36284,jt=36285,Wt=36286,Xt="",Yt="srgb",Qt="srgb-linear",$t="display-p3",Zt="display-p3-linear",Kt="linear",Jt="srgb",te="rec709",ee="p3",ne=7680,ie=512,re=513,se=514,ae=515,oe=516,le=517,ue=518,he=519,ce=35044,Ae="300 es",de=2e3,pe=2001;let fe=class{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)}hasEventListener(t,e){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;const n=this._listeners[t];if(void 0!==n){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}dispatchEvent(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const n=e.slice(0);for(let e=0,i=n.length;e<i;e++)n[e].call(this,t);t.target=null}}};const me=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let ge=1234567;const ye=Math.PI/180,ve=180/Math.PI;function _e(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(me[255&t]+me[t>>8&255]+me[t>>16&255]+me[t>>24&255]+"-"+me[255&e]+me[e>>8&255]+"-"+me[e>>16&15|64]+me[e>>24&255]+"-"+me[63&n|128]+me[n>>8&255]+"-"+me[n>>16&255]+me[n>>24&255]+me[255&i]+me[i>>8&255]+me[i>>16&255]+me[i>>24&255]).toLowerCase()}function xe(t,e,n){return Math.max(e,Math.min(n,t))}function be(t,e){return(t%e+e)%e}function Se(t,e,n){return(1-n)*t+n*e}function Me(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function we(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}const Te={DEG2RAD:ye,RAD2DEG:ve,generateUUID:_e,clamp:xe,euclideanModulo:be,mapLinear:function(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)},inverseLerp:function(t,e,n){return t!==e?(n-t)/(e-t):0},lerp:Se,damp:function(t,e,n,i){return Se(t,e,1-Math.exp(-n*i))},pingpong:function(t,e=1){return e-Math.abs(be(t,2*e)-e)},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(ge=t);let e=ge+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296},degToRad:function(t){return t*ye},radToDeg:function(t){return t*ve},isPowerOfTwo:function(t){return!(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,n,i,r){const s=Math.cos,a=Math.sin,o=s(n/2),l=a(n/2),u=s((e+i)/2),h=a((e+i)/2),c=s((e-i)/2),A=a((e-i)/2),d=s((i-e)/2),p=a((i-e)/2);switch(r){case"XYX":t.set(o*h,l*c,l*A,o*u);break;case"YZY":t.set(l*A,o*h,l*c,o*u);break;case"ZXZ":t.set(l*c,l*A,o*h,o*u);break;case"XZX":t.set(o*h,l*p,l*d,o*u);break;case"YXY":t.set(l*d,o*h,l*p,o*u);break;case"ZYZ":t.set(l*p,l*d,o*h,o*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize:we,denormalize:Me};let Ee=class t{constructor(e=0,n=0){t.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(xe(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,s=this.y-t.y;return this.x=r*n-s*i+t.x,this.y=r*i+s*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Ce=class t{constructor(e,n,i,r,s,a,o,l,u){t.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,n,i,r,s,a,o,l,u)}set(t,e,n,i,r,s,a,o,l){const u=this.elements;return u[0]=t,u[1]=i,u[2]=a,u[3]=e,u[4]=r,u[5]=o,u[6]=n,u[7]=s,u[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,s=n[0],a=n[3],o=n[6],l=n[1],u=n[4],h=n[7],c=n[2],A=n[5],d=n[8],p=i[0],f=i[3],m=i[6],g=i[1],y=i[4],v=i[7],_=i[2],x=i[5],b=i[8];return r[0]=s*p+a*g+o*_,r[3]=s*f+a*y+o*x,r[6]=s*m+a*v+o*b,r[1]=l*p+u*g+h*_,r[4]=l*f+u*y+h*x,r[7]=l*m+u*v+h*b,r[2]=c*p+A*g+d*_,r[5]=c*f+A*y+d*x,r[8]=c*m+A*v+d*b,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],u=t[8];return e*s*u-e*a*l-n*r*u+n*a*o+i*r*l-i*s*o}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],u=t[8],h=u*s-a*l,c=a*o-u*r,A=l*r-s*o,d=e*h+n*c+i*A;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);const p=1/d;return t[0]=h*p,t[1]=(i*l-u*n)*p,t[2]=(a*n-i*s)*p,t[3]=c*p,t[4]=(u*e-i*o)*p,t[5]=(i*r-a*e)*p,t[6]=A*p,t[7]=(n*o-l*e)*p,t[8]=(s*e-n*r)*p,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,r,s,a){const o=Math.cos(r),l=Math.sin(r);return this.set(n*o,n*l,-n*(o*s+l*a)+s+t,-i*l,i*o,-i*(-l*s+o*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(Re.makeScale(t,e)),this}rotate(t){return this.premultiply(Re.makeRotation(-t)),this}translate(t,e){return this.premultiply(Re.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<9;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return(new this.constructor).fromArray(this.elements)}};const Re=new Ce;function Ne(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function Pe(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function De(){const t=Pe("canvas");return t.style.display="block",t}const Ie={};function Le(t){t in Ie||(Ie[t]=!0,console.warn(t))}const Be=(new Ce).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),Ue=(new Ce).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Oe={[Qt]:{transfer:Kt,primaries:te,luminanceCoefficients:[.2126,.7152,.0722],toReference:t=>t,fromReference:t=>t},[Yt]:{transfer:Jt,primaries:te,luminanceCoefficients:[.2126,.7152,.0722],toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[Zt]:{transfer:Kt,primaries:ee,luminanceCoefficients:[.2289,.6917,.0793],toReference:t=>t.applyMatrix3(Ue),fromReference:t=>t.applyMatrix3(Be)},[$t]:{transfer:Jt,primaries:ee,luminanceCoefficients:[.2289,.6917,.0793],toReference:t=>t.convertSRGBToLinear().applyMatrix3(Ue),fromReference:t=>t.applyMatrix3(Be).convertLinearToSRGB()}},Fe=new Set([Qt,Zt]),ke={enabled:!0,_workingColorSpace:Qt,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!Fe.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,n){if(!1===this.enabled||e===n||!e||!n)return t;const i=Oe[e].toReference;return(0,Oe[n].fromReference)(i(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return Oe[t].primaries},getTransfer:function(t){return t===Xt?Kt:Oe[t].transfer},getLuminanceCoefficients:function(t,e=this._workingColorSpace){return t.fromArray(Oe[e].luminanceCoefficients)}};function ze(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function qe(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}let Ge,Ve=class{static getDataURL(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===Ge&&(Ge=Pe("canvas")),Ge.width=t.width,Ge.height=t.height;const n=Ge.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=Ge}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=Pe("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const i=n.getImageData(0,0,t.width,t.height),r=i.data;for(let t=0;t<r.length;t++)r[t]=255*ze(r[t]/255);return n.putImageData(i,0,0),e}if(t.data){const e=t.data.slice(0);for(let t=0;t<e.length;t++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[t]=Math.floor(255*ze(e[t]/255)):e[t]=ze(e[t]);return{data:e,width:t.width,height:t.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}},He=0,je=class{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:He++}),this.uuid=_e(),this.data=t,this.dataReady=!0,this.version=0}set needsUpdate(t){!0===t&&this.version++}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(null!==i){let t;if(Array.isArray(i)){t=[];for(let e=0,n=i.length;e<n;e++)i[e].isDataTexture?t.push(We(i[e].image)):t.push(We(i[e]))}else t=We(i);n.url=t}return e||(t.images[this.uuid]=n),n}};function We(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?Ve.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Xe=0,Ye=class t extends fe{constructor(e=t.DEFAULT_IMAGE,n=t.DEFAULT_MAPPING,i=1001,r=1001,s=1006,a=1008,o=1023,l=1009,u=t.DEFAULT_ANISOTROPY,h=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Xe++}),this.uuid=_e(),this.name="",this.source=new je(e),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=a,this.anisotropy=u,this.format=o,this.internalFormat=null,this.type=l,this.offset=new Ee(0,0),this.repeat=new Ee(1,1),this.center=new Ee(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ce,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case V:t.x=t.x-Math.floor(t.x);break;case H:t.x=t.x<0?0:1;break;case j:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case V:t.y=t.y-Math.floor(t.y);break;case H:t.y=t.y<0?0:1;break;case j:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){!0===t&&this.pmremVersion++}};Ye.DEFAULT_IMAGE=null,Ye.DEFAULT_MAPPING=300,Ye.DEFAULT_ANISOTROPY=1;let Qe=class t{constructor(e=0,n=0,i=0,r=1){t.prototype.isVector4=!0,this.x=e,this.y=n,this.z=i,this.w=r}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=this.w,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*i+s[12]*r,this.y=s[1]*e+s[5]*n+s[9]*i+s[13]*r,this.z=s[2]*e+s[6]*n+s[10]*i+s[14]*r,this.w=s[3]*e+s[7]*n+s[11]*i+s[15]*r,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,i,r;const s=.01,a=.1,o=t.elements,l=o[0],u=o[4],h=o[8],c=o[1],A=o[5],d=o[9],p=o[2],f=o[6],m=o[10];if(Math.abs(u-c)<s&&Math.abs(h-p)<s&&Math.abs(d-f)<s){if(Math.abs(u+c)<a&&Math.abs(h+p)<a&&Math.abs(d+f)<a&&Math.abs(l+A+m-3)<a)return this.set(1,0,0,0),this;e=Math.PI;const t=(l+1)/2,o=(A+1)/2,g=(m+1)/2,y=(u+c)/4,v=(h+p)/4,_=(d+f)/4;return t>o&&t>g?t<s?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(t),i=y/n,r=v/n):o>g?o<s?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(o),n=y/i,r=_/i):g<s?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(g),n=v/r,i=_/r),this.set(n,i,r,e),this}let g=Math.sqrt((f-d)*(f-d)+(h-p)*(h-p)+(c-u)*(c-u));return Math.abs(g)<.001&&(g=1),this.x=(f-d)/g,this.y=(h-p)/g,this.z=(c-u)/g,this.w=Math.acos((l+A+m-1)/2),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},$e=class extends fe{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new Qe(0,0,t,e),this.scissorTest=!1,this.viewport=new Qe(0,0,t,e);const i={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Q,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);const r=new Ye(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);r.flipY=!1,r.generateMipmaps=n.generateMipmaps,r.internalFormat=n.internalFormat,this.textures=[];const s=n.count;for(let t=0;t<s;t++)this.textures[t]=r.clone(),this.textures[t].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}setSize(t,e,n=1){if(this.width!==t||this.height!==e||this.depth!==n){this.width=t,this.height=e,this.depth=n;for(let i=0,r=this.textures.length;i<r;i++)this.textures[i].image.width=t,this.textures[i].image.height=e,this.textures[i].image.depth=n;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return(new this.constructor).copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,n=t.textures.length;e<n;e++)this.textures[e]=t.textures[e].clone(),this.textures[e].isRenderTargetTexture=!0;const e=Object.assign({},t.texture.image);return this.texture.source=new je(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,null!==t.depthTexture&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}},Ze=class extends $e{constructor(t=1,e=1,n={}){super(t,e,n),this.isWebGLRenderTarget=!0}},Ke=class extends Ye{constructor(t=null,e=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=W,this.minFilter=W,this.wrapR=H,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}};class Je extends Ye{constructor(t=null,e=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=W,this.minFilter=W,this.wrapR=H,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}let tn=class{constructor(t=0,e=0,n=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=i}static slerpFlat(t,e,n,i,r,s,a){let o=n[i+0],l=n[i+1],u=n[i+2],h=n[i+3];const c=r[s+0],A=r[s+1],d=r[s+2],p=r[s+3];if(0===a)return t[e+0]=o,t[e+1]=l,t[e+2]=u,void(t[e+3]=h);if(1===a)return t[e+0]=c,t[e+1]=A,t[e+2]=d,void(t[e+3]=p);if(h!==p||o!==c||l!==A||u!==d){let t=1-a;const e=o*c+l*A+u*d+h*p,n=e>=0?1:-1,i=1-e*e;if(i>Number.EPSILON){const r=Math.sqrt(i),s=Math.atan2(r,e*n);t=Math.sin(t*s)/r,a=Math.sin(a*s)/r}const r=a*n;if(o=o*t+c*r,l=l*t+A*r,u=u*t+d*r,h=h*t+p*r,t===1-a){const t=1/Math.sqrt(o*o+l*l+u*u+h*h);o*=t,l*=t,u*=t,h*=t}}t[e]=o,t[e+1]=l,t[e+2]=u,t[e+3]=h}static multiplyQuaternionsFlat(t,e,n,i,r,s){const a=n[i],o=n[i+1],l=n[i+2],u=n[i+3],h=r[s],c=r[s+1],A=r[s+2],d=r[s+3];return t[e]=a*d+u*h+o*A-l*c,t[e+1]=o*d+u*c+l*h-a*A,t[e+2]=l*d+u*A+a*c-o*h,t[e+3]=u*d-a*h-o*c-l*A,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const n=t._x,i=t._y,r=t._z,s=t._order,a=Math.cos,o=Math.sin,l=a(n/2),u=a(i/2),h=a(r/2),c=o(n/2),A=o(i/2),d=o(r/2);switch(s){case"XYZ":this._x=c*u*h+l*A*d,this._y=l*A*h-c*u*d,this._z=l*u*d+c*A*h,this._w=l*u*h-c*A*d;break;case"YXZ":this._x=c*u*h+l*A*d,this._y=l*A*h-c*u*d,this._z=l*u*d-c*A*h,this._w=l*u*h+c*A*d;break;case"ZXY":this._x=c*u*h-l*A*d,this._y=l*A*h+c*u*d,this._z=l*u*d+c*A*h,this._w=l*u*h-c*A*d;break;case"ZYX":this._x=c*u*h-l*A*d,this._y=l*A*h+c*u*d,this._z=l*u*d-c*A*h,this._w=l*u*h+c*A*d;break;case"YZX":this._x=c*u*h+l*A*d,this._y=l*A*h+c*u*d,this._z=l*u*d-c*A*h,this._w=l*u*h-c*A*d;break;case"XZY":this._x=c*u*h-l*A*d,this._y=l*A*h-c*u*d,this._z=l*u*d+c*A*h,this._w=l*u*h+c*A*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!0===e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],i=e[4],r=e[8],s=e[1],a=e[5],o=e[9],l=e[2],u=e[6],h=e[10],c=n+a+h;if(c>0){const t=.5/Math.sqrt(c+1);this._w=.25/t,this._x=(u-o)*t,this._y=(r-l)*t,this._z=(s-i)*t}else if(n>a&&n>h){const t=2*Math.sqrt(1+n-a-h);this._w=(u-o)/t,this._x=.25*t,this._y=(i+s)/t,this._z=(r+l)/t}else if(a>h){const t=2*Math.sqrt(1+a-n-h);this._w=(r-l)/t,this._x=(i+s)/t,this._y=.25*t,this._z=(o+u)/t}else{const t=2*Math.sqrt(1+h-n-a);this._w=(s-i)/t,this._x=(r+l)/t,this._y=(o+u)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(xe(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(0===n)return this;const i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,i=t._y,r=t._z,s=t._w,a=e._x,o=e._y,l=e._z,u=e._w;return this._x=n*u+s*a+i*l-r*o,this._y=i*u+s*o+r*a-n*l,this._z=r*u+s*l+n*o-i*a,this._w=s*u-n*a-i*o-r*l,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const n=this._x,i=this._y,r=this._z,s=this._w;let a=s*t._w+n*t._x+i*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=s,this._x=n,this._y=i,this._z=r,this;const o=1-a*a;if(o<=Number.EPSILON){const t=1-e;return this._w=t*s+e*this._w,this._x=t*n+e*this._x,this._y=t*i+e*this._y,this._z=t*r+e*this._z,this.normalize(),this}const l=Math.sqrt(o),u=Math.atan2(l,a),h=Math.sin((1-e)*u)/l,c=Math.sin(e*u)/l;return this._w=s*h+this._w*c,this._x=n*h+this._x*c,this._y=i*h+this._y*c,this._z=r*h+this._z*c,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(t),i*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},en=class t{constructor(e=0,n=0,i=0){t.prototype.isVector3=!0,this.x=e,this.y=n,this.z=i}set(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(rn.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(rn.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=t.elements,s=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*s,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*s,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*s,this}applyQuaternion(t){const e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,a=t.z,o=t.w,l=2*(s*i-a*n),u=2*(a*e-r*i),h=2*(r*n-s*e);return this.x=e+o*l+s*h-a*u,this.y=n+o*u+a*l-r*h,this.z=i+o*h+r*u-s*l,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,i=t.y,r=t.z,s=e.x,a=e.y,o=e.z;return this.x=i*o-r*a,this.y=r*s-n*o,this.z=n*a-i*s,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return nn.copy(this).projectOnVector(t),this.sub(nn)}reflect(t){return this.sub(nn.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(xe(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=2*Math.random()-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};const nn=new en,rn=new tn;let sn=class{constructor(t=new en(1/0,1/0,1/0),e=new en(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e+=3)this.expandByPoint(on.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,n=t.count;e<n;e++)this.expandByPoint(on.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const n=on.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);const n=t.geometry;if(void 0!==n){const i=n.getAttribute("position");if(!0===e&&void 0!==i&&!0!==t.isInstancedMesh)for(let e=0,n=i.count;e<n;e++)!0===t.isMesh?t.getVertexPosition(e,on):on.fromBufferAttribute(i,e),on.applyMatrix4(t.matrixWorld),this.expandByPoint(on);else void 0!==t.boundingBox?(null===t.boundingBox&&t.computeBoundingBox(),ln.copy(t.boundingBox)):(null===n.boundingBox&&n.computeBoundingBox(),ln.copy(n.boundingBox)),ln.applyMatrix4(t.matrixWorld),this.union(ln)}const i=t.children;for(let t=0,n=i.length;t<n;t++)this.expandByObject(i[t],e);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,on),on.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(fn),mn.subVectors(this.max,fn),un.subVectors(t.a,fn),hn.subVectors(t.b,fn),cn.subVectors(t.c,fn),An.subVectors(hn,un),dn.subVectors(cn,hn),pn.subVectors(un,cn);let e=[0,-An.z,An.y,0,-dn.z,dn.y,0,-pn.z,pn.y,An.z,0,-An.x,dn.z,0,-dn.x,pn.z,0,-pn.x,-An.y,An.x,0,-dn.y,dn.x,0,-pn.y,pn.x,0];return!!vn(e,un,hn,cn,mn)&&(e=[1,0,0,0,1,0,0,0,1],!!vn(e,un,hn,cn,mn)&&(gn.crossVectors(An,dn),e=[gn.x,gn.y,gn.z],vn(e,un,hn,cn,mn)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,on).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(on).length()),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(an[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),an[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),an[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),an[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),an[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),an[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),an[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),an[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(an)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}};const an=[new en,new en,new en,new en,new en,new en,new en,new en],on=new en,ln=new sn,un=new en,hn=new en,cn=new en,An=new en,dn=new en,pn=new en,fn=new en,mn=new en,gn=new en,yn=new en;function vn(t,e,n,i,r){for(let s=0,a=t.length-3;s<=a;s+=3){yn.fromArray(t,s);const a=r.x*Math.abs(yn.x)+r.y*Math.abs(yn.y)+r.z*Math.abs(yn.z),o=e.dot(yn),l=n.dot(yn),u=i.dot(yn);if(Math.max(-Math.max(o,l,u),Math.min(o,l,u))>a)return!1}return!0}const _n=new sn,xn=new en,bn=new en;let Sn=class{constructor(t=new en,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;void 0!==e?n.copy(e):_n.setFromPoints(t).getCenter(n);let i=0;for(let e=0,r=t.length;e<r;e++)i=Math.max(i,n.distanceToSquared(t[e]));return this.radius=Math.sqrt(i),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;xn.subVectors(t,this.center);const e=xn.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),n=.5*(t-this.radius);this.center.addScaledVector(xn,n/t),this.radius+=n}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(bn.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(xn.copy(t.center).add(bn)),this.expandByPoint(xn.copy(t.center).sub(bn))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}};const Mn=new en,wn=new en,Tn=new en,En=new en,Cn=new en,Rn=new en,Nn=new en;let Pn=class{constructor(t=new en,e=new en(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Mn)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=Mn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Mn.copy(this.origin).addScaledVector(this.direction,e),Mn.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){wn.copy(t).add(e).multiplyScalar(.5),Tn.copy(e).sub(t).normalize(),En.copy(this.origin).sub(wn);const r=.5*t.distanceTo(e),s=-this.direction.dot(Tn),a=En.dot(this.direction),o=-En.dot(Tn),l=En.lengthSq(),u=Math.abs(1-s*s);let h,c,A,d;if(u>0)if(h=s*o-a,c=s*a-o,d=r*u,h>=0)if(c>=-d)if(c<=d){const t=1/u;h*=t,c*=t,A=h*(h+s*c+2*a)+c*(s*h+c+2*o)+l}else c=r,h=Math.max(0,-(s*c+a)),A=-h*h+c*(c+2*o)+l;else c=-r,h=Math.max(0,-(s*c+a)),A=-h*h+c*(c+2*o)+l;else c<=-d?(h=Math.max(0,-(-s*r+a)),c=h>0?-r:Math.min(Math.max(-r,-o),r),A=-h*h+c*(c+2*o)+l):c<=d?(h=0,c=Math.min(Math.max(-r,-o),r),A=c*(c+2*o)+l):(h=Math.max(0,-(s*r+a)),c=h>0?r:Math.min(Math.max(-r,-o),r),A=-h*h+c*(c+2*o)+l);else c=s>0?-r:r,h=Math.max(0,-(s*c+a)),A=-h*h+c*(c+2*o)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(wn).addScaledVector(Tn,c),A}intersectSphere(t,e){Mn.subVectors(t.center,this.origin);const n=Mn.dot(this.direction),i=Mn.dot(Mn)-n*n,r=t.radius*t.radius;if(i>r)return null;const s=Math.sqrt(r-i),a=n-s,o=n+s;return o<0?null:a<0?this.at(o,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return null===n?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,i,r,s,a,o;const l=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,c=this.origin;return l>=0?(n=(t.min.x-c.x)*l,i=(t.max.x-c.x)*l):(n=(t.max.x-c.x)*l,i=(t.min.x-c.x)*l),u>=0?(r=(t.min.y-c.y)*u,s=(t.max.y-c.y)*u):(r=(t.max.y-c.y)*u,s=(t.min.y-c.y)*u),n>s||r>i?null:((r>n||isNaN(n))&&(n=r),(s<i||isNaN(i))&&(i=s),h>=0?(a=(t.min.z-c.z)*h,o=(t.max.z-c.z)*h):(a=(t.max.z-c.z)*h,o=(t.min.z-c.z)*h),n>o||a>i?null:((a>n||n!=n)&&(n=a),(o<i||i!=i)&&(i=o),i<0?null:this.at(n>=0?n:i,e)))}intersectsBox(t){return null!==this.intersectBox(t,Mn)}intersectTriangle(t,e,n,i,r){Cn.subVectors(e,t),Rn.subVectors(n,t),Nn.crossVectors(Cn,Rn);let s,a=this.direction.dot(Nn);if(a>0){if(i)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}En.subVectors(this.origin,t);const o=s*this.direction.dot(Rn.crossVectors(En,Rn));if(o<0)return null;const l=s*this.direction.dot(Cn.cross(En));if(l<0)return null;if(o+l>a)return null;const u=-s*En.dot(Nn);return u<0?null:this.at(u/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}},Dn=class t{constructor(e,n,i,r,s,a,o,l,u,h,c,A,d,p,f,m){t.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,n,i,r,s,a,o,l,u,h,c,A,d,p,f,m)}set(t,e,n,i,r,s,a,o,l,u,h,c,A,d,p,f){const m=this.elements;return m[0]=t,m[4]=e,m[8]=n,m[12]=i,m[1]=r,m[5]=s,m[9]=a,m[13]=o,m[2]=l,m[6]=u,m[10]=h,m[14]=c,m[3]=A,m[7]=d,m[11]=p,m[15]=f,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new t).fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,i=1/In.setFromMatrixColumn(t,0).length(),r=1/In.setFromMatrixColumn(t,1).length(),s=1/In.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*s,e[9]=n[9]*s,e[10]=n[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,n=t.x,i=t.y,r=t.z,s=Math.cos(n),a=Math.sin(n),o=Math.cos(i),l=Math.sin(i),u=Math.cos(r),h=Math.sin(r);if("XYZ"===t.order){const t=s*u,n=s*h,i=a*u,r=a*h;e[0]=o*u,e[4]=-o*h,e[8]=l,e[1]=n+i*l,e[5]=t-r*l,e[9]=-a*o,e[2]=r-t*l,e[6]=i+n*l,e[10]=s*o}else if("YXZ"===t.order){const t=o*u,n=o*h,i=l*u,r=l*h;e[0]=t+r*a,e[4]=i*a-n,e[8]=s*l,e[1]=s*h,e[5]=s*u,e[9]=-a,e[2]=n*a-i,e[6]=r+t*a,e[10]=s*o}else if("ZXY"===t.order){const t=o*u,n=o*h,i=l*u,r=l*h;e[0]=t-r*a,e[4]=-s*h,e[8]=i+n*a,e[1]=n+i*a,e[5]=s*u,e[9]=r-t*a,e[2]=-s*l,e[6]=a,e[10]=s*o}else if("ZYX"===t.order){const t=s*u,n=s*h,i=a*u,r=a*h;e[0]=o*u,e[4]=i*l-n,e[8]=t*l+r,e[1]=o*h,e[5]=r*l+t,e[9]=n*l-i,e[2]=-l,e[6]=a*o,e[10]=s*o}else if("YZX"===t.order){const t=s*o,n=s*l,i=a*o,r=a*l;e[0]=o*u,e[4]=r-t*h,e[8]=i*h+n,e[1]=h,e[5]=s*u,e[9]=-a*u,e[2]=-l*u,e[6]=n*h+i,e[10]=t-r*h}else if("XZY"===t.order){const t=s*o,n=s*l,i=a*o,r=a*l;e[0]=o*u,e[4]=-h,e[8]=l*u,e[1]=t*h+r,e[5]=s*u,e[9]=n*h-i,e[2]=i*h-n,e[6]=a*u,e[10]=r*h+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Bn,t,Un)}lookAt(t,e,n){const i=this.elements;return kn.subVectors(t,e),0===kn.lengthSq()&&(kn.z=1),kn.normalize(),On.crossVectors(n,kn),0===On.lengthSq()&&(1===Math.abs(n.z)?kn.x+=1e-4:kn.z+=1e-4,kn.normalize(),On.crossVectors(n,kn)),On.normalize(),Fn.crossVectors(kn,On),i[0]=On.x,i[4]=Fn.x,i[8]=kn.x,i[1]=On.y,i[5]=Fn.y,i[9]=kn.y,i[2]=On.z,i[6]=Fn.z,i[10]=kn.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,s=n[0],a=n[4],o=n[8],l=n[12],u=n[1],h=n[5],c=n[9],A=n[13],d=n[2],p=n[6],f=n[10],m=n[14],g=n[3],y=n[7],v=n[11],_=n[15],x=i[0],b=i[4],S=i[8],M=i[12],w=i[1],T=i[5],E=i[9],C=i[13],R=i[2],N=i[6],P=i[10],D=i[14],I=i[3],L=i[7],B=i[11],U=i[15];return r[0]=s*x+a*w+o*R+l*I,r[4]=s*b+a*T+o*N+l*L,r[8]=s*S+a*E+o*P+l*B,r[12]=s*M+a*C+o*D+l*U,r[1]=u*x+h*w+c*R+A*I,r[5]=u*b+h*T+c*N+A*L,r[9]=u*S+h*E+c*P+A*B,r[13]=u*M+h*C+c*D+A*U,r[2]=d*x+p*w+f*R+m*I,r[6]=d*b+p*T+f*N+m*L,r[10]=d*S+p*E+f*P+m*B,r[14]=d*M+p*C+f*D+m*U,r[3]=g*x+y*w+v*R+_*I,r[7]=g*b+y*T+v*N+_*L,r[11]=g*S+y*E+v*P+_*B,r[15]=g*M+y*C+v*D+_*U,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],s=t[1],a=t[5],o=t[9],l=t[13],u=t[2],h=t[6],c=t[10],A=t[14];return t[3]*(+r*o*h-i*l*h-r*a*c+n*l*c+i*a*A-n*o*A)+t[7]*(+e*o*A-e*l*c+r*s*c-i*s*A+i*l*u-r*o*u)+t[11]*(+e*l*h-e*a*A-r*s*h+n*s*A+r*a*u-n*l*u)+t[15]*(-i*a*u-e*o*h+e*a*c+i*s*h-n*s*c+n*o*u)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],u=t[8],h=t[9],c=t[10],A=t[11],d=t[12],p=t[13],f=t[14],m=t[15],g=h*f*l-p*c*l+p*o*A-a*f*A-h*o*m+a*c*m,y=d*c*l-u*f*l-d*o*A+s*f*A+u*o*m-s*c*m,v=u*p*l-d*h*l+d*a*A-s*p*A-u*a*m+s*h*m,_=d*h*o-u*p*o-d*a*c+s*p*c+u*a*f-s*h*f,x=e*g+n*y+i*v+r*_;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const b=1/x;return t[0]=g*b,t[1]=(p*c*r-h*f*r-p*i*A+n*f*A+h*i*m-n*c*m)*b,t[2]=(a*f*r-p*o*r+p*i*l-n*f*l-a*i*m+n*o*m)*b,t[3]=(h*o*r-a*c*r-h*i*l+n*c*l+a*i*A-n*o*A)*b,t[4]=y*b,t[5]=(u*f*r-d*c*r+d*i*A-e*f*A-u*i*m+e*c*m)*b,t[6]=(d*o*r-s*f*r-d*i*l+e*f*l+s*i*m-e*o*m)*b,t[7]=(s*c*r-u*o*r+u*i*l-e*c*l-s*i*A+e*o*A)*b,t[8]=v*b,t[9]=(d*h*r-u*p*r-d*n*A+e*p*A+u*n*m-e*h*m)*b,t[10]=(s*p*r-d*a*r+d*n*l-e*p*l-s*n*m+e*a*m)*b,t[11]=(u*a*r-s*h*r-u*n*l+e*h*l+s*n*A-e*a*A)*b,t[12]=_*b,t[13]=(u*p*i-d*h*i+d*n*c-e*p*c-u*n*f+e*h*f)*b,t[14]=(d*a*i-s*p*i-d*n*o+e*p*o+s*n*f-e*a*f)*b,t[15]=(s*h*i-u*a*i+u*n*o-e*h*o-s*n*c+e*a*c)*b,this}scale(t){const e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),i=Math.sin(e),r=1-n,s=t.x,a=t.y,o=t.z,l=r*s,u=r*a;return this.set(l*s+n,l*a-i*o,l*o+i*a,0,l*a+i*o,u*a+n,u*o-i*s,0,l*o-i*a,u*o+i*s,r*o*o+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,r,s){return this.set(1,n,r,0,t,1,s,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){const i=this.elements,r=e._x,s=e._y,a=e._z,o=e._w,l=r+r,u=s+s,h=a+a,c=r*l,A=r*u,d=r*h,p=s*u,f=s*h,m=a*h,g=o*l,y=o*u,v=o*h,_=n.x,x=n.y,b=n.z;return i[0]=(1-(p+m))*_,i[1]=(A+v)*_,i[2]=(d-y)*_,i[3]=0,i[4]=(A-v)*x,i[5]=(1-(c+m))*x,i[6]=(f+g)*x,i[7]=0,i[8]=(d+y)*b,i[9]=(f-g)*b,i[10]=(1-(c+p))*b,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){const i=this.elements;let r=In.set(i[0],i[1],i[2]).length();const s=In.set(i[4],i[5],i[6]).length(),a=In.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],Ln.copy(this);const o=1/r,l=1/s,u=1/a;return Ln.elements[0]*=o,Ln.elements[1]*=o,Ln.elements[2]*=o,Ln.elements[4]*=l,Ln.elements[5]*=l,Ln.elements[6]*=l,Ln.elements[8]*=u,Ln.elements[9]*=u,Ln.elements[10]*=u,e.setFromRotationMatrix(Ln),n.x=r,n.y=s,n.z=a,this}makePerspective(t,e,n,i,r,s,a=2e3){const o=this.elements,l=2*r/(e-t),u=2*r/(n-i),h=(e+t)/(e-t),c=(n+i)/(n-i);let A,d;if(a===de)A=-(s+r)/(s-r),d=-2*s*r/(s-r);else{if(a!==pe)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);A=-s/(s-r),d=-s*r/(s-r)}return o[0]=l,o[4]=0,o[8]=h,o[12]=0,o[1]=0,o[5]=u,o[9]=c,o[13]=0,o[2]=0,o[6]=0,o[10]=A,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(t,e,n,i,r,s,a=2e3){const o=this.elements,l=1/(e-t),u=1/(n-i),h=1/(s-r),c=(e+t)*l,A=(n+i)*u;let d,p;if(a===de)d=(s+r)*h,p=-2*h;else{if(a!==pe)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);d=r*h,p=-1*h}return o[0]=2*l,o[4]=0,o[8]=0,o[12]=-c,o[1]=0,o[5]=2*u,o[9]=0,o[13]=-A,o[2]=0,o[6]=0,o[10]=p,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<16;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}};const In=new en,Ln=new Dn,Bn=new en(0,0,0),Un=new en(1,1,1),On=new en,Fn=new en,kn=new en,zn=new Dn,qn=new tn;let Gn=class t{constructor(e=0,n=0,i=0,r=t.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=i,this._order=r}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,i=this._order){return this._x=t,this._y=e,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const i=t.elements,r=i[0],s=i[4],a=i[8],o=i[1],l=i[5],u=i[9],h=i[2],c=i[6],A=i[10];switch(e){case"XYZ":this._y=Math.asin(xe(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,A),this._z=Math.atan2(-s,r)):(this._x=Math.atan2(c,l),this._z=0);break;case"YXZ":this._x=Math.asin(-xe(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,A),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-h,r),this._z=0);break;case"ZXY":this._x=Math.asin(xe(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(-h,A),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-xe(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(c,A),this._z=Math.atan2(o,r)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(xe(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-h,r)):(this._x=0,this._y=Math.atan2(a,A));break;case"XZY":this._z=Math.asin(-xe(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(c,l),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-u,A),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===n&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return zn.makeRotationFromQuaternion(t),this.setFromRotationMatrix(zn,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return qn.setFromEuler(this),this.setFromQuaternion(qn,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};Gn.DEFAULT_ORDER="XYZ";let Vn=class{constructor(){this.mask=1}set(t){this.mask=1<<t>>>0}enable(t){this.mask|=1<<t}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t}disable(t){this.mask&=~(1<<t)}disableAll(){this.mask=0}test(t){return!!(this.mask&t.mask)}isEnabled(t){return!!(this.mask&1<<t)}},Hn=0;const jn=new en,Wn=new tn,Xn=new Dn,Yn=new en,Qn=new en,$n=new en,Zn=new tn,Kn=new en(1,0,0),Jn=new en(0,1,0),ti=new en(0,0,1),ei={type:"added"},ni={type:"removed"},ii={type:"childadded",child:null},ri={type:"childremoved",child:null};let si=class t extends fe{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Hn++}),this.uuid=_e(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=t.DEFAULT_UP.clone();const e=new en,n=new Gn,i=new tn,r=new en(1,1,1);n._onChange((function(){i.setFromEuler(n,!1)})),i._onChange((function(){n.setFromQuaternion(i,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Dn},normalMatrix:{value:new Ce}}),this.matrix=new Dn,this.matrixWorld=new Dn,this.matrixAutoUpdate=t.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=t.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Vn,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return Wn.setFromAxisAngle(t,e),this.quaternion.multiply(Wn),this}rotateOnWorldAxis(t,e){return Wn.setFromAxisAngle(t,e),this.quaternion.premultiply(Wn),this}rotateX(t){return this.rotateOnAxis(Kn,t)}rotateY(t){return this.rotateOnAxis(Jn,t)}rotateZ(t){return this.rotateOnAxis(ti,t)}translateOnAxis(t,e){return jn.copy(t).applyQuaternion(this.quaternion),this.position.add(jn.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(Kn,t)}translateY(t){return this.translateOnAxis(Jn,t)}translateZ(t){return this.translateOnAxis(ti,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Xn.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?Yn.copy(t):Yn.set(t,e,n);const i=this.parent;this.updateWorldMatrix(!0,!1),Qn.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Xn.lookAt(Qn,Yn,this.up):Xn.lookAt(Yn,Qn,this.up),this.quaternion.setFromRotationMatrix(Xn),i&&(Xn.extractRotation(i.matrixWorld),Wn.setFromRotationMatrix(Xn),this.quaternion.premultiply(Wn.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(ei),ii.child=t,this.dispatchEvent(ii),ii.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}const e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(ni),ri.child=t,this.dispatchEvent(ri),ri.child=null),this}removeFromParent(){const t=this.parent;return null!==t&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),Xn.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),Xn.multiply(t.parent.matrixWorld)),t.applyMatrix4(Xn),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(ei),ii.child=t,this.dispatchEvent(ii),ii.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,i=this.children.length;n<i;n++){const i=this.children[n].getObjectByProperty(t,e);if(void 0!==i)return i}}getObjectsByProperty(t,e,n=[]){this[t]===e&&n.push(this);const i=this.children;for(let r=0,s=i.length;r<s;r++)i[r].getObjectsByProperty(t,e,n);return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Qn,t,$n),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Qn,Zn,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);const e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}traverseAncestors(t){const e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let n=0,i=e.length;n<i;n++){e[n].updateMatrixWorld(t)}}updateWorldMatrix(t,e){const n=this.parent;if(!0===t&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),!0===e){const t=this.children;for(let e=0,n=t.length;e<n;e++){t[e].updateWorldMatrix(!1,!0)}}}toJSON(t){const e=void 0===t||"string"==typeof t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const i={};function r(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map((t=>({boxInitialized:t.boxInitialized,boxMin:t.box.min.toArray(),boxMax:t.box.max.toArray(),sphereInitialized:t.sphereInitialized,sphereRadius:t.sphere.radius,sphereCenter:t.sphere.center.toArray()}))),i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(t),null!==this._colorsTexture&&(i.colorsTexture=this._colorsTexture.toJSON(t)),null!==this.boundingSphere&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),null!==this.boundingBox&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const n=e.shapes;if(Array.isArray(n))for(let e=0,i=n.length;e<i;e++){const i=n[e];r(t.shapes,i)}else r(t.shapes,n)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(t.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const e=[];for(let n=0,i=this.material.length;n<i;n++)e.push(r(t.materials,this.material[n]));i.material=e}else i.material=r(t.materials,this.material);if(this.children.length>0){i.children=[];for(let e=0;e<this.children.length;e++)i.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){i.animations=[];for(let e=0;e<this.animations.length;e++){const n=this.animations[e];i.animations.push(r(t.animations,n))}}if(e){const e=s(t.geometries),i=s(t.materials),r=s(t.textures),a=s(t.images),o=s(t.shapes),l=s(t.skeletons),u=s(t.animations),h=s(t.nodes);e.length>0&&(n.geometries=e),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),a.length>0&&(n.images=a),o.length>0&&(n.shapes=o),l.length>0&&(n.skeletons=l),u.length>0&&(n.animations=u),h.length>0&&(n.nodes=h)}return n.object=i,n;function s(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){const n=t.children[e];this.add(n.clone())}return this}};si.DEFAULT_UP=new en(0,1,0),si.DEFAULT_MATRIX_AUTO_UPDATE=!0,si.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const ai=new en,oi=new en,li=new en,ui=new en,hi=new en,ci=new en,Ai=new en,di=new en,pi=new en,fi=new en,mi=new Qe,gi=new Qe,yi=new Qe;let vi=class t{constructor(t=new en,e=new en,n=new en){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,i){i.subVectors(n,e),ai.subVectors(t,e),i.cross(ai);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(t,e,n,i,r){ai.subVectors(i,e),oi.subVectors(n,e),li.subVectors(t,e);const s=ai.dot(ai),a=ai.dot(oi),o=ai.dot(li),l=oi.dot(oi),u=oi.dot(li),h=s*l-a*a;if(0===h)return r.set(0,0,0),null;const c=1/h,A=(l*o-a*u)*c,d=(s*u-a*o)*c;return r.set(1-A-d,d,A)}static containsPoint(t,e,n,i){return null!==this.getBarycoord(t,e,n,i,ui)&&(ui.x>=0&&ui.y>=0&&ui.x+ui.y<=1)}static getInterpolation(t,e,n,i,r,s,a,o){return null===this.getBarycoord(t,e,n,i,ui)?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(r,ui.x),o.addScaledVector(s,ui.y),o.addScaledVector(a,ui.z),o)}static getInterpolatedAttribute(t,e,n,i,r,s){return mi.setScalar(0),gi.setScalar(0),yi.setScalar(0),mi.fromBufferAttribute(t,e),gi.fromBufferAttribute(t,n),yi.fromBufferAttribute(t,i),s.setScalar(0),s.addScaledVector(mi,r.x),s.addScaledVector(gi,r.y),s.addScaledVector(yi,r.z),s}static isFrontFacing(t,e,n,i){return ai.subVectors(n,e),oi.subVectors(t,e),ai.cross(oi).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,n,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,i),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return ai.subVectors(this.c,this.b),oi.subVectors(this.a,this.b),.5*ai.cross(oi).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return t.getNormal(this.a,this.b,this.c,e)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return t.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,i,r,s){return t.getInterpolation(e,this.a,this.b,this.c,n,i,r,s)}containsPoint(e){return t.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return t.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,i=this.b,r=this.c;let s,a;hi.subVectors(i,n),ci.subVectors(r,n),di.subVectors(t,n);const o=hi.dot(di),l=ci.dot(di);if(o<=0&&l<=0)return e.copy(n);pi.subVectors(t,i);const u=hi.dot(pi),h=ci.dot(pi);if(u>=0&&h<=u)return e.copy(i);const c=o*h-u*l;if(c<=0&&o>=0&&u<=0)return s=o/(o-u),e.copy(n).addScaledVector(hi,s);fi.subVectors(t,r);const A=hi.dot(fi),d=ci.dot(fi);if(d>=0&&A<=d)return e.copy(r);const p=A*l-o*d;if(p<=0&&l>=0&&d<=0)return a=l/(l-d),e.copy(n).addScaledVector(ci,a);const f=u*d-A*h;if(f<=0&&h-u>=0&&A-d>=0)return Ai.subVectors(r,i),a=(h-u)/(h-u+(A-d)),e.copy(i).addScaledVector(Ai,a);const m=1/(f+p+c);return s=p*m,a=c*m,e.copy(n).addScaledVector(hi,s).addScaledVector(ci,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}};const _i={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},xi={h:0,s:0,l:0},bi={h:0,s:0,l:0};function Si(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}let Mi=class{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(void 0===e&&void 0===n){const e=t;e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Yt){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,ke.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=ke.workingColorSpace){return this.r=t,this.g=e,this.b=n,ke.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=ke.workingColorSpace){if(t=be(t,1),e=xe(e,0,1),n=xe(n,0,1),0===e)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+e):n+e-n*e,r=2*n-i;this.r=Si(r,i,t+1/3),this.g=Si(r,i,t),this.b=Si(r,i,t-1/3)}return ke.toWorkingColorSpace(this,i),this}setStyle(t,e=Yt){function n(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const s=i[1],a=i[2];switch(s){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const n=i[1],r=n.length;if(3===r)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,e);if(6===r)return this.setHex(parseInt(n,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Yt){const n=_i[t.toLowerCase()];return void 0!==n?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=ze(t.r),this.g=ze(t.g),this.b=ze(t.b),this}copyLinearToSRGB(t){return this.r=qe(t.r),this.g=qe(t.g),this.b=qe(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Yt){return ke.fromWorkingColorSpace(wi.copy(this),t),65536*Math.round(xe(255*wi.r,0,255))+256*Math.round(xe(255*wi.g,0,255))+Math.round(xe(255*wi.b,0,255))}getHexString(t=Yt){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=ke.workingColorSpace){ke.fromWorkingColorSpace(wi.copy(this),e);const n=wi.r,i=wi.g,r=wi.b,s=Math.max(n,i,r),a=Math.min(n,i,r);let o,l;const u=(a+s)/2;if(a===s)o=0,l=0;else{const t=s-a;switch(l=u<=.5?t/(s+a):t/(2-s-a),s){case n:o=(i-r)/t+(i<r?6:0);break;case i:o=(r-n)/t+2;break;case r:o=(n-i)/t+4}o/=6}return t.h=o,t.s=l,t.l=u,t}getRGB(t,e=ke.workingColorSpace){return ke.fromWorkingColorSpace(wi.copy(this),e),t.r=wi.r,t.g=wi.g,t.b=wi.b,t}getStyle(t=Yt){ke.fromWorkingColorSpace(wi.copy(this),t);const e=wi.r,n=wi.g,i=wi.b;return t!==Yt?`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(255*e)},${Math.round(255*n)},${Math.round(255*i)})`}offsetHSL(t,e,n){return this.getHSL(xi),this.setHSL(xi.h+t,xi.s+e,xi.l+n)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(xi),t.getHSL(bi);const n=Se(xi.h,bi.h,e),i=Se(xi.s,bi.s,e),r=Se(xi.l,bi.l,e);return this.setHSL(n,i,r),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,n=this.g,i=this.b,r=t.elements;return this.r=r[0]*e+r[3]*n+r[6]*i,this.g=r[1]*e+r[4]*n+r[7]*i,this.b=r[2]*e+r[5]*n+r[8]*i,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};const wi=new Mi;Mi.NAMES=_i;let Ti=0,Ei=class extends fe{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Ti++}),this.uuid=_e(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=p,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Mi(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ne,this.stencilZFail=ne,this.stencilZPass=ne,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const n=t[e];if(void 0===n){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const i=this[e];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n:console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`)}}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function i(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.dispersion&&(n.dispersion=this.dispersion),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),0!==this.side&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),204!==this.blendSrc&&(n.blendSrc=this.blendSrc),205!==this.blendDst&&(n.blendDst=this.blendDst),this.blendEquation!==p&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ne&&(n.stencilFail=this.stencilFail),this.stencilZFail!==ne&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==ne&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),e){const e=i(t.textures),r=i(t.images);e.length>0&&(n.textures=e),r.length>0&&(n.images=r)}return n}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(null!==e){const t=e.length;n=new Array(t);for(let i=0;i!==t;++i)n[i]=e[i].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}},Ci=class extends Ei{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Mi(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Gn,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}};const Ri=new en,Ni=new Ee;let Pi=class{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=n,this.usage=ce,this.updateRanges=[],this.gpuType=rt,this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[n+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,n=this.count;e<n;e++)Ni.fromBufferAttribute(this,e),Ni.applyMatrix3(t),this.setXY(e,Ni.x,Ni.y);else if(3===this.itemSize)for(let e=0,n=this.count;e<n;e++)Ri.fromBufferAttribute(this,e),Ri.applyMatrix3(t),this.setXYZ(e,Ri.x,Ri.y,Ri.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)Ri.fromBufferAttribute(this,e),Ri.applyMatrix4(t),this.setXYZ(e,Ri.x,Ri.y,Ri.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Ri.fromBufferAttribute(this,e),Ri.applyNormalMatrix(t),this.setXYZ(e,Ri.x,Ri.y,Ri.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Ri.fromBufferAttribute(this,e),Ri.transformDirection(t),this.setXYZ(e,Ri.x,Ri.y,Ri.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let n=this.array[t*this.itemSize+e];return this.normalized&&(n=Me(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=we(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Me(e,this.array)),e}setX(t,e){return this.normalized&&(e=we(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Me(e,this.array)),e}setY(t,e){return this.normalized&&(e=we(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Me(e,this.array)),e}setZ(t,e){return this.normalized&&(e=we(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Me(e,this.array)),e}setW(t,e){return this.normalized&&(e=we(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=we(e,this.array),n=we(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=we(e,this.array),n=we(n,this.array),i=we(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this}setXYZW(t,e,n,i,r){return t*=this.itemSize,this.normalized&&(e=we(e,this.array),n=we(n,this.array),i=we(i,this.array),r=we(r,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=r,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),this.usage!==ce&&(t.usage=this.usage),t}},Di=class extends Pi{constructor(t,e,n){super(new Uint16Array(t),e,n)}},Ii=class extends Pi{constructor(t,e,n){super(new Uint32Array(t),e,n)}},Li=class extends Pi{constructor(t,e,n){super(new Float32Array(t),e,n)}},Bi=0;const Ui=new Dn,Oi=new si,Fi=new en,ki=new sn,zi=new sn,qi=new en;let Gi=class t extends fe{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Bi++}),this.uuid=_e(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(Ne(t)?Ii:Di)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return void 0!==this.attributes[t]}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const e=(new Ce).getNormalMatrix(t);n.applyNormalMatrix(e),n.needsUpdate=!0}const i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(t),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(t){return Ui.makeRotationFromQuaternion(t),this.applyMatrix4(Ui),this}rotateX(t){return Ui.makeRotationX(t),this.applyMatrix4(Ui),this}rotateY(t){return Ui.makeRotationY(t),this.applyMatrix4(Ui),this}rotateZ(t){return Ui.makeRotationZ(t),this.applyMatrix4(Ui),this}translate(t,e,n){return Ui.makeTranslation(t,e,n),this.applyMatrix4(Ui),this}scale(t,e,n){return Ui.makeScale(t,e,n),this.applyMatrix4(Ui),this}lookAt(t){return Oi.lookAt(t),Oi.updateMatrix(),this.applyMatrix4(Oi.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Fi).negate(),this.translate(Fi.x,Fi.y,Fi.z),this}setFromPoints(t){const e=[];for(let n=0,i=t.length;n<i;n++){const i=t[n];e.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new Li(e,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new sn);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new en(-1/0,-1/0,-1/0),new en(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];ki.setFromBufferAttribute(n),this.morphTargetsRelative?(qi.addVectors(this.boundingBox.min,ki.min),this.boundingBox.expandByPoint(qi),qi.addVectors(this.boundingBox.max,ki.max),this.boundingBox.expandByPoint(qi)):(this.boundingBox.expandByPoint(ki.min),this.boundingBox.expandByPoint(ki.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Sn);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new en,1/0);if(t){const n=this.boundingSphere.center;if(ki.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];zi.setFromBufferAttribute(n),this.morphTargetsRelative?(qi.addVectors(ki.min,zi.min),ki.expandByPoint(qi),qi.addVectors(ki.max,zi.max),ki.expandByPoint(qi)):(ki.expandByPoint(zi.min),ki.expandByPoint(zi.max))}ki.getCenter(n);let i=0;for(let e=0,r=t.count;e<r;e++)qi.fromBufferAttribute(t,e),i=Math.max(i,n.distanceToSquared(qi));if(e)for(let r=0,s=e.length;r<s;r++){const s=e[r],a=this.morphTargetsRelative;for(let e=0,r=s.count;e<r;e++)qi.fromBufferAttribute(s,e),a&&(Fi.fromBufferAttribute(t,e),qi.add(Fi)),i=Math.max(i,n.distanceToSquared(qi))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=e.position,i=e.normal,r=e.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new Pi(new Float32Array(4*n.count),4));const s=this.getAttribute("tangent"),a=[],o=[];for(let t=0;t<n.count;t++)a[t]=new en,o[t]=new en;const l=new en,u=new en,h=new en,c=new Ee,A=new Ee,d=new Ee,p=new en,f=new en;function m(t,e,i){l.fromBufferAttribute(n,t),u.fromBufferAttribute(n,e),h.fromBufferAttribute(n,i),c.fromBufferAttribute(r,t),A.fromBufferAttribute(r,e),d.fromBufferAttribute(r,i),u.sub(l),h.sub(l),A.sub(c),d.sub(c);const s=1/(A.x*d.y-d.x*A.y);isFinite(s)&&(p.copy(u).multiplyScalar(d.y).addScaledVector(h,-A.y).multiplyScalar(s),f.copy(h).multiplyScalar(A.x).addScaledVector(u,-d.x).multiplyScalar(s),a[t].add(p),a[e].add(p),a[i].add(p),o[t].add(f),o[e].add(f),o[i].add(f))}let g=this.groups;0===g.length&&(g=[{start:0,count:t.count}]);for(let e=0,n=g.length;e<n;++e){const n=g[e],i=n.start;for(let e=i,r=i+n.count;e<r;e+=3)m(t.getX(e+0),t.getX(e+1),t.getX(e+2))}const y=new en,v=new en,_=new en,x=new en;function b(t){_.fromBufferAttribute(i,t),x.copy(_);const e=a[t];y.copy(e),y.sub(_.multiplyScalar(_.dot(e))).normalize(),v.crossVectors(x,e);const n=v.dot(o[t])<0?-1:1;s.setXYZW(t,y.x,y.y,y.z,n)}for(let e=0,n=g.length;e<n;++e){const n=g[e],i=n.start;for(let e=i,r=i+n.count;e<r;e+=3)b(t.getX(e+0)),b(t.getX(e+1)),b(t.getX(e+2))}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let n=this.getAttribute("normal");if(void 0===n)n=new Pi(new Float32Array(3*e.count),3),this.setAttribute("normal",n);else for(let t=0,e=n.count;t<e;t++)n.setXYZ(t,0,0,0);const i=new en,r=new en,s=new en,a=new en,o=new en,l=new en,u=new en,h=new en;if(t)for(let c=0,A=t.count;c<A;c+=3){const A=t.getX(c+0),d=t.getX(c+1),p=t.getX(c+2);i.fromBufferAttribute(e,A),r.fromBufferAttribute(e,d),s.fromBufferAttribute(e,p),u.subVectors(s,r),h.subVectors(i,r),u.cross(h),a.fromBufferAttribute(n,A),o.fromBufferAttribute(n,d),l.fromBufferAttribute(n,p),a.add(u),o.add(u),l.add(u),n.setXYZ(A,a.x,a.y,a.z),n.setXYZ(d,o.x,o.y,o.z),n.setXYZ(p,l.x,l.y,l.z)}else for(let t=0,a=e.count;t<a;t+=3)i.fromBufferAttribute(e,t+0),r.fromBufferAttribute(e,t+1),s.fromBufferAttribute(e,t+2),u.subVectors(s,r),h.subVectors(i,r),u.cross(h),n.setXYZ(t+0,u.x,u.y,u.z),n.setXYZ(t+1,u.x,u.y,u.z),n.setXYZ(t+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)qi.fromBufferAttribute(t,e),qi.normalize(),t.setXYZ(e,qi.x,qi.y,qi.z)}toNonIndexed(){function e(t,e){const n=t.array,i=t.itemSize,r=t.normalized,s=new n.constructor(e.length*i);let a=0,o=0;for(let r=0,l=e.length;r<l;r++){a=t.isInterleavedBufferAttribute?e[r]*t.data.stride+t.offset:e[r]*i;for(let t=0;t<i;t++)s[o++]=n[a++]}return new Pi(s,i,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const n=new t,i=this.index.array,r=this.attributes;for(const t in r){const s=e(r[t],i);n.setAttribute(t,s)}const s=this.morphAttributes;for(const t in s){const r=[],a=s[t];for(let t=0,n=a.length;t<n;t++){const n=e(a[t],i);r.push(n)}n.morphAttributes[t]=r}n.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let t=0,e=a.length;t<e;t++){const e=a[t];n.addGroup(e.start,e.count,e.materialIndex)}return n}toJSON(){const t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const e in n){const i=n[e];t.data.attributes[e]=i.toJSON(t.data)}const i={};let r=!1;for(const e in this.morphAttributes){const n=this.morphAttributes[e],s=[];for(let e=0,i=n.length;e<i;e++){const i=n[e];s.push(i.toJSON(t.data))}s.length>0&&(i[e]=s,r=!0)}r&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return null!==a&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;null!==n&&this.setIndex(n.clone(e));const i=t.attributes;for(const t in i){const n=i[t];this.setAttribute(t,n.clone(e))}const r=t.morphAttributes;for(const t in r){const n=[],i=r[t];for(let t=0,r=i.length;t<r;t++)n.push(i[t].clone(e));this.morphAttributes[t]=n}this.morphTargetsRelative=t.morphTargetsRelative;const s=t.groups;for(let t=0,e=s.length;t<e;t++){const e=s[t];this.addGroup(e.start,e.count,e.materialIndex)}const a=t.boundingBox;null!==a&&(this.boundingBox=a.clone());const o=t.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}};const Vi=new Dn,Hi=new Pn,ji=new Sn,Wi=new en,Xi=new en,Yi=new en,Qi=new en,$i=new en,Zi=new en,Ki=new en,Ji=new en;let tr=class extends si{constructor(t=new Gi,e=new Ci){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t<e;t++){const e=n[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}getVertexPosition(t,e){const n=this.geometry,i=n.attributes.position,r=n.morphAttributes.position,s=n.morphTargetsRelative;e.fromBufferAttribute(i,t);const a=this.morphTargetInfluences;if(r&&a){Zi.set(0,0,0);for(let n=0,i=r.length;n<i;n++){const i=a[n],o=r[n];0!==i&&($i.fromBufferAttribute(o,t),s?Zi.addScaledVector($i,i):Zi.addScaledVector($i.sub(e),i))}e.add(Zi)}return e}raycast(t,e){const n=this.geometry,i=this.material,r=this.matrixWorld;if(void 0!==i){if(null===n.boundingSphere&&n.computeBoundingSphere(),ji.copy(n.boundingSphere),ji.applyMatrix4(r),Hi.copy(t.ray).recast(t.near),!1===ji.containsPoint(Hi.origin)){if(null===Hi.intersectSphere(ji,Wi))return;if(Hi.origin.distanceToSquared(Wi)>(t.far-t.near)**2)return}Vi.copy(r).invert(),Hi.copy(t.ray).applyMatrix4(Vi),null!==n.boundingBox&&!1===Hi.intersectsBox(n.boundingBox)||this._computeIntersections(t,e,Hi)}}_computeIntersections(t,e,n){let i;const r=this.geometry,s=this.material,a=r.index,o=r.attributes.position,l=r.attributes.uv,u=r.attributes.uv1,h=r.attributes.normal,c=r.groups,A=r.drawRange;if(null!==a)if(Array.isArray(s))for(let r=0,o=c.length;r<o;r++){const o=c[r],d=s[o.materialIndex];for(let r=Math.max(o.start,A.start),s=Math.min(a.count,Math.min(o.start+o.count,A.start+A.count));r<s;r+=3){i=er(this,d,t,n,l,u,h,a.getX(r),a.getX(r+1),a.getX(r+2)),i&&(i.faceIndex=Math.floor(r/3),i.face.materialIndex=o.materialIndex,e.push(i))}}else{for(let r=Math.max(0,A.start),o=Math.min(a.count,A.start+A.count);r<o;r+=3){i=er(this,s,t,n,l,u,h,a.getX(r),a.getX(r+1),a.getX(r+2)),i&&(i.faceIndex=Math.floor(r/3),e.push(i))}}else if(void 0!==o)if(Array.isArray(s))for(let r=0,a=c.length;r<a;r++){const a=c[r],d=s[a.materialIndex];for(let r=Math.max(a.start,A.start),s=Math.min(o.count,Math.min(a.start+a.count,A.start+A.count));r<s;r+=3){i=er(this,d,t,n,l,u,h,r,r+1,r+2),i&&(i.faceIndex=Math.floor(r/3),i.face.materialIndex=a.materialIndex,e.push(i))}}else{for(let r=Math.max(0,A.start),a=Math.min(o.count,A.start+A.count);r<a;r+=3){i=er(this,s,t,n,l,u,h,r,r+1,r+2),i&&(i.faceIndex=Math.floor(r/3),e.push(i))}}}};function er(t,e,n,i,r,s,a,o,l,u){t.getVertexPosition(o,Xi),t.getVertexPosition(l,Yi),t.getVertexPosition(u,Qi);const h=function(t,e,n,i,r,s,a,o){let l;if(l=1===e.side?i.intersectTriangle(a,s,r,!0,o):i.intersectTriangle(r,s,a,0===e.side,o),null===l)return null;Ji.copy(o),Ji.applyMatrix4(t.matrixWorld);const u=n.ray.origin.distanceTo(Ji);return u<n.near||u>n.far?null:{distance:u,point:Ji.clone(),object:t}}(t,e,n,i,Xi,Yi,Qi,Ki);if(h){const t=new en;vi.getBarycoord(Ki,Xi,Yi,Qi,t),r&&(h.uv=vi.getInterpolatedAttribute(r,o,l,u,t,new Ee)),s&&(h.uv1=vi.getInterpolatedAttribute(s,o,l,u,t,new Ee)),a&&(h.normal=vi.getInterpolatedAttribute(a,o,l,u,t,new en),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const e={a:o,b:l,c:u,normal:new en,materialIndex:0};vi.getNormal(Xi,Yi,Qi,e.normal),h.face=e,h.barycoord=t}return h}let nr=class t extends Gi{constructor(t=1,e=1,n=1,i=1,r=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:s};const a=this;i=Math.floor(i),r=Math.floor(r),s=Math.floor(s);const o=[],l=[],u=[],h=[];let c=0,A=0;function d(t,e,n,i,r,s,d,p,f,m,g){const y=s/f,v=d/m,_=s/2,x=d/2,b=p/2,S=f+1,M=m+1;let w=0,T=0;const E=new en;for(let s=0;s<M;s++){const a=s*v-x;for(let o=0;o<S;o++){const c=o*y-_;E[t]=c*i,E[e]=a*r,E[n]=b,l.push(E.x,E.y,E.z),E[t]=0,E[e]=0,E[n]=p>0?1:-1,u.push(E.x,E.y,E.z),h.push(o/f),h.push(1-s/m),w+=1}}for(let t=0;t<m;t++)for(let e=0;e<f;e++){const n=c+e+S*t,i=c+e+S*(t+1),r=c+(e+1)+S*(t+1),s=c+(e+1)+S*t;o.push(n,i,s),o.push(i,r,s),T+=6}a.addGroup(A,T,g),A+=T,c+=w}d("z","y","x",-1,-1,n,e,t,s,r,0),d("z","y","x",1,-1,n,e,-t,s,r,1),d("x","z","y",1,1,t,n,e,i,s,2),d("x","z","y",1,-1,t,n,-e,i,s,3),d("x","y","z",1,-1,t,e,n,i,r,4),d("x","y","z",-1,-1,t,e,-n,i,r,5),this.setIndex(o),this.setAttribute("position",new Li(l,3)),this.setAttribute("normal",new Li(u,3)),this.setAttribute("uv",new Li(h,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(e){return new t(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}};function ir(t){const e={};for(const n in t){e[n]={};for(const i in t[n]){const r=t[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[n][i]=null):e[n][i]=r.clone():Array.isArray(r)?e[n][i]=r.slice():e[n][i]=r}}return e}function rr(t){const e={};for(let n=0;n<t.length;n++){const i=ir(t[n]);for(const t in i)e[t]=i[t]}return e}function sr(t){const e=t.getRenderTarget();return null===e?t.outputColorSpace:!0===e.isXRRenderTarget?e.texture.colorSpace:ke.workingColorSpace}const ar={clone:ir,merge:rr};let or=class extends Ei{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==t&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=ir(t.uniforms),this.uniformsGroups=function(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].clone());return e}(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const n in this.uniforms){const i=this.uniforms[n].value;i&&i.isTexture?e.uniforms[n]={type:"t",value:i.toJSON(t).uuid}:i&&i.isColor?e.uniforms[n]={type:"c",value:i.getHex()}:i&&i.isVector2?e.uniforms[n]={type:"v2",value:i.toArray()}:i&&i.isVector3?e.uniforms[n]={type:"v3",value:i.toArray()}:i&&i.isVector4?e.uniforms[n]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?e.uniforms[n]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?e.uniforms[n]={type:"m4",value:i.toArray()}:e.uniforms[n]={value:i}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const n={};for(const t in this.extensions)!0===this.extensions[t]&&(n[t]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}},lr=class extends si{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Dn,this.projectionMatrix=new Dn,this.projectionMatrixInverse=new Dn,this.coordinateSystem=de}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}};const ur=new en,hr=new Ee,cr=new Ee;let Ar=class extends lr{constructor(t=50,e=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=2*ve*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*ye*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*ve*Math.atan(Math.tan(.5*ye*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){ur.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(ur.x,ur.y).multiplyScalar(-t/ur.z),ur.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(ur.x,ur.y).multiplyScalar(-t/ur.z)}getViewSize(t,e){return this.getViewBounds(t,hr,cr),e.subVectors(cr,hr)}setViewOffset(t,e,n,i,r,s){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*ye*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i;const s=this.view;if(null!==this.view&&this.view.enabled){const t=s.fullWidth,a=s.fullHeight;r+=s.offsetX*i/t,e-=s.offsetY*n/a,i*=s.width/t,n*=s.height/a}const a=this.filmOffset;0!==a&&(r+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}};const dr=-90;let pr=class extends si{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new Ar(dr,1,t,e);i.layers=this.layers,this.add(i);const r=new Ar(dr,1,t,e);r.layers=this.layers,this.add(r);const s=new Ar(dr,1,t,e);s.layers=this.layers,this.add(s);const a=new Ar(dr,1,t,e);a.layers=this.layers,this.add(a);const o=new Ar(dr,1,t,e);o.layers=this.layers,this.add(o);const l=new Ar(dr,1,t,e);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[n,i,r,s,a,o]=e;for(const t of e)this.remove(t);if(t===de)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else{if(t!==pe)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),o.up.set(0,-1,0),o.lookAt(0,0,-1)}for(const t of e)this.add(t),t.updateMatrixWorld()}update(t,e){null===this.parent&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[r,s,a,o,l,u]=this.children,h=t.getRenderTarget(),c=t.getActiveCubeFace(),A=t.getActiveMipmapLevel(),d=t.xr.enabled;t.xr.enabled=!1;const p=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,i),t.render(e,r),t.setRenderTarget(n,1,i),t.render(e,s),t.setRenderTarget(n,2,i),t.render(e,a),t.setRenderTarget(n,3,i),t.render(e,o),t.setRenderTarget(n,4,i),t.render(e,l),n.texture.generateMipmaps=p,t.setRenderTarget(n,5,i),t.render(e,u),t.setRenderTarget(h,c,A),t.xr.enabled=d,n.texture.needsPMREMUpdate=!0}},fr=class extends Ye{constructor(t,e,n,i,r,s,a,o,l,u){super(t=void 0!==t?t:[],e=void 0!==e?e:z,n,i,r,s,a,o,l,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}},mr=class extends Ze{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const n={width:t,height:t,depth:1},i=[n,n,n,n,n,n];this.texture=new fr(i,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:Q}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},i=new nr(5,5,5),r=new or({name:"CubemapFromEquirect",uniforms:ir(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=e;const s=new tr(i,r),a=e.minFilter;e.minFilter===Z&&(e.minFilter=Q);return new pr(1,10,this).update(t,s),e.minFilter=a,s.geometry.dispose(),s.material.dispose(),this}clear(t,e,n,i){const r=t.getRenderTarget();for(let r=0;r<6;r++)t.setRenderTarget(this,r),t.clear(e,n,i);t.setRenderTarget(r)}};const gr=new en,yr=new en,vr=new Ce;let _r=class{constructor(t=new en(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){const i=gr.subVectors(n,e).cross(yr.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const n=t.delta(gr),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const r=-(t.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:e.copy(t.start).addScaledVector(n,r)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||vr.getNormalMatrix(t),i=this.coplanarPoint(gr).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}};const xr=new Sn,br=new en;let Sr=class{constructor(t=new _r,e=new _r,n=new _r,i=new _r,r=new _r,s=new _r){this.planes=[t,e,n,i,r,s]}set(t,e,n,i,r,s){const a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(r),a[5].copy(s),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=2e3){const n=this.planes,i=t.elements,r=i[0],s=i[1],a=i[2],o=i[3],l=i[4],u=i[5],h=i[6],c=i[7],A=i[8],d=i[9],p=i[10],f=i[11],m=i[12],g=i[13],y=i[14],v=i[15];if(n[0].setComponents(o-r,c-l,f-A,v-m).normalize(),n[1].setComponents(o+r,c+l,f+A,v+m).normalize(),n[2].setComponents(o+s,c+u,f+d,v+g).normalize(),n[3].setComponents(o-s,c-u,f-d,v-g).normalize(),n[4].setComponents(o-a,c-h,f-p,v-y).normalize(),e===de)n[5].setComponents(o+a,c+h,f+p,v+y).normalize();else{if(e!==pe)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);n[5].setComponents(a,h,p,y).normalize()}return this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),xr.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),xr.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(xr)}intersectsSprite(t){return xr.center.set(0,0,0),xr.radius=.7071067811865476,xr.applyMatrix4(t.matrixWorld),this.intersectsSphere(xr)}intersectsSphere(t){const e=this.planes,n=t.center,i=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(n)<i)return!1}return!0}intersectsBox(t){const e=this.planes;for(let n=0;n<6;n++){const i=e[n];if(br.x=i.normal.x>0?t.max.x:t.min.x,br.y=i.normal.y>0?t.max.y:t.min.y,br.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(br)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}};function Mr(){let t=null,e=!1,n=null,i=null;function r(e,s){n(e,s),i=t.requestAnimationFrame(r)}return{start:function(){!0!==e&&null!==n&&(i=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function wr(t){const e=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),e.get(t)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);const i=e.get(n);i&&(t.deleteBuffer(i.buffer),e.delete(n))},update:function(n,i){if(n.isInterleavedBufferAttribute&&(n=n.data),n.isGLBufferAttribute){const t=e.get(n);return void((!t||t.version<n.version)&&e.set(n,{buffer:n.buffer,type:n.type,bytesPerElement:n.elementSize,version:n.version}))}const r=e.get(n);if(void 0===r)e.set(n,function(e,n){const i=e.array,r=e.usage,s=i.byteLength,a=t.createBuffer();let o;if(t.bindBuffer(n,a),t.bufferData(n,i,r),e.onUploadCallback(),i instanceof Float32Array)o=t.FLOAT;else if(i instanceof Uint16Array)o=e.isFloat16BufferAttribute?t.HALF_FLOAT:t.UNSIGNED_SHORT;else if(i instanceof Int16Array)o=t.SHORT;else if(i instanceof Uint32Array)o=t.UNSIGNED_INT;else if(i instanceof Int32Array)o=t.INT;else if(i instanceof Int8Array)o=t.BYTE;else if(i instanceof Uint8Array)o=t.UNSIGNED_BYTE;else{if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+i);o=t.UNSIGNED_BYTE}return{buffer:a,type:o,bytesPerElement:i.BYTES_PER_ELEMENT,version:e.version,size:s}}(n,i));else if(r.version<n.version){if(r.size!==n.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");!function(e,n,i){const r=n.array,s=n.updateRanges;if(t.bindBuffer(i,e),0===s.length)t.bufferSubData(i,0,r);else{s.sort(((t,e)=>t.start-e.start));let e=0;for(let t=1;t<s.length;t++){const n=s[e],i=s[t];i.start<=n.start+n.count+1?n.count=Math.max(n.count,i.start+i.count-n.start):(++e,s[e]=i)}s.length=e+1;for(let e=0,n=s.length;e<n;e++){const n=s[e];t.bufferSubData(i,n.start*r.BYTES_PER_ELEMENT,r,n.start,n.count)}n.clearUpdateRanges()}n.onUploadCallback()}(r.buffer,n,i),r.version=n.version}}}}class Tr extends Gi{constructor(t=1,e=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i};const r=t/2,s=e/2,a=Math.floor(n),o=Math.floor(i),l=a+1,u=o+1,h=t/a,c=e/o,A=[],d=[],p=[],f=[];for(let t=0;t<u;t++){const e=t*c-s;for(let n=0;n<l;n++){const i=n*h-r;d.push(i,-e,0),p.push(0,0,1),f.push(n/a),f.push(1-t/o)}}for(let t=0;t<o;t++)for(let e=0;e<a;e++){const n=e+l*t,i=e+l*(t+1),r=e+1+l*(t+1),s=e+1+l*t;A.push(n,i,s),A.push(i,r,s)}this.setIndex(A),this.setAttribute("position",new Li(d,3)),this.setAttribute("normal",new Li(p,3)),this.setAttribute("uv",new Li(f,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Tr(t.width,t.height,t.widthSegments,t.heightSegments)}}const Er={alphahash_fragment:"#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n\t#if ! defined( GL_ANGLE_multi_draw )\n\t#define gl_DrawID _gl_DrawID\n\tuniform int _gl_DrawID;\n\t#endif\n\tuniform highp sampler2D batchingTexture;\n\tuniform highp usampler2D batchingIdTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n\tfloat getIndirectIndex( const in int i ) {\n\t\tint size = textureSize( batchingIdTexture, 0 ).x;\n\t\tint x = i % size;\n\t\tint y = i / size;\n\t\treturn float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n\t}\n#endif\n#ifdef USE_BATCHING_COLOR\n\tuniform sampler2D batchingColorTexture;\n\tvec3 getBatchingColor( const in float i ) {\n\t\tint size = textureSize( batchingColorTexture, 0 ).x;\n\t\tint j = int( i );\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\treturn texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n\t}\n#endif",batching_vertex:"#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n\tvec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n\tvColor.xyz *= batchingColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif ( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n\tmaterial.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\tfloat dispersion;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t#endif\n\tuniform sampler2DArray morphTargetsTexture;\n\tuniform ivec2 morphTargetsTextureSize;\n\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t}\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec4( 0., 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec4( 1., 1., 1., 1. );\n\tfloat vuf;\n\tfloat af = modf( v * PackFactors.a, vuf );\n\tfloat bf = modf( vuf * ShiftRight8, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec3( 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec3( 1., 1., 1. );\n\tfloat vuf;\n\tfloat bf = modf( v * PackFactors.b, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec2( 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec2( 1., 1. );\n\tfloat vuf;\n\tfloat gf = modf( v * 256., vuf );\n\treturn vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n\treturn dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n\treturn v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tconst float StartCompression = 0.8 - 0.04;\n\tconst float Desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min( color.r, min( color.g, color.b ) );\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max( color.r, max( color.g, color.b ) );\n\tif ( peak < StartCompression ) return color;\n\tfloat d = 1. - StartCompression;\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n\treturn mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec4 transmittedLight;\n\t\tvec3 transmittance;\n\t\t#ifdef USE_DISPERSION\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\t\t\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n\t\t\t}\n\t\t\ttransmittedLight.a /= 3.0;\n\t\t\n\t\t#else\n\t\t\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\trefractionCoords += 1.0;\n\t\t\trefractionCoords /= 2.0;\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\t\n\t\t#endif\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",depth_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#elif DEPTH_PACKING == 3202\n\t\tgl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n\t#elif DEPTH_PACKING == 3203\n\t\tgl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n\tuniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix[ 3 ];\n\tvec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}"},Cr={common:{diffuse:{value:new Mi(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Ce},alphaMap:{value:null},alphaMapTransform:{value:new Ce},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Ce}},envmap:{envMap:{value:null},envMapRotation:{value:new Ce},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Ce}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Ce}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Ce},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Ce},normalScale:{value:new Ee(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Ce},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Ce}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Ce}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Ce}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Mi(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Mi(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Ce},alphaTest:{value:0},uvTransform:{value:new Ce}},sprite:{diffuse:{value:new Mi(16777215)},opacity:{value:1},center:{value:new Ee(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Ce},alphaMap:{value:null},alphaMapTransform:{value:new Ce},alphaTest:{value:0}}},Rr={basic:{uniforms:rr([Cr.common,Cr.specularmap,Cr.envmap,Cr.aomap,Cr.lightmap,Cr.fog]),vertexShader:Er.meshbasic_vert,fragmentShader:Er.meshbasic_frag},lambert:{uniforms:rr([Cr.common,Cr.specularmap,Cr.envmap,Cr.aomap,Cr.lightmap,Cr.emissivemap,Cr.bumpmap,Cr.normalmap,Cr.displacementmap,Cr.fog,Cr.lights,{emissive:{value:new Mi(0)}}]),vertexShader:Er.meshlambert_vert,fragmentShader:Er.meshlambert_frag},phong:{uniforms:rr([Cr.common,Cr.specularmap,Cr.envmap,Cr.aomap,Cr.lightmap,Cr.emissivemap,Cr.bumpmap,Cr.normalmap,Cr.displacementmap,Cr.fog,Cr.lights,{emissive:{value:new Mi(0)},specular:{value:new Mi(1118481)},shininess:{value:30}}]),vertexShader:Er.meshphong_vert,fragmentShader:Er.meshphong_frag},standard:{uniforms:rr([Cr.common,Cr.envmap,Cr.aomap,Cr.lightmap,Cr.emissivemap,Cr.bumpmap,Cr.normalmap,Cr.displacementmap,Cr.roughnessmap,Cr.metalnessmap,Cr.fog,Cr.lights,{emissive:{value:new Mi(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Er.meshphysical_vert,fragmentShader:Er.meshphysical_frag},toon:{uniforms:rr([Cr.common,Cr.aomap,Cr.lightmap,Cr.emissivemap,Cr.bumpmap,Cr.normalmap,Cr.displacementmap,Cr.gradientmap,Cr.fog,Cr.lights,{emissive:{value:new Mi(0)}}]),vertexShader:Er.meshtoon_vert,fragmentShader:Er.meshtoon_frag},matcap:{uniforms:rr([Cr.common,Cr.bumpmap,Cr.normalmap,Cr.displacementmap,Cr.fog,{matcap:{value:null}}]),vertexShader:Er.meshmatcap_vert,fragmentShader:Er.meshmatcap_frag},points:{uniforms:rr([Cr.points,Cr.fog]),vertexShader:Er.points_vert,fragmentShader:Er.points_frag},dashed:{uniforms:rr([Cr.common,Cr.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Er.linedashed_vert,fragmentShader:Er.linedashed_frag},depth:{uniforms:rr([Cr.common,Cr.displacementmap]),vertexShader:Er.depth_vert,fragmentShader:Er.depth_frag},normal:{uniforms:rr([Cr.common,Cr.bumpmap,Cr.normalmap,Cr.displacementmap,{opacity:{value:1}}]),vertexShader:Er.meshnormal_vert,fragmentShader:Er.meshnormal_frag},sprite:{uniforms:rr([Cr.sprite,Cr.fog]),vertexShader:Er.sprite_vert,fragmentShader:Er.sprite_frag},background:{uniforms:{uvTransform:{value:new Ce},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Er.background_vert,fragmentShader:Er.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Ce}},vertexShader:Er.backgroundCube_vert,fragmentShader:Er.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Er.cube_vert,fragmentShader:Er.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Er.equirect_vert,fragmentShader:Er.equirect_frag},distanceRGBA:{uniforms:rr([Cr.common,Cr.displacementmap,{referencePosition:{value:new en},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Er.distanceRGBA_vert,fragmentShader:Er.distanceRGBA_frag},shadow:{uniforms:rr([Cr.lights,Cr.fog,{color:{value:new Mi(0)},opacity:{value:1}}]),vertexShader:Er.shadow_vert,fragmentShader:Er.shadow_frag}};Rr.physical={uniforms:rr([Rr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Ce},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Ce},clearcoatNormalScale:{value:new Ee(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Ce},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Ce},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Ce},sheen:{value:0},sheenColor:{value:new Mi(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Ce},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Ce},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Ce},transmissionSamplerSize:{value:new Ee},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Ce},attenuationDistance:{value:0},attenuationColor:{value:new Mi(0)},specularColor:{value:new Mi(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Ce},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Ce},anisotropyVector:{value:new Ee},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Ce}}]),vertexShader:Er.meshphysical_vert,fragmentShader:Er.meshphysical_frag};const Nr={r:0,b:0,g:0},Pr=new Gn,Dr=new Dn;function Ir(t,e,n,i,r,s,a){const o=new Mi(0);let l,u,h=!0===s?0:1,c=null,A=0,d=null;function p(t){let i=!0===t.isScene?t.background:null;if(i&&i.isTexture){i=(t.backgroundBlurriness>0?n:e).get(i)}return i}function f(e,n){e.getRGB(Nr,sr(t)),i.buffers.color.setClear(Nr.r,Nr.g,Nr.b,n,a)}return{getClearColor:function(){return o},setClearColor:function(t,e=1){o.set(t),h=e,f(o,h)},getClearAlpha:function(){return h},setClearAlpha:function(t){h=t,f(o,h)},render:function(e){let n=!1;const r=p(e);null===r?f(o,h):r&&r.isColor&&(f(r,1),n=!0);const s=t.xr.getEnvironmentBlendMode();"additive"===s?i.buffers.color.setClear(0,0,0,1,a):"alpha-blend"===s&&i.buffers.color.setClear(0,0,0,0,a),(t.autoClear||n)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil))},addToRenderList:function(e,n){const i=p(n);i&&(i.isCubeTexture||i.mapping===G)?(void 0===u&&(u=new tr(new nr(1,1,1),new or({name:"BackgroundCubeMaterial",uniforms:ir(Rr.backgroundCube.uniforms),vertexShader:Rr.backgroundCube.vertexShader,fragmentShader:Rr.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),Pr.copy(n.backgroundRotation),Pr.x*=-1,Pr.y*=-1,Pr.z*=-1,i.isCubeTexture&&!1===i.isRenderTargetTexture&&(Pr.y*=-1,Pr.z*=-1),u.material.uniforms.envMap.value=i,u.material.uniforms.flipEnvMap.value=i.isCubeTexture&&!1===i.isRenderTargetTexture?-1:1,u.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(Dr.makeRotationFromEuler(Pr)),u.material.toneMapped=ke.getTransfer(i.colorSpace)!==Jt,c===i&&A===i.version&&d===t.toneMapping||(u.material.needsUpdate=!0,c=i,A=i.version,d=t.toneMapping),u.layers.enableAll(),e.unshift(u,u.geometry,u.material,0,0,null)):i&&i.isTexture&&(void 0===l&&(l=new tr(new Tr(2,2),new or({name:"BackgroundMaterial",uniforms:ir(Rr.background.uniforms),vertexShader:Rr.background.vertexShader,fragmentShader:Rr.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(l)),l.material.uniforms.t2D.value=i,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.toneMapped=ke.getTransfer(i.colorSpace)!==Jt,!0===i.matrixAutoUpdate&&i.updateMatrix(),l.material.uniforms.uvTransform.value.copy(i.matrix),c===i&&A===i.version&&d===t.toneMapping||(l.material.needsUpdate=!0,c=i,A=i.version,d=t.toneMapping),l.layers.enableAll(),e.unshift(l,l.geometry,l.material,0,0,null))}}}function Lr(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),i={},r=u(null);let s=r,a=!1;function o(e){return t.bindVertexArray(e)}function l(e){return t.deleteVertexArray(e)}function u(t){const e=[],i=[],r=[];for(let t=0;t<n;t++)e[t]=0,i[t]=0,r[t]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:e,enabledAttributes:i,attributeDivisors:r,object:t,attributes:{},index:null}}function h(){const t=s.newAttributes;for(let e=0,n=t.length;e<n;e++)t[e]=0}function c(t){A(t,0)}function A(e,n){const i=s.newAttributes,r=s.enabledAttributes,a=s.attributeDivisors;i[e]=1,0===r[e]&&(t.enableVertexAttribArray(e),r[e]=1),a[e]!==n&&(t.vertexAttribDivisor(e,n),a[e]=n)}function d(){const e=s.newAttributes,n=s.enabledAttributes;for(let i=0,r=n.length;i<r;i++)n[i]!==e[i]&&(t.disableVertexAttribArray(i),n[i]=0)}function p(e,n,i,r,s,a,o){!0===o?t.vertexAttribIPointer(e,n,i,s,a):t.vertexAttribPointer(e,n,i,r,s,a)}function f(){m(),a=!0,s!==r&&(s=r,o(s.object))}function m(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:function(n,r,l,f,m){let g=!1;const y=function(e,n,r){const s=!0===r.wireframe;let a=i[e.id];void 0===a&&(a={},i[e.id]=a);let o=a[n.id];void 0===o&&(o={},a[n.id]=o);let l=o[s];void 0===l&&(l=u(t.createVertexArray()),o[s]=l);return l}(f,l,r);s!==y&&(s=y,o(s.object)),g=function(t,e,n,i){const r=s.attributes,a=e.attributes;let o=0;const l=n.getAttributes();for(const e in l){if(l[e].location>=0){const n=r[e];let i=a[e];if(void 0===i&&("instanceMatrix"===e&&t.instanceMatrix&&(i=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(i=t.instanceColor)),void 0===n)return!0;if(n.attribute!==i)return!0;if(i&&n.data!==i.data)return!0;o++}}return s.attributesNum!==o||s.index!==i}(n,f,l,m),g&&function(t,e,n,i){const r={},a=e.attributes;let o=0;const l=n.getAttributes();for(const e in l){if(l[e].location>=0){let n=a[e];void 0===n&&("instanceMatrix"===e&&t.instanceMatrix&&(n=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(n=t.instanceColor));const i={};i.attribute=n,n&&n.data&&(i.data=n.data),r[e]=i,o++}}s.attributes=r,s.attributesNum=o,s.index=i}(n,f,l,m),null!==m&&e.update(m,t.ELEMENT_ARRAY_BUFFER),(g||a)&&(a=!1,function(n,i,r,s){h();const a=s.attributes,o=r.getAttributes(),l=i.defaultAttributeValues;for(const i in o){const r=o[i];if(r.location>=0){let o=a[i];if(void 0===o&&("instanceMatrix"===i&&n.instanceMatrix&&(o=n.instanceMatrix),"instanceColor"===i&&n.instanceColor&&(o=n.instanceColor)),void 0!==o){const i=o.normalized,a=o.itemSize,l=e.get(o);if(void 0===l)continue;const u=l.buffer,h=l.type,d=l.bytesPerElement,f=h===t.INT||h===t.UNSIGNED_INT||o.gpuType===nt;if(o.isInterleavedBufferAttribute){const e=o.data,l=e.stride,m=o.offset;if(e.isInstancedInterleavedBuffer){for(let t=0;t<r.locationSize;t++)A(r.location+t,e.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===s._maxInstanceCount&&(s._maxInstanceCount=e.meshPerAttribute*e.count)}else for(let t=0;t<r.locationSize;t++)c(r.location+t);t.bindBuffer(t.ARRAY_BUFFER,u);for(let t=0;t<r.locationSize;t++)p(r.location+t,a/r.locationSize,h,i,l*d,(m+a/r.locationSize*t)*d,f)}else{if(o.isInstancedBufferAttribute){for(let t=0;t<r.locationSize;t++)A(r.location+t,o.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===s._maxInstanceCount&&(s._maxInstanceCount=o.meshPerAttribute*o.count)}else for(let t=0;t<r.locationSize;t++)c(r.location+t);t.bindBuffer(t.ARRAY_BUFFER,u);for(let t=0;t<r.locationSize;t++)p(r.location+t,a/r.locationSize,h,i,a*d,a/r.locationSize*t*d,f)}}else if(void 0!==l){const e=l[i];if(void 0!==e)switch(e.length){case 2:t.vertexAttrib2fv(r.location,e);break;case 3:t.vertexAttrib3fv(r.location,e);break;case 4:t.vertexAttrib4fv(r.location,e);break;default:t.vertexAttrib1fv(r.location,e)}}}}d()}(n,r,l,f),null!==m&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get(m).buffer))},reset:f,resetDefaultState:m,dispose:function(){f();for(const t in i){const e=i[t];for(const t in e){const n=e[t];for(const t in n)l(n[t].object),delete n[t];delete e[t]}delete i[t]}},releaseStatesOfGeometry:function(t){if(void 0===i[t.id])return;const e=i[t.id];for(const t in e){const n=e[t];for(const t in n)l(n[t].object),delete n[t];delete e[t]}delete i[t.id]},releaseStatesOfProgram:function(t){for(const e in i){const n=i[e];if(void 0===n[t.id])continue;const r=n[t.id];for(const t in r)l(r[t].object),delete r[t];delete n[t.id]}},initAttributes:h,enableAttribute:c,disableUnusedAttributes:d}}function Br(t,e,n){let i;function r(e,r,s){0!==s&&(t.drawArraysInstanced(i,e,r,s),n.update(r,i,s))}this.setMode=function(t){i=t},this.render=function(e,r){t.drawArrays(i,e,r),n.update(r,i,1)},this.renderInstances=r,this.renderMultiDraw=function(t,r,s){if(0===s)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(i,t,0,r,0,s);let a=0;for(let t=0;t<s;t++)a+=r[t];n.update(a,i,1)},this.renderMultiDrawInstances=function(t,s,a,o){if(0===a)return;const l=e.get("WEBGL_multi_draw");if(null===l)for(let e=0;e<t.length;e++)r(t[e],s[e],o[e]);else{l.multiDrawArraysInstancedWEBGL(i,t,0,s,0,o,0,a);let e=0;for(let t=0;t<a;t++)e+=s[t];for(let t=0;t<o.length;t++)n.update(e,i,o[t])}}}function Ur(t,e,n,i){let r;function s(e){if("highp"===e){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let a=void 0!==n.precision?n.precision:"highp";const o=s(a);o!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",o,"instead."),a=o);const l=!0===n.logarithmicDepthBuffer,u=!0===n.reverseDepthBuffer&&e.has("EXT_clip_control");if(!0===u){const t=e.get("EXT_clip_control");t.clipControlEXT(t.LOWER_LEFT_EXT,t.ZERO_TO_ONE_EXT)}const h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),c=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS);return{isWebGL2:!0,getMaxAnisotropy:function(){if(void 0!==r)return r;if(!0===e.has("EXT_texture_filter_anisotropic")){const n=e.get("EXT_texture_filter_anisotropic");r=t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r},getMaxPrecision:s,textureFormatReadable:function(e){return e===ht||i.convert(e)===t.getParameter(t.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(n){const r=n===st&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(n!==K&&i.convert(n)!==t.getParameter(t.IMPLEMENTATION_COLOR_READ_TYPE)&&n!==rt&&!r)},precision:a,logarithmicDepthBuffer:l,reverseDepthBuffer:u,maxTextures:h,maxVertexTextures:c,maxTextureSize:t.getParameter(t.MAX_TEXTURE_SIZE),maxCubemapSize:t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes:t.getParameter(t.MAX_VERTEX_ATTRIBS),maxVertexUniforms:t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings:t.getParameter(t.MAX_VARYING_VECTORS),maxFragmentUniforms:t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),vertexTextures:c>0,maxSamples:t.getParameter(t.MAX_SAMPLES)}}function Or(t){const e=this;let n=null,i=0,r=!1,s=!1;const a=new _r,o=new Ce,l={value:null,needsUpdate:!1};function u(t,n,i,r){const s=null!==t?t.length:0;let u=null;if(0!==s){if(u=l.value,!0!==r||null===u){const e=i+4*s,r=n.matrixWorldInverse;o.getNormalMatrix(r),(null===u||u.length<e)&&(u=new Float32Array(e));for(let e=0,n=i;e!==s;++e,n+=4)a.copy(t[e]).applyMatrix4(r,o),a.normal.toArray(u,n),u[n+3]=a.constant}l.value=u,l.needsUpdate=!0}return e.numPlanes=s,e.numIntersection=0,u}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(t,e){const n=0!==t.length||e||0!==i||r;return r=e,i=t.length,n},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(t,e){n=u(t,e,0)},this.setState=function(a,o,h){const c=a.clippingPlanes,A=a.clipIntersection,d=a.clipShadows,p=t.get(a);if(!r||null===c||0===c.length||s&&!d)s?u(null):function(){l.value!==n&&(l.value=n,l.needsUpdate=i>0);e.numPlanes=i,e.numIntersection=0}();else{const t=s?0:i,e=4*t;let r=p.clippingState||null;l.value=r,r=u(c,o,e,h);for(let t=0;t!==e;++t)r[t]=n[t];p.clippingState=r,this.numIntersection=A?this.numPlanes:0,this.numPlanes+=t}}}function Fr(t){let e=new WeakMap;function n(t,e){return 303===e?t.mapping=z:304===e&&(t.mapping=q),t}function i(t){const n=t.target;n.removeEventListener("dispose",i);const r=e.get(n);void 0!==r&&(e.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture){const s=r.mapping;if(303===s||304===s){if(e.has(r)){return n(e.get(r).texture,r.mapping)}{const s=r.image;if(s&&s.height>0){const a=new mr(s.height);return a.fromEquirectangularTexture(t,r),e.set(r,a),r.addEventListener("dispose",i),n(a.texture,r.mapping)}return null}}}return r},dispose:function(){e=new WeakMap}}}let kr=class extends lr{constructor(t=-1,e=1,n=1,i=-1,r=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=r,this.far=s,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,n,i,r,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let r=n-t,s=n+t,a=i+e,o=i-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX,s=r+t*this.view.width,a-=e*this.view.offsetY,o=a-e*this.view.height}this.projectionMatrix.makeOrthographic(r,s,a,o,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}};const zr=[.125,.215,.35,.446,.526,.582],qr=20,Gr=new kr,Vr=new Mi;let Hr=null,jr=0,Wr=0,Xr=!1;const Yr=(1+Math.sqrt(5))/2,Qr=1/Yr,$r=[new en(-Yr,Qr,0),new en(Yr,Qr,0),new en(-Qr,0,Yr),new en(Qr,0,Yr),new en(0,Yr,-Qr),new en(0,Yr,Qr),new en(-1,1,-1),new en(1,1,-1),new en(-1,1,1),new en(1,1,1)];let Zr=class{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,i=100){Hr=this._renderer.getRenderTarget(),jr=this._renderer.getActiveCubeFace(),Wr=this._renderer.getActiveMipmapLevel(),Xr=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(t,n,i,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=es(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=ts(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(Hr,jr,Wr),this._renderer.xr.enabled=Xr,t.scissorTest=!1,Jr(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===z||t.mapping===q?this._setSize(0===t.image.length?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),Hr=this._renderer.getRenderTarget(),jr=this._renderer.getActiveCubeFace(),Wr=this._renderer.getActiveMipmapLevel(),Xr=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=e||this._allocateTargets();return this._textureToCubeUV(t,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,n={magFilter:Q,minFilter:Q,generateMipmaps:!1,type:st,format:ht,colorSpace:Qt,depthBuffer:!1},i=Kr(t,e,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=Kr(t,e,n);const{_lodMax:i}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(t){const e=[],n=[],i=[];let r=t;const s=t-4+1+zr.length;for(let a=0;a<s;a++){const s=Math.pow(2,r);n.push(s);let o=1/s;a>t-4?o=zr[a-t+4-1]:0===a&&(o=0),i.push(o);const l=1/(s-2),u=-l,h=1+l,c=[u,u,h,u,h,h,u,u,h,h,u,h],A=6,d=6,p=3,f=2,m=1,g=new Float32Array(p*d*A),y=new Float32Array(f*d*A),v=new Float32Array(m*d*A);for(let t=0;t<A;t++){const e=t%3*2/3-1,n=t>2?0:-1,i=[e,n,0,e+2/3,n,0,e+2/3,n+1,0,e,n,0,e+2/3,n+1,0,e,n+1,0];g.set(i,p*d*t),y.set(c,f*d*t);const r=[t,t,t,t,t,t];v.set(r,m*d*t)}const _=new Gi;_.setAttribute("position",new Pi(g,p)),_.setAttribute("uv",new Pi(y,f)),_.setAttribute("faceIndex",new Pi(v,m)),e.push(_),r>4&&r--}return{lodPlanes:e,sizeLods:n,sigmas:i}}(i)),this._blurMaterial=function(t,e,n){const i=new Float32Array(qr),r=new en(0,1,0),s=new or({name:"SphericalGaussianBlur",defines:{n:qr,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:ns(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1});return s}(i,t,e)}return i}_compileMaterial(t){const e=new tr(this._lodPlanes[0],t);this._renderer.compile(e,Gr)}_sceneToCubeUV(t,e,n,i){const r=new Ar(90,1,e,n),s=[1,-1,1,1,1,1],a=[1,1,1,-1,-1,-1],o=this._renderer,l=o.autoClear,u=o.toneMapping;o.getClearColor(Vr),o.toneMapping=0,o.autoClear=!1;const h=new Ci({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1}),c=new tr(new nr,h);let A=!1;const d=t.background;d?d.isColor&&(h.color.copy(d),t.background=null,A=!0):(h.color.copy(Vr),A=!0);for(let e=0;e<6;e++){const n=e%3;0===n?(r.up.set(0,s[e],0),r.lookAt(a[e],0,0)):1===n?(r.up.set(0,0,s[e]),r.lookAt(0,a[e],0)):(r.up.set(0,s[e],0),r.lookAt(0,0,a[e]));const l=this._cubeSize;Jr(i,n*l,e>2?l:0,l,l),o.setRenderTarget(i),A&&o.render(c,r),o.render(t,r)}c.geometry.dispose(),c.material.dispose(),o.toneMapping=u,o.autoClear=l,t.background=d}_textureToCubeUV(t,e){const n=this._renderer,i=t.mapping===z||t.mapping===q;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=es()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=ts());const r=i?this._cubemapMaterial:this._equirectMaterial,s=new tr(this._lodPlanes[0],r);r.uniforms.envMap.value=t;const a=this._cubeSize;Jr(e,0,0,3*a,2*a),n.setRenderTarget(e),n.render(s,Gr)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;const i=this._lodPlanes.length;for(let e=1;e<i;e++){const n=Math.sqrt(this._sigmas[e]*this._sigmas[e]-this._sigmas[e-1]*this._sigmas[e-1]),r=$r[(i-e-1)%$r.length];this._blur(t,e-1,e,n,r)}e.autoClear=n}_blur(t,e,n,i,r){const s=this._pingPongRenderTarget;this._halfBlur(t,s,e,n,i,"latitudinal",r),this._halfBlur(s,t,n,n,i,"longitudinal",r)}_halfBlur(t,e,n,i,r,s,a){const o=this._renderer,l=this._blurMaterial;"latitudinal"!==s&&"longitudinal"!==s&&console.error("blur direction must be either latitudinal or longitudinal!");const u=new tr(this._lodPlanes[i],l),h=l.uniforms,c=this._sizeLods[n]-1,A=isFinite(r)?Math.PI/(2*c):2*Math.PI/39,d=r/A,p=isFinite(r)?1+Math.floor(3*d):qr;p>qr&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${p} samples when the maximum is set to 20`);const f=[];let m=0;for(let t=0;t<qr;++t){const e=t/d,n=Math.exp(-e*e/2);f.push(n),0===t?m+=n:t<p&&(m+=2*n)}for(let t=0;t<f.length;t++)f[t]=f[t]/m;h.envMap.value=t.texture,h.samples.value=p,h.weights.value=f,h.latitudinal.value="latitudinal"===s,a&&(h.poleAxis.value=a);const{_lodMax:g}=this;h.dTheta.value=A,h.mipInt.value=g-n;const y=this._sizeLods[i];Jr(e,3*y*(i>g-4?i-g+4:0),4*(this._cubeSize-y),3*y,2*y),o.setRenderTarget(e),o.render(u,Gr)}};function Kr(t,e,n){const i=new Ze(t,e,n);return i.texture.mapping=G,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Jr(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function ts(){return new or({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:ns(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function es(){return new or({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:ns(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function ns(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function is(t){let e=new WeakMap,n=null;function i(t){const n=t.target;n.removeEventListener("dispose",i);const r=e.get(n);void 0!==r&&(e.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture){const s=r.mapping,a=303===s||304===s,o=s===z||s===q;if(a||o){let s=e.get(r);const l=void 0!==s?s.texture.pmremVersion:0;if(r.isRenderTargetTexture&&r.pmremVersion!==l)return null===n&&(n=new Zr(t)),s=a?n.fromEquirectangular(r,s):n.fromCubemap(r,s),s.texture.pmremVersion=r.pmremVersion,e.set(r,s),s.texture;if(void 0!==s)return s.texture;{const l=r.image;return a&&l&&l.height>0||o&&l&&function(t){let e=0;const n=6;for(let i=0;i<n;i++)void 0!==t[i]&&e++;return e===n}(l)?(null===n&&(n=new Zr(t)),s=a?n.fromEquirectangular(r):n.fromCubemap(r),s.texture.pmremVersion=r.pmremVersion,e.set(r,s),r.addEventListener("dispose",i),s.texture):null}}}return r},dispose:function(){e=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function rs(t){const e={};function n(n){if(void 0!==e[n])return e[n];let i;switch(n){case"WEBGL_depth_texture":i=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=t.getExtension(n)}return e[n]=i,i}return{has:function(t){return null!==n(t)},init:function(){n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance"),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture"),n("WEBGL_render_shared_exponent")},get:function(t){const e=n(t);return null===e&&Le("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function ss(t,e,n,i){const r={},s=new WeakMap;function a(t){const o=t.target;null!==o.index&&e.remove(o.index);for(const t in o.attributes)e.remove(o.attributes[t]);for(const t in o.morphAttributes){const n=o.morphAttributes[t];for(let t=0,i=n.length;t<i;t++)e.remove(n[t])}o.removeEventListener("dispose",a),delete r[o.id];const l=s.get(o);l&&(e.remove(l),s.delete(o)),i.releaseStatesOfGeometry(o),!0===o.isInstancedBufferGeometry&&delete o._maxInstanceCount,n.memory.geometries--}function o(t){const n=[],i=t.index,r=t.attributes.position;let a=0;if(null!==i){const t=i.array;a=i.version;for(let e=0,i=t.length;e<i;e+=3){const i=t[e+0],r=t[e+1],s=t[e+2];n.push(i,r,r,s,s,i)}}else{if(void 0===r)return;{const t=r.array;a=r.version;for(let e=0,i=t.length/3-1;e<i;e+=3){const t=e+0,i=e+1,r=e+2;n.push(t,i,i,r,r,t)}}}const o=new(Ne(n)?Ii:Di)(n,1);o.version=a;const l=s.get(t);l&&e.remove(l),s.set(t,o)}return{get:function(t,e){return!0===r[e.id]||(e.addEventListener("dispose",a),r[e.id]=!0,n.memory.geometries++),e},update:function(n){const i=n.attributes;for(const n in i)e.update(i[n],t.ARRAY_BUFFER);const r=n.morphAttributes;for(const n in r){const i=r[n];for(let n=0,r=i.length;n<r;n++)e.update(i[n],t.ARRAY_BUFFER)}},getWireframeAttribute:function(t){const e=s.get(t);if(e){const n=t.index;null!==n&&e.version<n.version&&o(t)}else o(t);return s.get(t)}}}function as(t,e,n){let i,r,s;function a(e,a,o){0!==o&&(t.drawElementsInstanced(i,a,r,e*s,o),n.update(a,i,o))}this.setMode=function(t){i=t},this.setIndex=function(t){r=t.type,s=t.bytesPerElement},this.render=function(e,a){t.drawElements(i,a,r,e*s),n.update(a,i,1)},this.renderInstances=a,this.renderMultiDraw=function(t,s,a){if(0===a)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(i,s,0,r,t,0,a);let o=0;for(let t=0;t<a;t++)o+=s[t];n.update(o,i,1)},this.renderMultiDrawInstances=function(t,o,l,u){if(0===l)return;const h=e.get("WEBGL_multi_draw");if(null===h)for(let e=0;e<t.length;e++)a(t[e]/s,o[e],u[e]);else{h.multiDrawElementsInstancedWEBGL(i,o,0,r,t,0,u,0,l);let e=0;for(let t=0;t<l;t++)e+=o[t];for(let t=0;t<u.length;t++)n.update(e,i,u[t])}}}function os(t){const e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(n,i,r){switch(e.calls++,i){case t.TRIANGLES:e.triangles+=r*(n/3);break;case t.LINES:e.lines+=r*(n/2);break;case t.LINE_STRIP:e.lines+=r*(n-1);break;case t.LINE_LOOP:e.lines+=r*n;break;case t.POINTS:e.points+=r*n;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",i)}}}}function ls(t,e,n){const i=new WeakMap,r=new Qe;return{update:function(s,a,o){const l=s.morphTargetInfluences,u=a.morphAttributes.position||a.morphAttributes.normal||a.morphAttributes.color,h=void 0!==u?u.length:0;let c=i.get(a);if(void 0===c||c.count!==h){void 0!==c&&c.texture.dispose();const A=void 0!==a.morphAttributes.position,d=void 0!==a.morphAttributes.normal,p=void 0!==a.morphAttributes.color,f=a.morphAttributes.position||[],m=a.morphAttributes.normal||[],g=a.morphAttributes.color||[];let y=0;!0===A&&(y=1),!0===d&&(y=2),!0===p&&(y=3);let v=a.attributes.position.count*y,_=1;v>e.maxTextureSize&&(_=Math.ceil(v/e.maxTextureSize),v=e.maxTextureSize);const x=new Float32Array(v*_*4*h),b=new Ke(x,v,_,h);b.type=rt,b.needsUpdate=!0;const S=4*y;for(let w=0;w<h;w++){const T=f[w],E=m[w],C=g[w],R=v*_*4*w;for(let N=0;N<T.count;N++){const P=N*S;!0===A&&(r.fromBufferAttribute(T,N),x[R+P+0]=r.x,x[R+P+1]=r.y,x[R+P+2]=r.z,x[R+P+3]=0),!0===d&&(r.fromBufferAttribute(E,N),x[R+P+4]=r.x,x[R+P+5]=r.y,x[R+P+6]=r.z,x[R+P+7]=0),!0===p&&(r.fromBufferAttribute(C,N),x[R+P+8]=r.x,x[R+P+9]=r.y,x[R+P+10]=r.z,x[R+P+11]=4===C.itemSize?r.w:1)}}function M(){b.dispose(),i.delete(a),a.removeEventListener("dispose",M)}c={count:h,texture:b,size:new Ee(v,_)},i.set(a,c),a.addEventListener("dispose",M)}if(!0===s.isInstancedMesh&&null!==s.morphTexture)o.getUniforms().setValue(t,"morphTexture",s.morphTexture,n);else{let D=0;for(let L=0;L<l.length;L++)D+=l[L];const I=a.morphTargetsRelative?1:1-D;o.getUniforms().setValue(t,"morphTargetBaseInfluence",I),o.getUniforms().setValue(t,"morphTargetInfluences",l)}o.getUniforms().setValue(t,"morphTargetsTexture",c.texture,n),o.getUniforms().setValue(t,"morphTargetsTextureSize",c.size)}}}function us(t,e,n,i){let r=new WeakMap;function s(t){const e=t.target;e.removeEventListener("dispose",s),n.remove(e.instanceMatrix),null!==e.instanceColor&&n.remove(e.instanceColor)}return{update:function(a){const o=i.render.frame,l=a.geometry,u=e.get(a,l);if(r.get(u)!==o&&(e.update(u),r.set(u,o)),a.isInstancedMesh&&(!1===a.hasEventListener("dispose",s)&&a.addEventListener("dispose",s),r.get(a)!==o&&(n.update(a.instanceMatrix,t.ARRAY_BUFFER),null!==a.instanceColor&&n.update(a.instanceColor,t.ARRAY_BUFFER),r.set(a,o))),a.isSkinnedMesh){const t=a.skeleton;r.get(t)!==o&&(t.update(),r.set(t,o))}return u},dispose:function(){r=new WeakMap}}}let hs=class extends Ye{constructor(t,e,n,i,r,s,a,o,l,u=1026){if(u!==ct&&u!==At)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&u===ct&&(n=it),void 0===n&&u===At&&(n=lt),super(null,i,r,s,a,o,u,n,l),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=void 0!==a?a:W,this.minFilter=void 0!==o?o:W,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return null!==this.compareFunction&&(e.compareFunction=this.compareFunction),e}};const cs=new Ye,As=new hs(1,1),ds=new Ke,ps=new Je,fs=new fr,ms=[],gs=[],ys=new Float32Array(16),vs=new Float32Array(9),_s=new Float32Array(4);function xs(t,e,n){const i=t[0];if(i<=0||i>0)return t;const r=e*n;let s=ms[r];if(void 0===s&&(s=new Float32Array(r),ms[r]=s),0!==e){i.toArray(s,0);for(let i=1,r=0;i!==e;++i)r+=n,t[i].toArray(s,r)}return s}function bs(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n<i;n++)if(t[n]!==e[n])return!1;return!0}function Ss(t,e){for(let n=0,i=e.length;n<i;n++)t[n]=e[n]}function Ms(t,e){let n=gs[e];void 0===n&&(n=new Int32Array(e),gs[e]=n);for(let i=0;i!==e;++i)n[i]=t.allocateTextureUnit();return n}function ws(t,e){const n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function Ts(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(bs(n,e))return;t.uniform2fv(this.addr,e),Ss(n,e)}}function Es(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(bs(n,e))return;t.uniform3fv(this.addr,e),Ss(n,e)}}function Cs(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(bs(n,e))return;t.uniform4fv(this.addr,e),Ss(n,e)}}function Rs(t,e){const n=this.cache,i=e.elements;if(void 0===i){if(bs(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),Ss(n,e)}else{if(bs(n,i))return;_s.set(i),t.uniformMatrix2fv(this.addr,!1,_s),Ss(n,i)}}function Ns(t,e){const n=this.cache,i=e.elements;if(void 0===i){if(bs(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),Ss(n,e)}else{if(bs(n,i))return;vs.set(i),t.uniformMatrix3fv(this.addr,!1,vs),Ss(n,i)}}function Ps(t,e){const n=this.cache,i=e.elements;if(void 0===i){if(bs(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),Ss(n,e)}else{if(bs(n,i))return;ys.set(i),t.uniformMatrix4fv(this.addr,!1,ys),Ss(n,i)}}function Ds(t,e){const n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function Is(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2i(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(bs(n,e))return;t.uniform2iv(this.addr,e),Ss(n,e)}}function Ls(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3i(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(bs(n,e))return;t.uniform3iv(this.addr,e),Ss(n,e)}}function Bs(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4i(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(bs(n,e))return;t.uniform4iv(this.addr,e),Ss(n,e)}}function Us(t,e){const n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function Os(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2ui(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(bs(n,e))return;t.uniform2uiv(this.addr,e),Ss(n,e)}}function Fs(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3ui(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(bs(n,e))return;t.uniform3uiv(this.addr,e),Ss(n,e)}}function ks(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4ui(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(bs(n,e))return;t.uniform4uiv(this.addr,e),Ss(n,e)}}function zs(t,e,n){const i=this.cache,r=n.allocateTextureUnit();let s;i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),this.type===t.SAMPLER_2D_SHADOW?(As.compareFunction=515,s=As):s=cs,n.setTexture2D(e||s,r)}function qs(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(e||ps,r)}function Gs(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTextureCube(e||fs,r)}function Vs(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(e||ds,r)}function Hs(t,e){t.uniform1fv(this.addr,e)}function js(t,e){const n=xs(e,this.size,2);t.uniform2fv(this.addr,n)}function Ws(t,e){const n=xs(e,this.size,3);t.uniform3fv(this.addr,n)}function Xs(t,e){const n=xs(e,this.size,4);t.uniform4fv(this.addr,n)}function Ys(t,e){const n=xs(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function Qs(t,e){const n=xs(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function $s(t,e){const n=xs(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function Zs(t,e){t.uniform1iv(this.addr,e)}function Ks(t,e){t.uniform2iv(this.addr,e)}function Js(t,e){t.uniform3iv(this.addr,e)}function ta(t,e){t.uniform4iv(this.addr,e)}function ea(t,e){t.uniform1uiv(this.addr,e)}function na(t,e){t.uniform2uiv(this.addr,e)}function ia(t,e){t.uniform3uiv(this.addr,e)}function ra(t,e){t.uniform4uiv(this.addr,e)}function sa(t,e,n){const i=this.cache,r=e.length,s=Ms(n,r);bs(i,s)||(t.uniform1iv(this.addr,s),Ss(i,s));for(let t=0;t!==r;++t)n.setTexture2D(e[t]||cs,s[t])}function aa(t,e,n){const i=this.cache,r=e.length,s=Ms(n,r);bs(i,s)||(t.uniform1iv(this.addr,s),Ss(i,s));for(let t=0;t!==r;++t)n.setTexture3D(e[t]||ps,s[t])}function oa(t,e,n){const i=this.cache,r=e.length,s=Ms(n,r);bs(i,s)||(t.uniform1iv(this.addr,s),Ss(i,s));for(let t=0;t!==r;++t)n.setTextureCube(e[t]||fs,s[t])}function la(t,e,n){const i=this.cache,r=e.length,s=Ms(n,r);bs(i,s)||(t.uniform1iv(this.addr,s),Ss(i,s));for(let t=0;t!==r;++t)n.setTexture2DArray(e[t]||ds,s[t])}class ua{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.setValue=function(t){switch(t){case 5126:return ws;case 35664:return Ts;case 35665:return Es;case 35666:return Cs;case 35674:return Rs;case 35675:return Ns;case 35676:return Ps;case 5124:case 35670:return Ds;case 35667:case 35671:return Is;case 35668:case 35672:return Ls;case 35669:case 35673:return Bs;case 5125:return Us;case 36294:return Os;case 36295:return Fs;case 36296:return ks;case 35678:case 36198:case 36298:case 36306:case 35682:return zs;case 35679:case 36299:case 36307:return qs;case 35680:case 36300:case 36308:case 36293:return Gs;case 36289:case 36303:case 36311:case 36292:return Vs}}(e.type)}}class ha{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.size=e.size,this.setValue=function(t){switch(t){case 5126:return Hs;case 35664:return js;case 35665:return Ws;case 35666:return Xs;case 35674:return Ys;case 35675:return Qs;case 35676:return $s;case 5124:case 35670:return Zs;case 35667:case 35671:return Ks;case 35668:case 35672:return Js;case 35669:case 35673:return ta;case 5125:return ea;case 36294:return na;case 36295:return ia;case 36296:return ra;case 35678:case 36198:case 36298:case 36306:case 35682:return sa;case 35679:case 36299:case 36307:return aa;case 35680:case 36300:case 36308:case 36293:return oa;case 36289:case 36303:case 36311:case 36292:return la}}(e.type)}}class ca{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,n){const i=this.seq;for(let r=0,s=i.length;r!==s;++r){const s=i[r];s.setValue(t,e[s.id],n)}}}const Aa=/(\w+)(\])?(\[|\.)?/g;function da(t,e){t.seq.push(e),t.map[e.id]=e}function pa(t,e,n){const i=t.name,r=i.length;for(Aa.lastIndex=0;;){const s=Aa.exec(i),a=Aa.lastIndex;let o=s[1];const l="]"===s[2],u=s[3];if(l&&(o|=0),void 0===u||"["===u&&a+2===r){da(n,void 0===u?new ua(o,t,e):new ha(o,t,e));break}{let t=n.map[o];void 0===t&&(t=new ca(o),da(n,t)),n=t}}}class fa{constructor(t,e){this.seq=[],this.map={};const n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){const n=t.getActiveUniform(e,i);pa(n,t.getUniformLocation(e,n.name),this)}}setValue(t,e,n,i){const r=this.map[e];void 0!==r&&r.setValue(t,n,i)}setOptional(t,e,n){const i=e[n];void 0!==i&&this.setValue(t,n,i)}static upload(t,e,n,i){for(let r=0,s=e.length;r!==s;++r){const s=e[r],a=n[s.id];!1!==a.needsUpdate&&s.setValue(t,a.value,i)}}static seqWithValue(t,e){const n=[];for(let i=0,r=t.length;i!==r;++i){const r=t[i];r.id in e&&n.push(r)}return n}}function ma(t,e,n){const i=t.createShader(e);return t.shaderSource(i,n),t.compileShader(i),i}let ga=0;function ya(t,e,n){const i=t.getShaderParameter(e,t.COMPILE_STATUS),r=t.getShaderInfoLog(e).trim();if(i&&""===r)return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const i=parseInt(s[1]);return n.toUpperCase()+"\n\n"+r+"\n\n"+function(t,e){const n=t.split("\n"),i=[],r=Math.max(e-6,0),s=Math.min(e+6,n.length);for(let t=r;t<s;t++){const r=t+1;i.push(`${r===e?">":" "} ${r}: ${n[t]}`)}return i.join("\n")}(t.getShaderSource(e),i)}return r}function va(t,e){const n=function(t){const e=ke.getPrimaries(ke.workingColorSpace),n=ke.getPrimaries(t);let i;switch(e===n?i="":e===ee&&n===te?i="LinearDisplayP3ToLinearSRGB":e===te&&n===ee&&(i="LinearSRGBToLinearDisplayP3"),t){case Qt:case Zt:return[i,"LinearTransferOETF"];case Yt:case $t:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),[i,"LinearTransferOETF"]}}(e);return`vec4 ${t}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function _a(t,e){let n;switch(e){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="Cineon";break;case 4:n="ACESFilmic";break;case 6:n="AgX";break;case 7:n="Neutral";break;case 5:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}const xa=new en;function ba(){ke.getLuminanceCoefficients(xa);return["float luminance( const in vec3 rgb ) {",`\tconst vec3 weights = vec3( ${xa.x.toFixed(4)}, ${xa.y.toFixed(4)}, ${xa.z.toFixed(4)} );`,"\treturn dot( weights, rgb );","}"].join("\n")}function Sa(t){return""!==t}function Ma(t,e){const n=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function wa(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const Ta=/^[ \t]*#include +<([\w\d./]+)>/gm;function Ea(t){return t.replace(Ta,Ra)}const Ca=new Map;function Ra(t,e){let n=Er[e];if(void 0===n){const t=Ca.get(e);if(void 0===t)throw new Error("Can not resolve #include <"+e+">");n=Er[t],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,t)}return Ea(n)}const Na=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Pa(t){return t.replace(Na,Da)}function Da(t,e,n,i){let r="";for(let t=parseInt(e);t<parseInt(n);t++)r+=i.replace(/\[\s*i\s*\]/g,"[ "+t+" ]").replace(/UNROLLED_LOOP_INDEX/g,t);return r}function Ia(t){let e=`precision ${t.precision} float;\n\tprecision ${t.precision} int;\n\tprecision ${t.precision} sampler2D;\n\tprecision ${t.precision} samplerCube;\n\tprecision ${t.precision} sampler3D;\n\tprecision ${t.precision} sampler2DArray;\n\tprecision ${t.precision} sampler2DShadow;\n\tprecision ${t.precision} samplerCubeShadow;\n\tprecision ${t.precision} sampler2DArrayShadow;\n\tprecision ${t.precision} isampler2D;\n\tprecision ${t.precision} isampler3D;\n\tprecision ${t.precision} isamplerCube;\n\tprecision ${t.precision} isampler2DArray;\n\tprecision ${t.precision} usampler2D;\n\tprecision ${t.precision} usampler3D;\n\tprecision ${t.precision} usamplerCube;\n\tprecision ${t.precision} usampler2DArray;\n\t`;return"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function La(t,e,n,i){const r=t.getContext(),s=n.defines;let a=n.vertexShader,o=n.fragmentShader;const l=function(t){let e="SHADOWMAP_TYPE_BASIC";return 1===t.shadowMapType?e="SHADOWMAP_TYPE_PCF":2===t.shadowMapType?e="SHADOWMAP_TYPE_PCF_SOFT":3===t.shadowMapType&&(e="SHADOWMAP_TYPE_VSM"),e}(n),u=function(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case z:case q:e="ENVMAP_TYPE_CUBE";break;case G:e="ENVMAP_TYPE_CUBE_UV"}return e}(n),h=function(t){let e="ENVMAP_MODE_REFLECTION";t.envMap&&t.envMapMode===q&&(e="ENVMAP_MODE_REFRACTION");return e}(n),c=function(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case 0:e="ENVMAP_BLENDING_MULTIPLY";break;case 1:e="ENVMAP_BLENDING_MIX";break;case 2:e="ENVMAP_BLENDING_ADD"}return e}(n),A=function(t){const e=t.envMapCubeUVHeight;if(null===e)return null;const n=Math.log2(e)-2,i=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:i,maxMip:n}}(n),d=function(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Sa).join("\n")}(n),p=function(t){const e=[];for(const n in t){const i=t[n];!1!==i&&e.push("#define "+n+" "+i)}return e.join("\n")}(s),f=r.createProgram();let m,g,y=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(m=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p].filter(Sa).join("\n"),m.length>0&&(m+="\n"),g=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p].filter(Sa).join("\n"),g.length>0&&(g+="\n")):(m=[Ia(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+h:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH","\tuniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Sa).join("\n"),g=[Ia(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.envMap?"#define "+h:"",n.envMap?"#define "+c:"",A?"#define CUBEUV_TEXEL_WIDTH "+A.texelWidth:"",A?"#define CUBEUV_TEXEL_HEIGHT "+A.texelHeight:"",A?"#define CUBEUV_MAX_MIP "+A.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?Er.tonemapping_pars_fragment:"",0!==n.toneMapping?_a("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Er.colorspace_pars_fragment,va("linearToOutputTexel",n.outputColorSpace),ba(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Sa).join("\n")),a=Ea(a),a=Ma(a,n),a=wa(a,n),o=Ea(o),o=Ma(o,n),o=wa(o,n),a=Pa(a),o=Pa(o),!0!==n.isRawShaderMaterial&&(y="#version 300 es\n",m=[d,"#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+m,g=["#define varying in",n.glslVersion===Ae?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===Ae?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+g);const v=y+m+a,_=y+g+o,x=ma(r,r.VERTEX_SHADER,v),b=ma(r,r.FRAGMENT_SHADER,_);function S(e){if(t.debug.checkShaderErrors){const n=r.getProgramInfoLog(f).trim(),i=r.getShaderInfoLog(x).trim(),s=r.getShaderInfoLog(b).trim();let a=!0,o=!0;if(!1===r.getProgramParameter(f,r.LINK_STATUS))if(a=!1,"function"==typeof t.debug.onShaderError)t.debug.onShaderError(r,f,x,b);else{const t=ya(r,x,"vertex"),i=ya(r,b,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(f,r.VALIDATE_STATUS)+"\n\nMaterial Name: "+e.name+"\nMaterial Type: "+e.type+"\n\nProgram Info Log: "+n+"\n"+t+"\n"+i)}else""!==n?console.warn("THREE.WebGLProgram: Program Info Log:",n):""!==i&&""!==s||(o=!1);o&&(e.diagnostics={runnable:a,programLog:n,vertexShader:{log:i,prefix:m},fragmentShader:{log:s,prefix:g}})}r.deleteShader(x),r.deleteShader(b),M=new fa(r,f),w=function(t,e){const n={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let r=0;r<i;r++){const i=t.getActiveAttrib(e,r),s=i.name;let a=1;i.type===t.FLOAT_MAT2&&(a=2),i.type===t.FLOAT_MAT3&&(a=3),i.type===t.FLOAT_MAT4&&(a=4),n[s]={type:i.type,location:t.getAttribLocation(e,s),locationSize:a}}return n}(r,f)}let M,w;r.attachShader(f,x),r.attachShader(f,b),void 0!==n.index0AttributeName?r.bindAttribLocation(f,0,n.index0AttributeName):!0===n.morphTargets&&r.bindAttribLocation(f,0,"position"),r.linkProgram(f),this.getUniforms=function(){return void 0===M&&S(this),M},this.getAttributes=function(){return void 0===w&&S(this),w};let T=!1===n.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===T&&(T=r.getProgramParameter(f,37297)),T},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(f),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=ga++,this.cacheKey=e,this.usedTimes=1,this.program=f,this.vertexShader=x,this.fragmentShader=b,this}let Ba=0;class Ua{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,n=t.fragmentShader,i=this._getShaderStage(e),r=this._getShaderStage(n),s=this._getShaderCacheForMaterial(t);return!1===s.has(i)&&(s.add(i),i.usedTimes++),!1===s.has(r)&&(s.add(r),r.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const t of e)t.usedTimes--,0===t.usedTimes&&this.shaderCache.delete(t.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let n=e.get(t);return void 0===n&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){const e=this.shaderCache;let n=e.get(t);return void 0===n&&(n=new Oa(t),e.set(t,n)),n}}class Oa{constructor(t){this.id=Ba++,this.code=t,this.usedTimes=0}}function Fa(t,e,n,i,r,s,a){const o=new Vn,l=new Ua,u=new Set,h=[],c=r.logarithmicDepthBuffer,A=r.reverseDepthBuffer,d=r.vertexTextures;let p=r.precision;const f={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function m(t){return u.add(t),0===t?"uv":`uv${t}`}return{getParameters:function(s,o,h,g,y){const v=g.fog,_=y.geometry,x=s.isMeshStandardMaterial?g.environment:null,b=(s.isMeshStandardMaterial?n:e).get(s.envMap||x),S=b&&b.mapping===G?b.image.height:null,M=f[s.type];null!==s.precision&&(p=r.getMaxPrecision(s.precision),p!==s.precision&&console.warn("THREE.WebGLProgram.getParameters:",s.precision,"not supported, using",p,"instead."));const w=_.morphAttributes.position||_.morphAttributes.normal||_.morphAttributes.color,T=void 0!==w?w.length:0;let E,C,R,N,P=0;if(void 0!==_.morphAttributes.position&&(P=1),void 0!==_.morphAttributes.normal&&(P=2),void 0!==_.morphAttributes.color&&(P=3),M){const t=Rr[M];E=t.vertexShader,C=t.fragmentShader}else E=s.vertexShader,C=s.fragmentShader,l.update(s),R=l.getVertexShaderID(s),N=l.getFragmentShaderID(s);const D=t.getRenderTarget(),I=!0===y.isInstancedMesh,L=!0===y.isBatchedMesh,B=!!s.map,U=!!s.matcap,O=!!b,F=!!s.aoMap,k=!!s.lightMap,z=!!s.bumpMap,q=!!s.normalMap,V=!!s.displacementMap,H=!!s.emissiveMap,j=!!s.metalnessMap,W=!!s.roughnessMap,X=s.anisotropy>0,Y=s.clearcoat>0,Q=s.dispersion>0,$=s.iridescence>0,Z=s.sheen>0,K=s.transmission>0,J=X&&!!s.anisotropyMap,tt=Y&&!!s.clearcoatMap,et=Y&&!!s.clearcoatNormalMap,nt=Y&&!!s.clearcoatRoughnessMap,it=$&&!!s.iridescenceMap,rt=$&&!!s.iridescenceThicknessMap,st=Z&&!!s.sheenColorMap,at=Z&&!!s.sheenRoughnessMap,ot=!!s.specularMap,lt=!!s.specularColorMap,ut=!!s.specularIntensityMap,ht=K&&!!s.transmissionMap,ct=K&&!!s.thicknessMap,At=!!s.gradientMap,dt=!!s.alphaMap,pt=s.alphaTest>0,ft=!!s.alphaHash,mt=!!s.extensions;let gt=0;s.toneMapped&&(null!==D&&!0!==D.isXRRenderTarget||(gt=t.toneMapping));const yt={shaderID:M,shaderType:s.type,shaderName:s.name,vertexShader:E,fragmentShader:C,defines:s.defines,customVertexShaderID:R,customFragmentShaderID:N,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:p,batching:L,batchingColor:L&&null!==y._colorsTexture,instancing:I,instancingColor:I&&null!==y.instanceColor,instancingMorph:I&&null!==y.morphTexture,supportsVertexTextures:d,outputColorSpace:null===D?t.outputColorSpace:!0===D.isXRRenderTarget?D.texture.colorSpace:Qt,alphaToCoverage:!!s.alphaToCoverage,map:B,matcap:U,envMap:O,envMapMode:O&&b.mapping,envMapCubeUVHeight:S,aoMap:F,lightMap:k,bumpMap:z,normalMap:q,displacementMap:d&&V,emissiveMap:H,normalMapObjectSpace:q&&1===s.normalMapType,normalMapTangentSpace:q&&0===s.normalMapType,metalnessMap:j,roughnessMap:W,anisotropy:X,anisotropyMap:J,clearcoat:Y,clearcoatMap:tt,clearcoatNormalMap:et,clearcoatRoughnessMap:nt,dispersion:Q,iridescence:$,iridescenceMap:it,iridescenceThicknessMap:rt,sheen:Z,sheenColorMap:st,sheenRoughnessMap:at,specularMap:ot,specularColorMap:lt,specularIntensityMap:ut,transmission:K,transmissionMap:ht,thicknessMap:ct,gradientMap:At,opaque:!1===s.transparent&&1===s.blending&&!1===s.alphaToCoverage,alphaMap:dt,alphaTest:pt,alphaHash:ft,combine:s.combine,mapUv:B&&m(s.map.channel),aoMapUv:F&&m(s.aoMap.channel),lightMapUv:k&&m(s.lightMap.channel),bumpMapUv:z&&m(s.bumpMap.channel),normalMapUv:q&&m(s.normalMap.channel),displacementMapUv:V&&m(s.displacementMap.channel),emissiveMapUv:H&&m(s.emissiveMap.channel),metalnessMapUv:j&&m(s.metalnessMap.channel),roughnessMapUv:W&&m(s.roughnessMap.channel),anisotropyMapUv:J&&m(s.anisotropyMap.channel),clearcoatMapUv:tt&&m(s.clearcoatMap.channel),clearcoatNormalMapUv:et&&m(s.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:nt&&m(s.clearcoatRoughnessMap.channel),iridescenceMapUv:it&&m(s.iridescenceMap.channel),iridescenceThicknessMapUv:rt&&m(s.iridescenceThicknessMap.channel),sheenColorMapUv:st&&m(s.sheenColorMap.channel),sheenRoughnessMapUv:at&&m(s.sheenRoughnessMap.channel),specularMapUv:ot&&m(s.specularMap.channel),specularColorMapUv:lt&&m(s.specularColorMap.channel),specularIntensityMapUv:ut&&m(s.specularIntensityMap.channel),transmissionMapUv:ht&&m(s.transmissionMap.channel),thicknessMapUv:ct&&m(s.thicknessMap.channel),alphaMapUv:dt&&m(s.alphaMap.channel),vertexTangents:!!_.attributes.tangent&&(q||X),vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!_.attributes.color&&4===_.attributes.color.itemSize,pointsUvs:!0===y.isPoints&&!!_.attributes.uv&&(B||dt),fog:!!v,useFog:!0===s.fog,fogExp2:!!v&&v.isFogExp2,flatShading:!0===s.flatShading,sizeAttenuation:!0===s.sizeAttenuation,logarithmicDepthBuffer:c,reverseDepthBuffer:A,skinning:!0===y.isSkinnedMesh,morphTargets:void 0!==_.morphAttributes.position,morphNormals:void 0!==_.morphAttributes.normal,morphColors:void 0!==_.morphAttributes.color,morphTargetsCount:T,morphTextureStride:P,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numLightProbes:o.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:s.dithering,shadowMapEnabled:t.shadowMap.enabled&&h.length>0,shadowMapType:t.shadowMap.type,toneMapping:gt,decodeVideoTexture:B&&!0===s.map.isVideoTexture&&ke.getTransfer(s.map.colorSpace)===Jt,premultipliedAlpha:s.premultipliedAlpha,doubleSided:2===s.side,flipSided:1===s.side,useDepthPacking:s.depthPacking>=0,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionClipCullDistance:mt&&!0===s.extensions.clipCullDistance&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(mt&&!0===s.extensions.multiDraw||L)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:s.customProgramCacheKey()};return yt.vertexUv1s=u.has(1),yt.vertexUv2s=u.has(2),yt.vertexUv3s=u.has(3),u.clear(),yt},getProgramCacheKey:function(e){const n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.customVertexShaderID),n.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)n.push(t),n.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(!function(t,e){t.push(e.precision),t.push(e.outputColorSpace),t.push(e.envMapMode),t.push(e.envMapCubeUVHeight),t.push(e.mapUv),t.push(e.alphaMapUv),t.push(e.lightMapUv),t.push(e.aoMapUv),t.push(e.bumpMapUv),t.push(e.normalMapUv),t.push(e.displacementMapUv),t.push(e.emissiveMapUv),t.push(e.metalnessMapUv),t.push(e.roughnessMapUv),t.push(e.anisotropyMapUv),t.push(e.clearcoatMapUv),t.push(e.clearcoatNormalMapUv),t.push(e.clearcoatRoughnessMapUv),t.push(e.iridescenceMapUv),t.push(e.iridescenceThicknessMapUv),t.push(e.sheenColorMapUv),t.push(e.sheenRoughnessMapUv),t.push(e.specularMapUv),t.push(e.specularColorMapUv),t.push(e.specularIntensityMapUv),t.push(e.transmissionMapUv),t.push(e.thicknessMapUv),t.push(e.combine),t.push(e.fogExp2),t.push(e.sizeAttenuation),t.push(e.morphTargetsCount),t.push(e.morphAttributeCount),t.push(e.numDirLights),t.push(e.numPointLights),t.push(e.numSpotLights),t.push(e.numSpotLightMaps),t.push(e.numHemiLights),t.push(e.numRectAreaLights),t.push(e.numDirLightShadows),t.push(e.numPointLightShadows),t.push(e.numSpotLightShadows),t.push(e.numSpotLightShadowsWithMaps),t.push(e.numLightProbes),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection),t.push(e.depthPacking)}(n,e),function(t,e){o.disableAll(),e.supportsVertexTextures&&o.enable(0);e.instancing&&o.enable(1);e.instancingColor&&o.enable(2);e.instancingMorph&&o.enable(3);e.matcap&&o.enable(4);e.envMap&&o.enable(5);e.normalMapObjectSpace&&o.enable(6);e.normalMapTangentSpace&&o.enable(7);e.clearcoat&&o.enable(8);e.iridescence&&o.enable(9);e.alphaTest&&o.enable(10);e.vertexColors&&o.enable(11);e.vertexAlphas&&o.enable(12);e.vertexUv1s&&o.enable(13);e.vertexUv2s&&o.enable(14);e.vertexUv3s&&o.enable(15);e.vertexTangents&&o.enable(16);e.anisotropy&&o.enable(17);e.alphaHash&&o.enable(18);e.batching&&o.enable(19);e.dispersion&&o.enable(20);e.batchingColor&&o.enable(21);t.push(o.mask),o.disableAll(),e.fog&&o.enable(0);e.useFog&&o.enable(1);e.flatShading&&o.enable(2);e.logarithmicDepthBuffer&&o.enable(3);e.reverseDepthBuffer&&o.enable(4);e.skinning&&o.enable(5);e.morphTargets&&o.enable(6);e.morphNormals&&o.enable(7);e.morphColors&&o.enable(8);e.premultipliedAlpha&&o.enable(9);e.shadowMapEnabled&&o.enable(10);e.doubleSided&&o.enable(11);e.flipSided&&o.enable(12);e.useDepthPacking&&o.enable(13);e.dithering&&o.enable(14);e.transmission&&o.enable(15);e.sheen&&o.enable(16);e.opaque&&o.enable(17);e.pointsUvs&&o.enable(18);e.decodeVideoTexture&&o.enable(19);e.alphaToCoverage&&o.enable(20);t.push(o.mask)}(n,e),n.push(t.outputColorSpace)),n.push(e.customProgramCacheKey),n.join()},getUniforms:function(t){const e=f[t.type];let n;if(e){const t=Rr[e];n=ar.clone(t.uniforms)}else n=t.uniforms;return n},acquireProgram:function(e,n){let i;for(let t=0,e=h.length;t<e;t++){const e=h[t];if(e.cacheKey===n){i=e,++i.usedTimes;break}}return void 0===i&&(i=new La(t,n,e,s),h.push(i)),i},releaseProgram:function(t){if(0==--t.usedTimes){const e=h.indexOf(t);h[e]=h[h.length-1],h.pop(),t.destroy()}},releaseShaderCache:function(t){l.remove(t)},programs:h,dispose:function(){l.dispose()}}}function ka(){let t=new WeakMap;return{has:function(e){return t.has(e)},get:function(e){let n=t.get(e);return void 0===n&&(n={},t.set(e,n)),n},remove:function(e){t.delete(e)},update:function(e,n,i){t.get(e)[n]=i},dispose:function(){t=new WeakMap}}}function za(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function qa(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Ga(){const t=[];let e=0;const n=[],i=[],r=[];function s(n,i,r,s,a,o){let l=t[e];return void 0===l?(l={id:n.id,object:n,geometry:i,material:r,groupOrder:s,renderOrder:n.renderOrder,z:a,group:o},t[e]=l):(l.id=n.id,l.object=n,l.geometry=i,l.material=r,l.groupOrder=s,l.renderOrder=n.renderOrder,l.z=a,l.group=o),e++,l}return{opaque:n,transmissive:i,transparent:r,init:function(){e=0,n.length=0,i.length=0,r.length=0},push:function(t,e,a,o,l,u){const h=s(t,e,a,o,l,u);a.transmission>0?i.push(h):!0===a.transparent?r.push(h):n.push(h)},unshift:function(t,e,a,o,l,u){const h=s(t,e,a,o,l,u);a.transmission>0?i.unshift(h):!0===a.transparent?r.unshift(h):n.unshift(h)},finish:function(){for(let n=e,i=t.length;n<i;n++){const e=t[n];if(null===e.id)break;e.id=null,e.object=null,e.geometry=null,e.material=null,e.group=null}},sort:function(t,e){n.length>1&&n.sort(t||za),i.length>1&&i.sort(e||qa),r.length>1&&r.sort(e||qa)}}}function Va(){let t=new WeakMap;return{get:function(e,n){const i=t.get(e);let r;return void 0===i?(r=new Ga,t.set(e,[r])):n>=i.length?(r=new Ga,i.push(r)):r=i[n],r},dispose:function(){t=new WeakMap}}}function Ha(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new en,color:new Mi};break;case"SpotLight":n={position:new en,direction:new en,color:new Mi,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new en,color:new Mi,distance:0,decay:0};break;case"HemisphereLight":n={direction:new en,skyColor:new Mi,groundColor:new Mi};break;case"RectAreaLight":n={color:new Mi,position:new en,halfWidth:new en,halfHeight:new en}}return t[e.id]=n,n}}}let ja=0;function Wa(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function Xa(t){const e=new Ha,n=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ee};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ee,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let t=0;t<9;t++)i.probe.push(new en);const r=new en,s=new Dn,a=new Dn;return{setup:function(r){let s=0,a=0,o=0;for(let t=0;t<9;t++)i.probe[t].set(0,0,0);let l=0,u=0,h=0,c=0,A=0,d=0,p=0,f=0,m=0,g=0,y=0;r.sort(Wa);for(let t=0,v=r.length;t<v;t++){const v=r[t],_=v.color,x=v.intensity,b=v.distance,S=v.shadow&&v.shadow.map?v.shadow.map.texture:null;if(v.isAmbientLight)s+=_.r*x,a+=_.g*x,o+=_.b*x;else if(v.isLightProbe){for(let t=0;t<9;t++)i.probe[t].addScaledVector(v.sh.coefficients[t],x);y++}else if(v.isDirectionalLight){const t=e.get(v);if(t.color.copy(v.color).multiplyScalar(v.intensity),v.castShadow){const t=v.shadow,e=n.get(v);e.shadowIntensity=t.intensity,e.shadowBias=t.bias,e.shadowNormalBias=t.normalBias,e.shadowRadius=t.radius,e.shadowMapSize=t.mapSize,i.directionalShadow[l]=e,i.directionalShadowMap[l]=S,i.directionalShadowMatrix[l]=v.shadow.matrix,d++}i.directional[l]=t,l++}else if(v.isSpotLight){const t=e.get(v);t.position.setFromMatrixPosition(v.matrixWorld),t.color.copy(_).multiplyScalar(x),t.distance=b,t.coneCos=Math.cos(v.angle),t.penumbraCos=Math.cos(v.angle*(1-v.penumbra)),t.decay=v.decay,i.spot[h]=t;const r=v.shadow;if(v.map&&(i.spotLightMap[m]=v.map,m++,r.updateMatrices(v),v.castShadow&&g++),i.spotLightMatrix[h]=r.matrix,v.castShadow){const t=n.get(v);t.shadowIntensity=r.intensity,t.shadowBias=r.bias,t.shadowNormalBias=r.normalBias,t.shadowRadius=r.radius,t.shadowMapSize=r.mapSize,i.spotShadow[h]=t,i.spotShadowMap[h]=S,f++}h++}else if(v.isRectAreaLight){const t=e.get(v);t.color.copy(_).multiplyScalar(x),t.halfWidth.set(.5*v.width,0,0),t.halfHeight.set(0,.5*v.height,0),i.rectArea[c]=t,c++}else if(v.isPointLight){const t=e.get(v);if(t.color.copy(v.color).multiplyScalar(v.intensity),t.distance=v.distance,t.decay=v.decay,v.castShadow){const t=v.shadow,e=n.get(v);e.shadowIntensity=t.intensity,e.shadowBias=t.bias,e.shadowNormalBias=t.normalBias,e.shadowRadius=t.radius,e.shadowMapSize=t.mapSize,e.shadowCameraNear=t.camera.near,e.shadowCameraFar=t.camera.far,i.pointShadow[u]=e,i.pointShadowMap[u]=S,i.pointShadowMatrix[u]=v.shadow.matrix,p++}i.point[u]=t,u++}else if(v.isHemisphereLight){const t=e.get(v);t.skyColor.copy(v.color).multiplyScalar(x),t.groundColor.copy(v.groundColor).multiplyScalar(x),i.hemi[A]=t,A++}}c>0&&(!0===t.has("OES_texture_float_linear")?(i.rectAreaLTC1=Cr.LTC_FLOAT_1,i.rectAreaLTC2=Cr.LTC_FLOAT_2):(i.rectAreaLTC1=Cr.LTC_HALF_1,i.rectAreaLTC2=Cr.LTC_HALF_2)),i.ambient[0]=s,i.ambient[1]=a,i.ambient[2]=o;const v=i.hash;v.directionalLength===l&&v.pointLength===u&&v.spotLength===h&&v.rectAreaLength===c&&v.hemiLength===A&&v.numDirectionalShadows===d&&v.numPointShadows===p&&v.numSpotShadows===f&&v.numSpotMaps===m&&v.numLightProbes===y||(i.directional.length=l,i.spot.length=h,i.rectArea.length=c,i.point.length=u,i.hemi.length=A,i.directionalShadow.length=d,i.directionalShadowMap.length=d,i.pointShadow.length=p,i.pointShadowMap.length=p,i.spotShadow.length=f,i.spotShadowMap.length=f,i.directionalShadowMatrix.length=d,i.pointShadowMatrix.length=p,i.spotLightMatrix.length=f+m-g,i.spotLightMap.length=m,i.numSpotLightShadowsWithMaps=g,i.numLightProbes=y,v.directionalLength=l,v.pointLength=u,v.spotLength=h,v.rectAreaLength=c,v.hemiLength=A,v.numDirectionalShadows=d,v.numPointShadows=p,v.numSpotShadows=f,v.numSpotMaps=m,v.numLightProbes=y,i.version=ja++)},setupView:function(t,e){let n=0,o=0,l=0,u=0,h=0;const c=e.matrixWorldInverse;for(let e=0,A=t.length;e<A;e++){const A=t[e];if(A.isDirectionalLight){const t=i.directional[n];t.direction.setFromMatrixPosition(A.matrixWorld),r.setFromMatrixPosition(A.target.matrixWorld),t.direction.sub(r),t.direction.transformDirection(c),n++}else if(A.isSpotLight){const t=i.spot[l];t.position.setFromMatrixPosition(A.matrixWorld),t.position.applyMatrix4(c),t.direction.setFromMatrixPosition(A.matrixWorld),r.setFromMatrixPosition(A.target.matrixWorld),t.direction.sub(r),t.direction.transformDirection(c),l++}else if(A.isRectAreaLight){const t=i.rectArea[u];t.position.setFromMatrixPosition(A.matrixWorld),t.position.applyMatrix4(c),a.identity(),s.copy(A.matrixWorld),s.premultiply(c),a.extractRotation(s),t.halfWidth.set(.5*A.width,0,0),t.halfHeight.set(0,.5*A.height,0),t.halfWidth.applyMatrix4(a),t.halfHeight.applyMatrix4(a),u++}else if(A.isPointLight){const t=i.point[o];t.position.setFromMatrixPosition(A.matrixWorld),t.position.applyMatrix4(c),o++}else if(A.isHemisphereLight){const t=i.hemi[h];t.direction.setFromMatrixPosition(A.matrixWorld),t.direction.transformDirection(c),h++}}},state:i}}function Ya(t){const e=new Xa(t),n=[],i=[];const r={lightsArray:n,shadowsArray:i,camera:null,lights:e,transmissionRenderTarget:{}};return{init:function(t){r.camera=t,n.length=0,i.length=0},state:r,setupLights:function(){e.setup(n)},setupLightsView:function(t){e.setupView(n,t)},pushLight:function(t){n.push(t)},pushShadow:function(t){i.push(t)}}}function Qa(t){let e=new WeakMap;return{get:function(n,i=0){const r=e.get(n);let s;return void 0===r?(s=new Ya(t),e.set(n,[s])):i>=r.length?(s=new Ya(t),r.push(s)):s=r[i],s},dispose:function(){e=new WeakMap}}}class $a extends Ei{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class Za extends Ei{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}function Ka(t,e,n){let i=new Sr;const r=new Ee,s=new Ee,a=new Qe,o=new $a({depthPacking:3201}),l=new Za,u={},h=n.maxTextureSize,p={[c]:1,[A]:0,[d]:2},f=new or({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ee},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),m=f.clone();m.defines.HORIZONTAL_PASS=1;const g=new Gi;g.setAttribute("position",new Pi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const y=new tr(g,f),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let _=this.type;function x(n,i){const s=e.update(y);f.defines.VSM_SAMPLES!==n.blurSamples&&(f.defines.VSM_SAMPLES=n.blurSamples,m.defines.VSM_SAMPLES=n.blurSamples,f.needsUpdate=!0,m.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new Ze(r.x,r.y)),f.uniforms.shadow_pass.value=n.map.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(i,null,s,f,y,null),m.uniforms.shadow_pass.value=n.mapPass.texture,m.uniforms.resolution.value=n.mapSize,m.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(i,null,s,m,y,null)}function b(e,n,i,r){let s=null;const a=!0===i.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(void 0!==a)s=a;else if(s=!0===i.isPointLight?l:o,t.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0){const t=s.uuid,e=n.uuid;let i=u[t];void 0===i&&(i={},u[t]=i);let r=i[e];void 0===r&&(r=s.clone(),i[e]=r,n.addEventListener("dispose",M)),s=r}if(s.visible=n.visible,s.wireframe=n.wireframe,s.side=3===r?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:p[n.side],s.alphaMap=n.alphaMap,s.alphaTest=n.alphaTest,s.map=n.map,s.clipShadows=n.clipShadows,s.clippingPlanes=n.clippingPlanes,s.clipIntersection=n.clipIntersection,s.displacementMap=n.displacementMap,s.displacementScale=n.displacementScale,s.displacementBias=n.displacementBias,s.wireframeLinewidth=n.wireframeLinewidth,s.linewidth=n.linewidth,!0===i.isPointLight&&!0===s.isMeshDistanceMaterial){t.properties.get(s).light=i}return s}function S(n,r,s,a,o){if(!1===n.visible)return;if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===o)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,n.matrixWorld);const i=e.update(n),l=n.material;if(Array.isArray(l)){const e=i.groups;for(let u=0,h=e.length;u<h;u++){const h=e[u],c=l[h.materialIndex];if(c&&c.visible){const e=b(n,c,a,o);n.onBeforeShadow(t,n,r,s,i,e,h),t.renderBufferDirect(s,null,i,e,n,h),n.onAfterShadow(t,n,r,s,i,e,h)}}}else if(l.visible){const e=b(n,l,a,o);n.onBeforeShadow(t,n,r,s,i,e,null),t.renderBufferDirect(s,null,i,e,n,null),n.onAfterShadow(t,n,r,s,i,e,null)}}const l=n.children;for(let t=0,e=l.length;t<e;t++)S(l[t],r,s,a,o)}function M(t){t.target.removeEventListener("dispose",M);for(const e in u){const n=u[e],i=t.target.uuid;if(i in n){n[i].dispose(),delete n[i]}}}this.render=function(e,n,o){if(!1===v.enabled)return;if(!1===v.autoUpdate&&!1===v.needsUpdate)return;if(0===e.length)return;const l=t.getRenderTarget(),u=t.getActiveCubeFace(),c=t.getActiveMipmapLevel(),A=t.state;A.setBlending(0),A.buffers.color.setClear(1,1,1,1),A.buffers.depth.setTest(!0),A.setScissorTest(!1);const d=3!==_&&3===this.type,p=3===_&&3!==this.type;for(let l=0,u=e.length;l<u;l++){const u=e[l],c=u.shadow;if(void 0===c){console.warn("THREE.WebGLShadowMap:",u,"has no shadow.");continue}if(!1===c.autoUpdate&&!1===c.needsUpdate)continue;r.copy(c.mapSize);const f=c.getFrameExtents();if(r.multiply(f),s.copy(c.mapSize),(r.x>h||r.y>h)&&(r.x>h&&(s.x=Math.floor(h/f.x),r.x=s.x*f.x,c.mapSize.x=s.x),r.y>h&&(s.y=Math.floor(h/f.y),r.y=s.y*f.y,c.mapSize.y=s.y)),null===c.map||!0===d||!0===p){const t=3!==this.type?{minFilter:W,magFilter:W}:{};null!==c.map&&c.map.dispose(),c.map=new Ze(r.x,r.y,t),c.map.texture.name=u.name+".shadowMap",c.camera.updateProjectionMatrix()}t.setRenderTarget(c.map),t.clear();const m=c.getViewportCount();for(let t=0;t<m;t++){const e=c.getViewport(t);a.set(s.x*e.x,s.y*e.y,s.x*e.z,s.y*e.w),A.viewport(a),c.updateMatrices(u,t),i=c.getFrustum(),S(n,o,c.camera,u,this.type)}!0!==c.isPointLightShadow&&3===this.type&&x(c,o),c.needsUpdate=!1}_=this.type,v.needsUpdate=!1,t.setRenderTarget(l,u,c)}}const Ja={[D]:1,[L]:6,[U]:7,[B]:5,[I]:0,[F]:2,[k]:4,[O]:3};function to(t){const e=new function(){let e=!1;const n=new Qe;let i=null;const r=new Qe(0,0,0,0);return{setMask:function(n){i===n||e||(t.colorMask(n,n,n,n),i=n)},setLocked:function(t){e=t},setClear:function(e,i,s,a,o){!0===o&&(e*=a,i*=a,s*=a),n.set(e,i,s,a),!1===r.equals(n)&&(t.clearColor(e,i,s,a),r.copy(n))},reset:function(){e=!1,i=null,r.set(-1,0,0,0)}}},n=new function(){let e=!1,n=!1,i=null,r=null,s=null;return{setReversed:function(t){n=t},setTest:function(e){e?it(t.DEPTH_TEST):rt(t.DEPTH_TEST)},setMask:function(n){i===n||e||(t.depthMask(n),i=n)},setFunc:function(e){if(n&&(e=Ja[e]),r!==e){switch(e){case 0:t.depthFunc(t.NEVER);break;case 1:t.depthFunc(t.ALWAYS);break;case 2:t.depthFunc(t.LESS);break;case 3:default:t.depthFunc(t.LEQUAL);break;case 4:t.depthFunc(t.EQUAL);break;case 5:t.depthFunc(t.GEQUAL);break;case 6:t.depthFunc(t.GREATER);break;case 7:t.depthFunc(t.NOTEQUAL)}r=e}},setLocked:function(t){e=t},setClear:function(e){s!==e&&(t.clearDepth(e),s=e)},reset:function(){e=!1,i=null,r=null,s=null}}},i=new function(){let e=!1,n=null,i=null,r=null,s=null,a=null,o=null,l=null,u=null;return{setTest:function(n){e||(n?it(t.STENCIL_TEST):rt(t.STENCIL_TEST))},setMask:function(i){n===i||e||(t.stencilMask(i),n=i)},setFunc:function(e,n,a){i===e&&r===n&&s===a||(t.stencilFunc(e,n,a),i=e,r=n,s=a)},setOp:function(e,n,i){a===e&&o===n&&l===i||(t.stencilOp(e,n,i),a=e,o=n,l=i)},setLocked:function(t){e=t},setClear:function(e){u!==e&&(t.clearStencil(e),u=e)},reset:function(){e=!1,n=null,i=null,r=null,s=null,a=null,o=null,l=null,u=null}}},r=new WeakMap,s=new WeakMap;let a={},o={},l=new WeakMap,u=[],h=null,c=!1,A=null,d=null,D=null,I=null,L=null,B=null,U=null,O=new Mi(0,0,0),F=0,k=!1,z=null,q=null,G=null,V=null,H=null;const j=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let W=!1,X=0;const Y=t.getParameter(t.VERSION);-1!==Y.indexOf("WebGL")?(X=parseFloat(/^WebGL (\d)/.exec(Y)[1]),W=X>=1):-1!==Y.indexOf("OpenGL ES")&&(X=parseFloat(/^OpenGL ES (\d)/.exec(Y)[1]),W=X>=2);let Q=null,$={};const Z=t.getParameter(t.SCISSOR_BOX),K=t.getParameter(t.VIEWPORT),J=(new Qe).fromArray(Z),tt=(new Qe).fromArray(K);function et(e,n,i,r){const s=new Uint8Array(4),a=t.createTexture();t.bindTexture(e,a),t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let a=0;a<i;a++)e===t.TEXTURE_3D||e===t.TEXTURE_2D_ARRAY?t.texImage3D(n,0,t.RGBA,1,1,r,0,t.RGBA,t.UNSIGNED_BYTE,s):t.texImage2D(n+a,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,s);return a}const nt={};function it(e){!0!==a[e]&&(t.enable(e),a[e]=!0)}function rt(e){!1!==a[e]&&(t.disable(e),a[e]=!1)}nt[t.TEXTURE_2D]=et(t.TEXTURE_2D,t.TEXTURE_2D,1),nt[t.TEXTURE_CUBE_MAP]=et(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),nt[t.TEXTURE_2D_ARRAY]=et(t.TEXTURE_2D_ARRAY,t.TEXTURE_2D_ARRAY,1,1),nt[t.TEXTURE_3D]=et(t.TEXTURE_3D,t.TEXTURE_3D,1,1),e.setClear(0,0,0,1),n.setClear(1),i.setClear(0),it(t.DEPTH_TEST),n.setFunc(3),lt(!1),ut(1),it(t.CULL_FACE),ot(0);const st={[p]:t.FUNC_ADD,[f]:t.FUNC_SUBTRACT,[m]:t.FUNC_REVERSE_SUBTRACT};st[103]=t.MIN,st[104]=t.MAX;const at={[g]:t.ZERO,[y]:t.ONE,[v]:t.SRC_COLOR,[x]:t.SRC_ALPHA,[E]:t.SRC_ALPHA_SATURATE,[w]:t.DST_COLOR,[S]:t.DST_ALPHA,[_]:t.ONE_MINUS_SRC_COLOR,[b]:t.ONE_MINUS_SRC_ALPHA,[T]:t.ONE_MINUS_DST_COLOR,[M]:t.ONE_MINUS_DST_ALPHA,[C]:t.CONSTANT_COLOR,[R]:t.ONE_MINUS_CONSTANT_COLOR,[N]:t.CONSTANT_ALPHA,[P]:t.ONE_MINUS_CONSTANT_ALPHA};function ot(e,n,i,r,s,a,o,l,u,h){if(0!==e){if(!1===c&&(it(t.BLEND),c=!0),5===e)s=s||n,a=a||i,o=o||r,n===d&&s===L||(t.blendEquationSeparate(st[n],st[s]),d=n,L=s),i===D&&r===I&&a===B&&o===U||(t.blendFuncSeparate(at[i],at[r],at[a],at[o]),D=i,I=r,B=a,U=o),!1!==l.equals(O)&&u===F||(t.blendColor(l.r,l.g,l.b,u),O.copy(l),F=u),A=e,k=!1;else if(e!==A||h!==k){if(d===p&&L===p||(t.blendEquation(t.FUNC_ADD),d=p,L=p),h)switch(e){case 1:t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case 2:t.blendFunc(t.ONE,t.ONE);break;case 3:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case 4:t.blendFuncSeparate(t.ZERO,t.SRC_COLOR,t.ZERO,t.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case 1:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case 2:t.blendFunc(t.SRC_ALPHA,t.ONE);break;case 3:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case 4:t.blendFunc(t.ZERO,t.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}D=null,I=null,B=null,U=null,O.set(0,0,0),F=0,A=e,k=h}}else!0===c&&(rt(t.BLEND),c=!1)}function lt(e){z!==e&&(e?t.frontFace(t.CW):t.frontFace(t.CCW),z=e)}function ut(e){0!==e?(it(t.CULL_FACE),e!==q&&(1===e?t.cullFace(t.BACK):2===e?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):rt(t.CULL_FACE),q=e}function ht(e,n,i){e?(it(t.POLYGON_OFFSET_FILL),V===n&&H===i||(t.polygonOffset(n,i),V=n,H=i)):rt(t.POLYGON_OFFSET_FILL)}return{buffers:{color:e,depth:n,stencil:i},enable:it,disable:rt,bindFramebuffer:function(e,n){return o[e]!==n&&(t.bindFramebuffer(e,n),o[e]=n,e===t.DRAW_FRAMEBUFFER&&(o[t.FRAMEBUFFER]=n),e===t.FRAMEBUFFER&&(o[t.DRAW_FRAMEBUFFER]=n),!0)},drawBuffers:function(e,n){let i=u,r=!1;if(e){i=l.get(n),void 0===i&&(i=[],l.set(n,i));const s=e.textures;if(i.length!==s.length||i[0]!==t.COLOR_ATTACHMENT0){for(let e=0,n=s.length;e<n;e++)i[e]=t.COLOR_ATTACHMENT0+e;i.length=s.length,r=!0}}else i[0]!==t.BACK&&(i[0]=t.BACK,r=!0);r&&t.drawBuffers(i)},useProgram:function(e){return h!==e&&(t.useProgram(e),h=e,!0)},setBlending:ot,setMaterial:function(r,s){2===r.side?rt(t.CULL_FACE):it(t.CULL_FACE);let a=1===r.side;s&&(a=!a),lt(a),1===r.blending&&!1===r.transparent?ot(0):ot(r.blending,r.blendEquation,r.blendSrc,r.blendDst,r.blendEquationAlpha,r.blendSrcAlpha,r.blendDstAlpha,r.blendColor,r.blendAlpha,r.premultipliedAlpha),n.setFunc(r.depthFunc),n.setTest(r.depthTest),n.setMask(r.depthWrite),e.setMask(r.colorWrite);const o=r.stencilWrite;i.setTest(o),o&&(i.setMask(r.stencilWriteMask),i.setFunc(r.stencilFunc,r.stencilRef,r.stencilFuncMask),i.setOp(r.stencilFail,r.stencilZFail,r.stencilZPass)),ht(r.polygonOffset,r.polygonOffsetFactor,r.polygonOffsetUnits),!0===r.alphaToCoverage?it(t.SAMPLE_ALPHA_TO_COVERAGE):rt(t.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:lt,setCullFace:ut,setLineWidth:function(e){e!==G&&(W&&t.lineWidth(e),G=e)},setPolygonOffset:ht,setScissorTest:function(e){e?it(t.SCISSOR_TEST):rt(t.SCISSOR_TEST)},activeTexture:function(e){void 0===e&&(e=t.TEXTURE0+j-1),Q!==e&&(t.activeTexture(e),Q=e)},bindTexture:function(e,n,i){void 0===i&&(i=null===Q?t.TEXTURE0+j-1:Q);let r=$[i];void 0===r&&(r={type:void 0,texture:void 0},$[i]=r),r.type===e&&r.texture===n||(Q!==i&&(t.activeTexture(i),Q=i),t.bindTexture(e,n||nt[e]),r.type=e,r.texture=n)},unbindTexture:function(){const e=$[Q];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexImage3D:function(){try{t.compressedTexImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{t.texImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},updateUBOMapping:function(e,n){let i=s.get(n);void 0===i&&(i=new WeakMap,s.set(n,i));let r=i.get(e);void 0===r&&(r=t.getUniformBlockIndex(n,e.name),i.set(e,r))},uniformBlockBinding:function(e,n){const i=s.get(n).get(e);r.get(n)!==i&&(t.uniformBlockBinding(n,i,e.__bindingPointIndex),r.set(n,i))},texStorage2D:function(){try{t.texStorage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texStorage3D:function(){try{t.texStorage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage2D:function(){try{t.texSubImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage3D:function(){try{t.texSubImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage2D:function(){try{t.compressedTexSubImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage3D:function(){try{t.compressedTexSubImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(e){!1===J.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),J.copy(e))},viewport:function(e){!1===tt.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),tt.copy(e))},reset:function(){t.disable(t.BLEND),t.disable(t.CULL_FACE),t.disable(t.DEPTH_TEST),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SCISSOR_TEST),t.disable(t.STENCIL_TEST),t.disable(t.SAMPLE_ALPHA_TO_COVERAGE),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ZERO),t.blendFuncSeparate(t.ONE,t.ZERO,t.ONE,t.ZERO),t.blendColor(0,0,0,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(t.LESS),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(t.ALWAYS,0,4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.clearStencil(0),t.cullFace(t.BACK),t.frontFace(t.CCW),t.polygonOffset(0,0),t.activeTexture(t.TEXTURE0),t.bindFramebuffer(t.FRAMEBUFFER,null),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),t.bindFramebuffer(t.READ_FRAMEBUFFER,null),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),a={},Q=null,$={},o={},l=new WeakMap,u=[],h=null,c=!1,A=null,d=null,D=null,I=null,L=null,B=null,U=null,O=new Mi(0,0,0),F=0,k=!1,z=null,q=null,G=null,V=null,H=null,J.set(0,0,t.canvas.width,t.canvas.height),tt.set(0,0,t.canvas.width,t.canvas.height),e.reset(),n.reset(),i.reset()}}}function eo(t,e,n,i){const r=function(t){switch(t){case K:case J:return{byteLength:1,components:1};case et:case tt:case st:return{byteLength:2,components:1};case at:case ot:return{byteLength:2,components:4};case it:case nt:case rt:return{byteLength:4,components:1};case ut:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${t}.`)}(i);switch(n){case 1021:case 1024:return t*e;case 1025:return t*e*2;case 1028:case dt:return t*e/r.components*r.byteLength;case 1030:case pt:return t*e*2/r.components*r.byteLength;case 1022:return t*e*3/r.components*r.byteLength;case ht:case ft:return t*e*4/r.components*r.byteLength;case mt:case gt:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case yt:case vt:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case xt:case St:return Math.max(t,16)*Math.max(e,8)/4;case _t:case bt:return Math.max(t,8)*Math.max(e,8)/2;case Mt:case wt:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case Tt:case Et:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case Ct:return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16;case Rt:return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16;case Nt:return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16;case Pt:return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16;case Dt:return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16;case It:return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16;case Lt:return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16;case Bt:return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16;case Ut:return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16;case Ot:return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16;case Ft:return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16;case kt:return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16;case zt:return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16;case qt:case Gt:case Vt:return Math.ceil(t/4)*Math.ceil(e/4)*16;case 36283:case Ht:return Math.ceil(t/4)*Math.ceil(e/4)*8;case jt:case Wt:return Math.ceil(t/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${n} format.`)}function no(t,e,n,i,r,s,a){const o=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),u=new Ee,h=new WeakMap;let c;const A=new WeakMap;let d=!1;try{d="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function p(t,e){return d?new OffscreenCanvas(t,e):Pe("canvas")}function f(t,e,n){let i=1;const r=z(t);if((r.width>n||r.height>n)&&(i=n/Math.max(r.width,r.height)),i<1){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof VideoFrame&&t instanceof VideoFrame){const n=Math.floor(i*r.width),s=Math.floor(i*r.height);void 0===c&&(c=p(n,s));const a=e?p(n,s):c;a.width=n,a.height=s;return a.getContext("2d").drawImage(t,0,0,n,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+r.width+"x"+r.height+") to ("+n+"x"+s+")."),a}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+r.width+"x"+r.height+")."),t}return t}function m(t){return t.generateMipmaps&&t.minFilter!==W&&t.minFilter!==Q}function g(e){t.generateMipmap(e)}function y(n,i,r,s,a=!1){if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let o=i;if(i===t.RED&&(r===t.FLOAT&&(o=t.R32F),r===t.HALF_FLOAT&&(o=t.R16F),r===t.UNSIGNED_BYTE&&(o=t.R8)),i===t.RED_INTEGER&&(r===t.UNSIGNED_BYTE&&(o=t.R8UI),r===t.UNSIGNED_SHORT&&(o=t.R16UI),r===t.UNSIGNED_INT&&(o=t.R32UI),r===t.BYTE&&(o=t.R8I),r===t.SHORT&&(o=t.R16I),r===t.INT&&(o=t.R32I)),i===t.RG&&(r===t.FLOAT&&(o=t.RG32F),r===t.HALF_FLOAT&&(o=t.RG16F),r===t.UNSIGNED_BYTE&&(o=t.RG8)),i===t.RG_INTEGER&&(r===t.UNSIGNED_BYTE&&(o=t.RG8UI),r===t.UNSIGNED_SHORT&&(o=t.RG16UI),r===t.UNSIGNED_INT&&(o=t.RG32UI),r===t.BYTE&&(o=t.RG8I),r===t.SHORT&&(o=t.RG16I),r===t.INT&&(o=t.RG32I)),i===t.RGB_INTEGER&&(r===t.UNSIGNED_BYTE&&(o=t.RGB8UI),r===t.UNSIGNED_SHORT&&(o=t.RGB16UI),r===t.UNSIGNED_INT&&(o=t.RGB32UI),r===t.BYTE&&(o=t.RGB8I),r===t.SHORT&&(o=t.RGB16I),r===t.INT&&(o=t.RGB32I)),i===t.RGBA_INTEGER&&(r===t.UNSIGNED_BYTE&&(o=t.RGBA8UI),r===t.UNSIGNED_SHORT&&(o=t.RGBA16UI),r===t.UNSIGNED_INT&&(o=t.RGBA32UI),r===t.BYTE&&(o=t.RGBA8I),r===t.SHORT&&(o=t.RGBA16I),r===t.INT&&(o=t.RGBA32I)),i===t.RGB&&r===t.UNSIGNED_INT_5_9_9_9_REV&&(o=t.RGB9_E5),i===t.RGBA){const e=a?Kt:ke.getTransfer(s);r===t.FLOAT&&(o=t.RGBA32F),r===t.HALF_FLOAT&&(o=t.RGBA16F),r===t.UNSIGNED_BYTE&&(o=e===Jt?t.SRGB8_ALPHA8:t.RGBA8),r===t.UNSIGNED_SHORT_4_4_4_4&&(o=t.RGBA4),r===t.UNSIGNED_SHORT_5_5_5_1&&(o=t.RGB5_A1)}return o!==t.R16F&&o!==t.R32F&&o!==t.RG16F&&o!==t.RG32F&&o!==t.RGBA16F&&o!==t.RGBA32F||e.get("EXT_color_buffer_float"),o}function v(e,n){let i;return e?null===n||n===it||n===lt?i=t.DEPTH24_STENCIL8:n===rt?i=t.DEPTH32F_STENCIL8:n===et&&(i=t.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):null===n||n===it||n===lt?i=t.DEPTH_COMPONENT24:n===rt?i=t.DEPTH_COMPONENT32F:n===et&&(i=t.DEPTH_COMPONENT16),i}function _(t,e){return!0===m(t)||t.isFramebufferTexture&&t.minFilter!==W&&t.minFilter!==Q?Math.log2(Math.max(e.width,e.height))+1:void 0!==t.mipmaps&&t.mipmaps.length>0?t.mipmaps.length:t.isCompressedTexture&&Array.isArray(t.image)?e.mipmaps.length:1}function x(t){const e=t.target;e.removeEventListener("dispose",x),function(t){const e=i.get(t);if(void 0===e.__webglInit)return;const n=t.source,r=A.get(n);if(r){const i=r[e.__cacheKey];i.usedTimes--,0===i.usedTimes&&S(t),0===Object.keys(r).length&&A.delete(n)}i.remove(t)}(e),e.isVideoTexture&&h.delete(e)}function b(e){const n=e.target;n.removeEventListener("dispose",b),function(e){const n=i.get(e);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++){if(Array.isArray(n.__webglFramebuffer[e]))for(let i=0;i<n.__webglFramebuffer[e].length;i++)t.deleteFramebuffer(n.__webglFramebuffer[e][i]);else t.deleteFramebuffer(n.__webglFramebuffer[e]);n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[e])}else{if(Array.isArray(n.__webglFramebuffer))for(let e=0;e<n.__webglFramebuffer.length;e++)t.deleteFramebuffer(n.__webglFramebuffer[e]);else t.deleteFramebuffer(n.__webglFramebuffer);if(n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&t.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer)for(let e=0;e<n.__webglColorRenderbuffer.length;e++)n.__webglColorRenderbuffer[e]&&t.deleteRenderbuffer(n.__webglColorRenderbuffer[e]);n.__webglDepthRenderbuffer&&t.deleteRenderbuffer(n.__webglDepthRenderbuffer)}const r=e.textures;for(let e=0,n=r.length;e<n;e++){const n=i.get(r[e]);n.__webglTexture&&(t.deleteTexture(n.__webglTexture),a.memory.textures--),i.remove(r[e])}i.remove(e)}(n)}function S(e){const n=i.get(e);t.deleteTexture(n.__webglTexture);const r=e.source;delete A.get(r)[n.__cacheKey],a.memory.textures--}let M=0;function w(e,r){const s=i.get(e);if(e.isVideoTexture&&function(t){const e=a.render.frame;h.get(t)!==e&&(h.set(t,e),t.update())}(e),!1===e.isRenderTargetTexture&&e.version>0&&s.__version!==e.version){const t=e.image;if(null===t)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==t.complete)return void P(s,e,r);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.bindTexture(t.TEXTURE_2D,s.__webglTexture,t.TEXTURE0+r)}const T={[V]:t.REPEAT,[H]:t.CLAMP_TO_EDGE,[j]:t.MIRRORED_REPEAT},E={[W]:t.NEAREST,[X]:t.NEAREST_MIPMAP_NEAREST,[Y]:t.NEAREST_MIPMAP_LINEAR,[Q]:t.LINEAR,[$]:t.LINEAR_MIPMAP_NEAREST,[Z]:t.LINEAR_MIPMAP_LINEAR},C={[ie]:t.NEVER,[he]:t.ALWAYS,[re]:t.LESS,[ae]:t.LEQUAL,[se]:t.EQUAL,[ue]:t.GEQUAL,[oe]:t.GREATER,[le]:t.NOTEQUAL};function R(n,s){if(s.type!==rt||!1!==e.has("OES_texture_float_linear")||s.magFilter!==Q&&s.magFilter!==$&&s.magFilter!==Y&&s.magFilter!==Z&&s.minFilter!==Q&&s.minFilter!==$&&s.minFilter!==Y&&s.minFilter!==Z||console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri(n,t.TEXTURE_WRAP_S,T[s.wrapS]),t.texParameteri(n,t.TEXTURE_WRAP_T,T[s.wrapT]),n!==t.TEXTURE_3D&&n!==t.TEXTURE_2D_ARRAY||t.texParameteri(n,t.TEXTURE_WRAP_R,T[s.wrapR]),t.texParameteri(n,t.TEXTURE_MAG_FILTER,E[s.magFilter]),t.texParameteri(n,t.TEXTURE_MIN_FILTER,E[s.minFilter]),s.compareFunction&&(t.texParameteri(n,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(n,t.TEXTURE_COMPARE_FUNC,C[s.compareFunction])),!0===e.has("EXT_texture_filter_anisotropic")){if(s.magFilter===W)return;if(s.minFilter!==Y&&s.minFilter!==Z)return;if(s.type===rt&&!1===e.has("OES_texture_float_linear"))return;if(s.anisotropy>1||i.get(s).__currentAnisotropy){const a=e.get("EXT_texture_filter_anisotropic");t.texParameterf(n,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,r.getMaxAnisotropy())),i.get(s).__currentAnisotropy=s.anisotropy}}}function N(e,n){let i=!1;void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",x));const r=n.source;let s=A.get(r);void 0===s&&(s={},A.set(r,s));const o=function(t){const e=[];return e.push(t.wrapS),e.push(t.wrapT),e.push(t.wrapR||0),e.push(t.magFilter),e.push(t.minFilter),e.push(t.anisotropy),e.push(t.internalFormat),e.push(t.format),e.push(t.type),e.push(t.generateMipmaps),e.push(t.premultiplyAlpha),e.push(t.flipY),e.push(t.unpackAlignment),e.push(t.colorSpace),e.join()}(n);if(o!==e.__cacheKey){void 0===s[o]&&(s[o]={texture:t.createTexture(),usedTimes:0},a.memory.textures++,i=!0),s[o].usedTimes++;const r=s[e.__cacheKey];void 0!==r&&(s[e.__cacheKey].usedTimes--,0===r.usedTimes&&S(n)),e.__cacheKey=o,e.__webglTexture=s[o].texture}return i}function P(e,a,o){let l=t.TEXTURE_2D;(a.isDataArrayTexture||a.isCompressedArrayTexture)&&(l=t.TEXTURE_2D_ARRAY),a.isData3DTexture&&(l=t.TEXTURE_3D);const u=N(e,a),h=a.source;n.bindTexture(l,e.__webglTexture,t.TEXTURE0+o);const c=i.get(h);if(h.version!==c.__version||!0===u){n.activeTexture(t.TEXTURE0+o);const e=ke.getPrimaries(ke.workingColorSpace),i=a.colorSpace===Xt?null:ke.getPrimaries(a.colorSpace),A=a.colorSpace===Xt||e===i?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,a.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,a.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,A);let d=f(a.image,!1,r.maxTextureSize);d=k(a,d);const p=s.convert(a.format,a.colorSpace),x=s.convert(a.type);let b,S=y(a.internalFormat,p,x,a.colorSpace,a.isVideoTexture);R(l,a);const M=a.mipmaps,w=!0!==a.isVideoTexture,T=void 0===c.__version||!0===u,E=h.dataReady,C=_(a,d);if(a.isDepthTexture)S=v(a.format===At,a.type),T&&(w?n.texStorage2D(t.TEXTURE_2D,1,S,d.width,d.height):n.texImage2D(t.TEXTURE_2D,0,S,d.width,d.height,0,p,x,null));else if(a.isDataTexture)if(M.length>0){w&&T&&n.texStorage2D(t.TEXTURE_2D,C,S,M[0].width,M[0].height);for(let e=0,i=M.length;e<i;e++)b=M[e],w?E&&n.texSubImage2D(t.TEXTURE_2D,e,0,0,b.width,b.height,p,x,b.data):n.texImage2D(t.TEXTURE_2D,e,S,b.width,b.height,0,p,x,b.data);a.generateMipmaps=!1}else w?(T&&n.texStorage2D(t.TEXTURE_2D,C,S,d.width,d.height),E&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,d.width,d.height,p,x,d.data)):n.texImage2D(t.TEXTURE_2D,0,S,d.width,d.height,0,p,x,d.data);else if(a.isCompressedTexture)if(a.isCompressedArrayTexture){w&&T&&n.texStorage3D(t.TEXTURE_2D_ARRAY,C,S,M[0].width,M[0].height,d.depth);for(let e=0,i=M.length;e<i;e++)if(b=M[e],a.format!==ht)if(null!==p)if(w){if(E)if(a.layerUpdates.size>0){const i=eo(b.width,b.height,a.format,a.type);for(const r of a.layerUpdates){const s=b.data.subarray(r*i/b.data.BYTES_PER_ELEMENT,(r+1)*i/b.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,r,b.width,b.height,1,p,s,0,0)}a.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,0,b.width,b.height,d.depth,p,b.data,0,0)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,e,S,b.width,b.height,d.depth,0,b.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else w?E&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,0,b.width,b.height,d.depth,p,x,b.data):n.texImage3D(t.TEXTURE_2D_ARRAY,e,S,b.width,b.height,d.depth,0,p,x,b.data)}else{w&&T&&n.texStorage2D(t.TEXTURE_2D,C,S,M[0].width,M[0].height);for(let e=0,i=M.length;e<i;e++)b=M[e],a.format!==ht?null!==p?w?E&&n.compressedTexSubImage2D(t.TEXTURE_2D,e,0,0,b.width,b.height,p,b.data):n.compressedTexImage2D(t.TEXTURE_2D,e,S,b.width,b.height,0,b.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):w?E&&n.texSubImage2D(t.TEXTURE_2D,e,0,0,b.width,b.height,p,x,b.data):n.texImage2D(t.TEXTURE_2D,e,S,b.width,b.height,0,p,x,b.data)}else if(a.isDataArrayTexture)if(w){if(T&&n.texStorage3D(t.TEXTURE_2D_ARRAY,C,S,d.width,d.height,d.depth),E)if(a.layerUpdates.size>0){const e=eo(d.width,d.height,a.format,a.type);for(const i of a.layerUpdates){const r=d.data.subarray(i*e/d.data.BYTES_PER_ELEMENT,(i+1)*e/d.data.BYTES_PER_ELEMENT);n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,i,d.width,d.height,1,p,x,r)}a.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,d.width,d.height,d.depth,p,x,d.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,S,d.width,d.height,d.depth,0,p,x,d.data);else if(a.isData3DTexture)w?(T&&n.texStorage3D(t.TEXTURE_3D,C,S,d.width,d.height,d.depth),E&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,d.width,d.height,d.depth,p,x,d.data)):n.texImage3D(t.TEXTURE_3D,0,S,d.width,d.height,d.depth,0,p,x,d.data);else if(a.isFramebufferTexture){if(T)if(w)n.texStorage2D(t.TEXTURE_2D,C,S,d.width,d.height);else{let e=d.width,i=d.height;for(let r=0;r<C;r++)n.texImage2D(t.TEXTURE_2D,r,S,e,i,0,p,x,null),e>>=1,i>>=1}}else if(M.length>0){if(w&&T){const e=z(M[0]);n.texStorage2D(t.TEXTURE_2D,C,S,e.width,e.height)}for(let e=0,i=M.length;e<i;e++)b=M[e],w?E&&n.texSubImage2D(t.TEXTURE_2D,e,0,0,p,x,b):n.texImage2D(t.TEXTURE_2D,e,S,p,x,b);a.generateMipmaps=!1}else if(w){if(T){const e=z(d);n.texStorage2D(t.TEXTURE_2D,C,S,e.width,e.height)}E&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,p,x,d)}else n.texImage2D(t.TEXTURE_2D,0,S,p,x,d);m(a)&&g(l),c.__version=h.version,a.onUpdate&&a.onUpdate(a)}e.__version=a.version}function D(e,r,a,l,u,h){const c=s.convert(a.format,a.colorSpace),A=s.convert(a.type),d=y(a.internalFormat,c,A,a.colorSpace);if(!i.get(r).__hasExternalTextures){const e=Math.max(1,r.width>>h),i=Math.max(1,r.height>>h);u===t.TEXTURE_3D||u===t.TEXTURE_2D_ARRAY?n.texImage3D(u,h,d,e,i,r.depth,0,c,A,null):n.texImage2D(u,h,d,e,i,0,c,A,null)}n.bindFramebuffer(t.FRAMEBUFFER,e),F(r)?o.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,l,u,i.get(a).__webglTexture,0,O(r)):(u===t.TEXTURE_2D||u>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&u<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,l,u,i.get(a).__webglTexture,h),n.bindFramebuffer(t.FRAMEBUFFER,null)}function I(e,n,i){if(t.bindRenderbuffer(t.RENDERBUFFER,e),n.depthBuffer){const r=n.depthTexture,s=r&&r.isDepthTexture?r.type:null,a=v(n.stencilBuffer,s),l=n.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,u=O(n);F(n)?o.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,u,a,n.width,n.height):i?t.renderbufferStorageMultisample(t.RENDERBUFFER,u,a,n.width,n.height):t.renderbufferStorage(t.RENDERBUFFER,a,n.width,n.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,l,t.RENDERBUFFER,e)}else{const e=n.textures;for(let r=0;r<e.length;r++){const a=e[r],l=s.convert(a.format,a.colorSpace),u=s.convert(a.type),h=y(a.internalFormat,l,u,a.colorSpace),c=O(n);i&&!1===F(n)?t.renderbufferStorageMultisample(t.RENDERBUFFER,c,h,n.width,n.height):F(n)?o.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,c,h,n.width,n.height):t.renderbufferStorage(t.RENDERBUFFER,h,n.width,n.height)}}t.bindRenderbuffer(t.RENDERBUFFER,null)}function L(e){const r=i.get(e),s=!0===e.isWebGLCubeRenderTarget;if(r.__boundDepthTexture!==e.depthTexture){const t=e.depthTexture;if(r.__depthDisposeCallback&&r.__depthDisposeCallback(),t){const e=()=>{delete r.__boundDepthTexture,delete r.__depthDisposeCallback,t.removeEventListener("dispose",e)};t.addEventListener("dispose",e),r.__depthDisposeCallback=e}r.__boundDepthTexture=t}if(e.depthTexture&&!r.__autoAllocateDepthBuffer){if(s)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,r){if(r&&r.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(t.FRAMEBUFFER,e),!r.depthTexture||!r.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");i.get(r.depthTexture).__webglTexture&&r.depthTexture.image.width===r.width&&r.depthTexture.image.height===r.height||(r.depthTexture.image.width=r.width,r.depthTexture.image.height=r.height,r.depthTexture.needsUpdate=!0),w(r.depthTexture,0);const s=i.get(r.depthTexture).__webglTexture,a=O(r);if(r.depthTexture.format===ct)F(r)?o.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,s,0,a):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,s,0);else{if(r.depthTexture.format!==At)throw new Error("Unknown depthTexture format");F(r)?o.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,s,0,a):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,s,0)}}(r.__webglFramebuffer,e)}else if(s){r.__webglDepthbuffer=[];for(let i=0;i<6;i++)if(n.bindFramebuffer(t.FRAMEBUFFER,r.__webglFramebuffer[i]),void 0===r.__webglDepthbuffer[i])r.__webglDepthbuffer[i]=t.createRenderbuffer(),I(r.__webglDepthbuffer[i],e,!1);else{const n=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,s=r.__webglDepthbuffer[i];t.bindRenderbuffer(t.RENDERBUFFER,s),t.framebufferRenderbuffer(t.FRAMEBUFFER,n,t.RENDERBUFFER,s)}}else if(n.bindFramebuffer(t.FRAMEBUFFER,r.__webglFramebuffer),void 0===r.__webglDepthbuffer)r.__webglDepthbuffer=t.createRenderbuffer(),I(r.__webglDepthbuffer,e,!1);else{const n=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,i=r.__webglDepthbuffer;t.bindRenderbuffer(t.RENDERBUFFER,i),t.framebufferRenderbuffer(t.FRAMEBUFFER,n,t.RENDERBUFFER,i)}n.bindFramebuffer(t.FRAMEBUFFER,null)}const B=[],U=[];function O(t){return Math.min(r.maxSamples,t.samples)}function F(t){const n=i.get(t);return t.samples>0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function k(t,e){const n=t.colorSpace,i=t.format,r=t.type;return!0===t.isCompressedTexture||!0===t.isVideoTexture||n!==Qt&&n!==Xt&&(ke.getTransfer(n)===Jt?i===ht&&r===K||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",n)),e}function z(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement?(u.width=t.naturalWidth||t.width,u.height=t.naturalHeight||t.height):"undefined"!=typeof VideoFrame&&t instanceof VideoFrame?(u.width=t.displayWidth,u.height=t.displayHeight):(u.width=t.width,u.height=t.height),u}this.allocateTextureUnit=function(){const t=M;return t>=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+r.maxTextures),M+=1,t},this.resetTextureUnits=function(){M=0},this.setTexture2D=w,this.setTexture2DArray=function(e,r){const s=i.get(e);e.version>0&&s.__version!==e.version?P(s,e,r):n.bindTexture(t.TEXTURE_2D_ARRAY,s.__webglTexture,t.TEXTURE0+r)},this.setTexture3D=function(e,r){const s=i.get(e);e.version>0&&s.__version!==e.version?P(s,e,r):n.bindTexture(t.TEXTURE_3D,s.__webglTexture,t.TEXTURE0+r)},this.setTextureCube=function(e,a){const o=i.get(e);e.version>0&&o.__version!==e.version?function(e,a,o){if(6!==a.image.length)return;const l=N(e,a),u=a.source;n.bindTexture(t.TEXTURE_CUBE_MAP,e.__webglTexture,t.TEXTURE0+o);const h=i.get(u);if(u.version!==h.__version||!0===l){n.activeTexture(t.TEXTURE0+o);const e=ke.getPrimaries(ke.workingColorSpace),i=a.colorSpace===Xt?null:ke.getPrimaries(a.colorSpace),c=a.colorSpace===Xt||e===i?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,a.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,a.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,c);const A=a.isCompressedTexture||a.image[0].isCompressedTexture,d=a.image[0]&&a.image[0].isDataTexture,p=[];for(let t=0;t<6;t++)p[t]=A||d?d?a.image[t].image:a.image[t]:f(a.image[t],!0,r.maxCubemapSize),p[t]=k(a,p[t]);const v=p[0],x=s.convert(a.format,a.colorSpace),b=s.convert(a.type),S=y(a.internalFormat,x,b,a.colorSpace),M=!0!==a.isVideoTexture,w=void 0===h.__version||!0===l,T=u.dataReady;let E,C=_(a,v);if(R(t.TEXTURE_CUBE_MAP,a),A){M&&w&&n.texStorage2D(t.TEXTURE_CUBE_MAP,C,S,v.width,v.height);for(let e=0;e<6;e++){E=p[e].mipmaps;for(let i=0;i<E.length;i++){const r=E[i];a.format!==ht?null!==x?M?T&&n.compressedTexSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i,0,0,r.width,r.height,x,r.data):n.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i,S,r.width,r.height,0,r.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):M?T&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i,0,0,r.width,r.height,x,b,r.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i,S,r.width,r.height,0,x,b,r.data)}}}else{if(E=a.mipmaps,M&&w){E.length>0&&C++;const e=z(p[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,C,S,e.width,e.height)}for(let e=0;e<6;e++)if(d){M?T&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,p[e].width,p[e].height,x,b,p[e].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,S,p[e].width,p[e].height,0,x,b,p[e].data);for(let i=0;i<E.length;i++){const r=E[i].image[e].image;M?T&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i+1,0,0,r.width,r.height,x,b,r.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i+1,S,r.width,r.height,0,x,b,r.data)}}else{M?T&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,x,b,p[e]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,S,x,b,p[e]);for(let i=0;i<E.length;i++){const r=E[i];M?T&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i+1,0,0,x,b,r.image[e]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i+1,S,x,b,r.image[e])}}}m(a)&&g(t.TEXTURE_CUBE_MAP),h.__version=u.version,a.onUpdate&&a.onUpdate(a)}e.__version=a.version}(o,e,a):n.bindTexture(t.TEXTURE_CUBE_MAP,o.__webglTexture,t.TEXTURE0+a)},this.rebindTextures=function(e,n,r){const s=i.get(e);void 0!==n&&D(s.__webglFramebuffer,e,e.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),void 0!==r&&L(e)},this.setupRenderTarget=function(e){const r=e.texture,o=i.get(e),l=i.get(r);e.addEventListener("dispose",b);const u=e.textures,h=!0===e.isWebGLCubeRenderTarget,c=u.length>1;if(c||(void 0===l.__webglTexture&&(l.__webglTexture=t.createTexture()),l.__version=r.version,a.memory.textures++),h){o.__webglFramebuffer=[];for(let e=0;e<6;e++)if(r.mipmaps&&r.mipmaps.length>0){o.__webglFramebuffer[e]=[];for(let n=0;n<r.mipmaps.length;n++)o.__webglFramebuffer[e][n]=t.createFramebuffer()}else o.__webglFramebuffer[e]=t.createFramebuffer()}else{if(r.mipmaps&&r.mipmaps.length>0){o.__webglFramebuffer=[];for(let e=0;e<r.mipmaps.length;e++)o.__webglFramebuffer[e]=t.createFramebuffer()}else o.__webglFramebuffer=t.createFramebuffer();if(c)for(let e=0,n=u.length;e<n;e++){const n=i.get(u[e]);void 0===n.__webglTexture&&(n.__webglTexture=t.createTexture(),a.memory.textures++)}if(e.samples>0&&!1===F(e)){o.__webglMultisampledFramebuffer=t.createFramebuffer(),o.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,o.__webglMultisampledFramebuffer);for(let n=0;n<u.length;n++){const i=u[n];o.__webglColorRenderbuffer[n]=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,o.__webglColorRenderbuffer[n]);const r=s.convert(i.format,i.colorSpace),a=s.convert(i.type),l=y(i.internalFormat,r,a,i.colorSpace,!0===e.isXRRenderTarget),h=O(e);t.renderbufferStorageMultisample(t.RENDERBUFFER,h,l,e.width,e.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+n,t.RENDERBUFFER,o.__webglColorRenderbuffer[n])}t.bindRenderbuffer(t.RENDERBUFFER,null),e.depthBuffer&&(o.__webglDepthRenderbuffer=t.createRenderbuffer(),I(o.__webglDepthRenderbuffer,e,!0)),n.bindFramebuffer(t.FRAMEBUFFER,null)}}if(h){n.bindTexture(t.TEXTURE_CUBE_MAP,l.__webglTexture),R(t.TEXTURE_CUBE_MAP,r);for(let n=0;n<6;n++)if(r.mipmaps&&r.mipmaps.length>0)for(let i=0;i<r.mipmaps.length;i++)D(o.__webglFramebuffer[n][i],e,r,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+n,i);else D(o.__webglFramebuffer[n],e,r,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+n,0);m(r)&&g(t.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(c){for(let r=0,s=u.length;r<s;r++){const s=u[r],a=i.get(s);n.bindTexture(t.TEXTURE_2D,a.__webglTexture),R(t.TEXTURE_2D,s),D(o.__webglFramebuffer,e,s,t.COLOR_ATTACHMENT0+r,t.TEXTURE_2D,0),m(s)&&g(t.TEXTURE_2D)}n.unbindTexture()}else{let i=t.TEXTURE_2D;if((e.isWebGL3DRenderTarget||e.isWebGLArrayRenderTarget)&&(i=e.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY),n.bindTexture(i,l.__webglTexture),R(i,r),r.mipmaps&&r.mipmaps.length>0)for(let n=0;n<r.mipmaps.length;n++)D(o.__webglFramebuffer[n],e,r,t.COLOR_ATTACHMENT0,i,n);else D(o.__webglFramebuffer,e,r,t.COLOR_ATTACHMENT0,i,0);m(r)&&g(i),n.unbindTexture()}e.depthBuffer&&L(e)},this.updateRenderTargetMipmap=function(e){const r=e.textures;for(let s=0,a=r.length;s<a;s++){const a=r[s];if(m(a)){const r=e.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:t.TEXTURE_2D,s=i.get(a).__webglTexture;n.bindTexture(r,s),g(r),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(e){if(e.samples>0)if(!1===F(e)){const r=e.textures,s=e.width,a=e.height;let o=t.COLOR_BUFFER_BIT;const u=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,h=i.get(e),c=r.length>1;if(c)for(let e=0;e<r.length;e++)n.bindFramebuffer(t.FRAMEBUFFER,h.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.RENDERBUFFER,null),n.bindFramebuffer(t.FRAMEBUFFER,h.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.TEXTURE_2D,null,0);n.bindFramebuffer(t.READ_FRAMEBUFFER,h.__webglMultisampledFramebuffer),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,h.__webglFramebuffer);for(let n=0;n<r.length;n++){if(e.resolveDepthBuffer&&(e.depthBuffer&&(o|=t.DEPTH_BUFFER_BIT),e.stencilBuffer&&e.resolveStencilBuffer&&(o|=t.STENCIL_BUFFER_BIT)),c){t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,h.__webglColorRenderbuffer[n]);const e=i.get(r[n]).__webglTexture;t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0)}t.blitFramebuffer(0,0,s,a,0,0,s,a,o,t.NEAREST),!0===l&&(B.length=0,U.length=0,B.push(t.COLOR_ATTACHMENT0+n),e.depthBuffer&&!1===e.resolveDepthBuffer&&(B.push(u),U.push(u),t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,U)),t.invalidateFramebuffer(t.READ_FRAMEBUFFER,B))}if(n.bindFramebuffer(t.READ_FRAMEBUFFER,null),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),c)for(let e=0;e<r.length;e++){n.bindFramebuffer(t.FRAMEBUFFER,h.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.RENDERBUFFER,h.__webglColorRenderbuffer[e]);const s=i.get(r[e]).__webglTexture;n.bindFramebuffer(t.FRAMEBUFFER,h.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.TEXTURE_2D,s,0)}n.bindFramebuffer(t.DRAW_FRAMEBUFFER,h.__webglMultisampledFramebuffer)}else if(e.depthBuffer&&!1===e.resolveDepthBuffer&&l){const n=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,[n])}},this.setupDepthRenderbuffer=L,this.setupFrameBufferTexture=D,this.useMultisampledRTT=F}function io(t,e){return{convert:function(n,i=""){let r;const s=ke.getTransfer(i);if(n===K)return t.UNSIGNED_BYTE;if(n===at)return t.UNSIGNED_SHORT_4_4_4_4;if(n===ot)return t.UNSIGNED_SHORT_5_5_5_1;if(n===ut)return t.UNSIGNED_INT_5_9_9_9_REV;if(n===J)return t.BYTE;if(n===tt)return t.SHORT;if(n===et)return t.UNSIGNED_SHORT;if(n===nt)return t.INT;if(n===it)return t.UNSIGNED_INT;if(n===rt)return t.FLOAT;if(n===st)return t.HALF_FLOAT;if(1021===n)return t.ALPHA;if(1022===n)return t.RGB;if(n===ht)return t.RGBA;if(1024===n)return t.LUMINANCE;if(1025===n)return t.LUMINANCE_ALPHA;if(n===ct)return t.DEPTH_COMPONENT;if(n===At)return t.DEPTH_STENCIL;if(1028===n)return t.RED;if(n===dt)return t.RED_INTEGER;if(1030===n)return t.RG;if(n===pt)return t.RG_INTEGER;if(n===ft)return t.RGBA_INTEGER;if(n===mt||n===gt||n===yt||n===vt)if(s===Jt){if(r=e.get("WEBGL_compressed_texture_s3tc_srgb"),null===r)return null;if(n===mt)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===gt)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===yt)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===vt)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(r=e.get("WEBGL_compressed_texture_s3tc"),null===r)return null;if(n===mt)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===gt)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===yt)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===vt)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(n===_t||n===xt||n===bt||n===St){if(r=e.get("WEBGL_compressed_texture_pvrtc"),null===r)return null;if(n===_t)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===xt)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===bt)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===St)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(n===Mt||n===wt||n===Tt){if(r=e.get("WEBGL_compressed_texture_etc"),null===r)return null;if(n===Mt||n===wt)return s===Jt?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===Tt)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}if(n===Et||n===Ct||n===Rt||n===Nt||n===Pt||n===Dt||n===It||n===Lt||n===Bt||n===Ut||n===Ot||n===Ft||n===kt||n===zt){if(r=e.get("WEBGL_compressed_texture_astc"),null===r)return null;if(n===Et)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Ct)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Rt)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Nt)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Pt)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Dt)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===It)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Lt)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Bt)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Ut)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===Ot)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Ft)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===kt)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===zt)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===qt||n===Gt||n===Vt){if(r=e.get("EXT_texture_compression_bptc"),null===r)return null;if(n===qt)return s===Jt?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===Gt)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===Vt)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(36283===n||n===Ht||n===jt||n===Wt){if(r=e.get("EXT_texture_compression_rgtc"),null===r)return null;if(n===qt)return r.COMPRESSED_RED_RGTC1_EXT;if(n===Ht)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===jt)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===Wt)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return n===lt?t.UNSIGNED_INT_24_8:void 0!==t[n]?t[n]:null}}}class ro extends Ar{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}}let so=class extends si{constructor(){super(),this.isGroup=!0,this.type="Group"}};const ao={type:"move"};class oo{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new so,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new so,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new en,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new en),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new so,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new en,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new en),this._grip}dispatchEvent(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const e=this._hand;if(e)for(const n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(t,e,n){let i=null,r=null,s=null;const a=this._targetRay,o=this._grip,l=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState){if(l&&t.hand){s=!0;for(const i of t.hand.values()){const t=e.getJointPose(i,n),r=this._getHandJoint(l,i);null!==t&&(r.matrix.fromArray(t.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.matrixWorldNeedsUpdate=!0,r.jointRadius=t.radius),r.visible=null!==t}const i=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],a=i.position.distanceTo(r.position),o=.02,u=.005;l.inputState.pinching&&a>o+u?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&a<=o-u&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==o&&t.gripSpace&&(r=e.getPose(t.gripSpace,n),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1));null!==a&&(i=e.getPose(t.targetRaySpace,n),null===i&&null!==r&&(i=r),null!==i&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(ao)))}return null!==a&&(a.visible=null!==i),null!==o&&(o.visible=null!==r),null!==l&&(l.visible=null!==s),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){const n=new so;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}}class lo{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,n){if(null===this.texture){const i=new Ye;t.properties.get(i).__webglTexture=e.texture,e.depthNear==n.depthNear&&e.depthFar==n.depthFar||(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}getMesh(t){if(null!==this.texture&&null===this.mesh){const e=t.cameras[0].viewport,n=new or({vertexShader:"\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}",fragmentShader:"\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n\tif ( coord.x >= 1.0 ) {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n\t}\n\n}",uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new tr(new Tr(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class uo extends fe{constructor(t,e){super();const n=this;let i=null,r=1,s=null,a="local-floor",o=1,l=null,u=null,h=null,c=null,A=null,d=null;const p=new lo,f=e.getContextAttributes();let m=null,g=null;const y=[],v=[],_=new Ee;let x=null;const b=new Ar;b.layers.enable(1),b.viewport=new Qe;const S=new Ar;S.layers.enable(2),S.viewport=new Qe;const M=[b,S],w=new ro;w.layers.enable(1),w.layers.enable(2);let T=null,E=null;function C(t){const e=v.indexOf(t.inputSource);if(-1===e)return;const n=y[e];void 0!==n&&(n.update(t.inputSource,t.frame,l||s),n.dispatchEvent({type:t.type,data:t.inputSource}))}function R(){i.removeEventListener("select",C),i.removeEventListener("selectstart",C),i.removeEventListener("selectend",C),i.removeEventListener("squeeze",C),i.removeEventListener("squeezestart",C),i.removeEventListener("squeezeend",C),i.removeEventListener("end",R),i.removeEventListener("inputsourceschange",N);for(let t=0;t<y.length;t++){const e=v[t];null!==e&&(v[t]=null,y[t].disconnect(e))}T=null,E=null,p.reset(),t.setRenderTarget(m),A=null,c=null,h=null,i=null,g=null,B.stop(),n.isPresenting=!1,t.setPixelRatio(x),t.setSize(_.width,_.height,!1),n.dispatchEvent({type:"sessionend"})}function N(t){for(let e=0;e<t.removed.length;e++){const n=t.removed[e],i=v.indexOf(n);i>=0&&(v[i]=null,y[i].disconnect(n))}for(let e=0;e<t.added.length;e++){const n=t.added[e];let i=v.indexOf(n);if(-1===i){for(let t=0;t<y.length;t++){if(t>=v.length){v.push(n),i=t;break}if(null===v[t]){v[t]=n,i=t;break}}if(-1===i)break}const r=y[i];r&&r.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=y[t];return void 0===e&&(e=new oo,y[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=y[t];return void 0===e&&(e=new oo,y[t]=e),e.getGripSpace()},this.getHand=function(t){let e=y[t];return void 0===e&&(e=new oo,y[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){r=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){a=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||s},this.setReferenceSpace=function(t){l=t},this.getBaseLayer=function(){return null!==c?c:A},this.getBinding=function(){return h},this.getFrame=function(){return d},this.getSession=function(){return i},this.setSession=async function(u){if(i=u,null!==i){if(m=t.getRenderTarget(),i.addEventListener("select",C),i.addEventListener("selectstart",C),i.addEventListener("selectend",C),i.addEventListener("squeeze",C),i.addEventListener("squeezestart",C),i.addEventListener("squeezeend",C),i.addEventListener("end",R),i.addEventListener("inputsourceschange",N),!0!==f.xrCompatible&&await e.makeXRCompatible(),x=t.getPixelRatio(),t.getSize(_),void 0===i.renderState.layers){const n={antialias:f.antialias,alpha:!0,depth:f.depth,stencil:f.stencil,framebufferScaleFactor:r};A=new XRWebGLLayer(i,e,n),i.updateRenderState({baseLayer:A}),t.setPixelRatio(1),t.setSize(A.framebufferWidth,A.framebufferHeight,!1),g=new Ze(A.framebufferWidth,A.framebufferHeight,{format:ht,type:K,colorSpace:t.outputColorSpace,stencilBuffer:f.stencil})}else{let n=null,s=null,a=null;f.depth&&(a=f.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,n=f.stencil?At:ct,s=f.stencil?lt:it);const o={colorFormat:e.RGBA8,depthFormat:a,scaleFactor:r};h=new XRWebGLBinding(i,e),c=h.createProjectionLayer(o),i.updateRenderState({layers:[c]}),t.setPixelRatio(1),t.setSize(c.textureWidth,c.textureHeight,!1),g=new Ze(c.textureWidth,c.textureHeight,{format:ht,type:K,depthTexture:new hs(c.textureWidth,c.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:f.stencil,colorSpace:t.outputColorSpace,samples:f.antialias?4:0,resolveDepthBuffer:!1===c.ignoreDepthValues})}g.isXRRenderTarget=!0,this.setFoveation(o),l=null,s=await i.requestReferenceSpace(a),B.setContext(i),B.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==i)return i.environmentBlendMode},this.getDepthTexture=function(){return p.getDepthTexture()};const P=new en,D=new en;function I(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.copy(t.matrixWorld).invert()}this.updateCamera=function(t){if(null===i)return;let e=t.near,n=t.far;null!==p.texture&&(p.depthNear>0&&(e=p.depthNear),p.depthFar>0&&(n=p.depthFar)),w.near=S.near=b.near=e,w.far=S.far=b.far=n,T===w.near&&E===w.far||(i.updateRenderState({depthNear:w.near,depthFar:w.far}),T=w.near,E=w.far);const r=t.parent,s=w.cameras;I(w,r);for(let t=0;t<s.length;t++)I(s[t],r);2===s.length?function(t,e,n){P.setFromMatrixPosition(e.matrixWorld),D.setFromMatrixPosition(n.matrixWorld);const i=P.distanceTo(D),r=e.projectionMatrix.elements,s=n.projectionMatrix.elements,a=r[14]/(r[10]-1),o=r[14]/(r[10]+1),l=(r[9]+1)/r[5],u=(r[9]-1)/r[5],h=(r[8]-1)/r[0],c=(s[8]+1)/s[0],A=a*h,d=a*c,p=i/(-h+c),f=p*-h;if(e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(f),t.translateZ(p),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.copy(t.matrixWorld).invert(),-1===r[10])t.projectionMatrix.copy(e.projectionMatrix),t.projectionMatrixInverse.copy(e.projectionMatrixInverse);else{const e=a+p,n=o+p,r=A-f,s=d+(i-f),h=l*o/n*e,c=u*o/n*e;t.projectionMatrix.makePerspective(r,s,h,c,e,n),t.projectionMatrixInverse.copy(t.projectionMatrix).invert()}}(w,b,S):w.projectionMatrix.copy(b.projectionMatrix),function(t,e,n){null===n?t.matrix.copy(e.matrixWorld):(t.matrix.copy(n.matrixWorld),t.matrix.invert(),t.matrix.multiply(e.matrixWorld));t.matrix.decompose(t.position,t.quaternion,t.scale),t.updateMatrixWorld(!0),t.projectionMatrix.copy(e.projectionMatrix),t.projectionMatrixInverse.copy(e.projectionMatrixInverse),t.isPerspectiveCamera&&(t.fov=2*ve*Math.atan(1/t.projectionMatrix.elements[5]),t.zoom=1)}(t,w,r)},this.getCamera=function(){return w},this.getFoveation=function(){if(null!==c||null!==A)return o},this.setFoveation=function(t){o=t,null!==c&&(c.fixedFoveation=t),null!==A&&void 0!==A.fixedFoveation&&(A.fixedFoveation=t)},this.hasDepthSensing=function(){return null!==p.texture},this.getDepthSensingMesh=function(){return p.getMesh(w)};let L=null;const B=new Mr;B.setAnimationLoop((function(e,r){if(u=r.getViewerPose(l||s),d=r,null!==u){const e=u.views;null!==A&&(t.setRenderTargetFramebuffer(g,A.framebuffer),t.setRenderTarget(g));let n=!1;e.length!==w.cameras.length&&(w.cameras.length=0,n=!0);for(let i=0;i<e.length;i++){const r=e[i];let s=null;if(null!==A)s=A.getViewport(r);else{const e=h.getViewSubImage(c,r);s=e.viewport,0===i&&(t.setRenderTargetTextures(g,e.colorTexture,c.ignoreDepthValues?void 0:e.depthStencilTexture),t.setRenderTarget(g))}let a=M[i];void 0===a&&(a=new Ar,a.layers.enable(i),a.viewport=new Qe,M[i]=a),a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.quaternion,a.scale),a.projectionMatrix.fromArray(r.projectionMatrix),a.projectionMatrixInverse.copy(a.projectionMatrix).invert(),a.viewport.set(s.x,s.y,s.width,s.height),0===i&&(w.matrix.copy(a.matrix),w.matrix.decompose(w.position,w.quaternion,w.scale)),!0===n&&w.cameras.push(a)}const r=i.enabledFeatures;if(r&&r.includes("depth-sensing")){const n=h.getDepthInformation(e[0]);n&&n.isValid&&n.texture&&p.init(t,n,i.renderState)}}for(let t=0;t<y.length;t++){const e=v[t],n=y[t];null!==e&&void 0!==n&&n.update(e,r,l||s)}L&&L(e,r),r.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:r}),d=null})),this.setAnimationLoop=function(t){L=t},this.dispose=function(){}}}const ho=new Gn,co=new Dn;function Ao(t,e){function n(t,e){!0===t.matrixAutoUpdate&&t.updateMatrix(),e.value.copy(t.matrix)}function i(t,i){t.opacity.value=i.opacity,i.color&&t.diffuse.value.copy(i.color),i.emissive&&t.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(t.map.value=i.map,n(i.map,t.mapTransform)),i.alphaMap&&(t.alphaMap.value=i.alphaMap,n(i.alphaMap,t.alphaMapTransform)),i.bumpMap&&(t.bumpMap.value=i.bumpMap,n(i.bumpMap,t.bumpMapTransform),t.bumpScale.value=i.bumpScale,1===i.side&&(t.bumpScale.value*=-1)),i.normalMap&&(t.normalMap.value=i.normalMap,n(i.normalMap,t.normalMapTransform),t.normalScale.value.copy(i.normalScale),1===i.side&&t.normalScale.value.negate()),i.displacementMap&&(t.displacementMap.value=i.displacementMap,n(i.displacementMap,t.displacementMapTransform),t.displacementScale.value=i.displacementScale,t.displacementBias.value=i.displacementBias),i.emissiveMap&&(t.emissiveMap.value=i.emissiveMap,n(i.emissiveMap,t.emissiveMapTransform)),i.specularMap&&(t.specularMap.value=i.specularMap,n(i.specularMap,t.specularMapTransform)),i.alphaTest>0&&(t.alphaTest.value=i.alphaTest);const r=e.get(i),s=r.envMap,a=r.envMapRotation;s&&(t.envMap.value=s,ho.copy(a),ho.x*=-1,ho.y*=-1,ho.z*=-1,s.isCubeTexture&&!1===s.isRenderTargetTexture&&(ho.y*=-1,ho.z*=-1),t.envMapRotation.value.setFromMatrix4(co.makeRotationFromEuler(ho)),t.flipEnvMap.value=s.isCubeTexture&&!1===s.isRenderTargetTexture?-1:1,t.reflectivity.value=i.reflectivity,t.ior.value=i.ior,t.refractionRatio.value=i.refractionRatio),i.lightMap&&(t.lightMap.value=i.lightMap,t.lightMapIntensity.value=i.lightMapIntensity,n(i.lightMap,t.lightMapTransform)),i.aoMap&&(t.aoMap.value=i.aoMap,t.aoMapIntensity.value=i.aoMapIntensity,n(i.aoMap,t.aoMapTransform))}return{refreshFogUniforms:function(e,n){n.color.getRGB(e.fogColor.value,sr(t)),n.isFog?(e.fogNear.value=n.near,e.fogFar.value=n.far):n.isFogExp2&&(e.fogDensity.value=n.density)},refreshMaterialUniforms:function(t,r,s,a,o){r.isMeshBasicMaterial||r.isMeshLambertMaterial?i(t,r):r.isMeshToonMaterial?(i(t,r),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(t,r)):r.isMeshPhongMaterial?(i(t,r),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4)}(t,r)):r.isMeshStandardMaterial?(i(t,r),function(t,e){t.metalness.value=e.metalness,e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap,n(e.metalnessMap,t.metalnessMapTransform));t.roughness.value=e.roughness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap,n(e.roughnessMap,t.roughnessMapTransform));e.envMap&&(t.envMapIntensity.value=e.envMapIntensity)}(t,r),r.isMeshPhysicalMaterial&&function(t,e,i){t.ior.value=e.ior,e.sheen>0&&(t.sheenColor.value.copy(e.sheenColor).multiplyScalar(e.sheen),t.sheenRoughness.value=e.sheenRoughness,e.sheenColorMap&&(t.sheenColorMap.value=e.sheenColorMap,n(e.sheenColorMap,t.sheenColorMapTransform)),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap,n(e.sheenRoughnessMap,t.sheenRoughnessMapTransform)));e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap,n(e.clearcoatMap,t.clearcoatMapTransform)),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap,n(e.clearcoatRoughnessMap,t.clearcoatRoughnessMapTransform)),e.clearcoatNormalMap&&(t.clearcoatNormalMap.value=e.clearcoatNormalMap,n(e.clearcoatNormalMap,t.clearcoatNormalMapTransform),t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),1===e.side&&t.clearcoatNormalScale.value.negate()));e.dispersion>0&&(t.dispersion.value=e.dispersion);e.iridescence>0&&(t.iridescence.value=e.iridescence,t.iridescenceIOR.value=e.iridescenceIOR,t.iridescenceThicknessMinimum.value=e.iridescenceThicknessRange[0],t.iridescenceThicknessMaximum.value=e.iridescenceThicknessRange[1],e.iridescenceMap&&(t.iridescenceMap.value=e.iridescenceMap,n(e.iridescenceMap,t.iridescenceMapTransform)),e.iridescenceThicknessMap&&(t.iridescenceThicknessMap.value=e.iridescenceThicknessMap,n(e.iridescenceThicknessMap,t.iridescenceThicknessMapTransform)));e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=i.texture,t.transmissionSamplerSize.value.set(i.width,i.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap,n(e.transmissionMap,t.transmissionMapTransform)),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap,n(e.thicknessMap,t.thicknessMapTransform)),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor));e.anisotropy>0&&(t.anisotropyVector.value.set(e.anisotropy*Math.cos(e.anisotropyRotation),e.anisotropy*Math.sin(e.anisotropyRotation)),e.anisotropyMap&&(t.anisotropyMap.value=e.anisotropyMap,n(e.anisotropyMap,t.anisotropyMapTransform)));t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap,n(e.specularColorMap,t.specularColorMapTransform));e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap,n(e.specularIntensityMap,t.specularIntensityMapTransform))}(t,r,o)):r.isMeshMatcapMaterial?(i(t,r),function(t,e){e.matcap&&(t.matcap.value=e.matcap)}(t,r)):r.isMeshDepthMaterial?i(t,r):r.isMeshDistanceMaterial?(i(t,r),function(t,n){const i=e.get(n).light;t.referencePosition.value.setFromMatrixPosition(i.matrixWorld),t.nearDistance.value=i.shadow.camera.near,t.farDistance.value=i.shadow.camera.far}(t,r)):r.isMeshNormalMaterial?i(t,r):r.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,e.map&&(t.map.value=e.map,n(e.map,t.mapTransform))}(t,r),r.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,r)):r.isPointsMaterial?function(t,e,i,r){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*i,t.scale.value=.5*r,e.map&&(t.map.value=e.map,n(e.map,t.uvTransform));e.alphaMap&&(t.alphaMap.value=e.alphaMap,n(e.alphaMap,t.alphaMapTransform));e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,r,s,a):r.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map,n(e.map,t.mapTransform));e.alphaMap&&(t.alphaMap.value=e.alphaMap,n(e.alphaMap,t.alphaMapTransform));e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,r):r.isShadowMaterial?(t.color.value.copy(r.color),t.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function po(t,e,n,i){let r={},s={},a=[];const o=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function l(t,e,n,i){const r=t.value,s=e+"_"+n;if(void 0===i[s])return i[s]="number"==typeof r||"boolean"==typeof r?r:r.clone(),!0;{const t=i[s];if("number"==typeof r||"boolean"==typeof r){if(t!==r)return i[s]=r,!0}else if(!1===t.equals(r))return t.copy(r),!0}return!1}function u(t){const e={boundary:0,storage:0};return"number"==typeof t||"boolean"==typeof t?(e.boundary=4,e.storage=4):t.isVector2?(e.boundary=8,e.storage=8):t.isVector3||t.isColor?(e.boundary=16,e.storage=12):t.isVector4?(e.boundary=16,e.storage=16):t.isMatrix3?(e.boundary=48,e.storage=48):t.isMatrix4?(e.boundary=64,e.storage=64):t.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",t),e}function h(e){const n=e.target;n.removeEventListener("dispose",h);const i=a.indexOf(n.__bindingPointIndex);a.splice(i,1),t.deleteBuffer(r[n.id]),delete r[n.id],delete s[n.id]}return{bind:function(t,e){const n=e.program;i.uniformBlockBinding(t,n)},update:function(n,c){let A=r[n.id];void 0===A&&(!function(t){const e=t.uniforms;let n=0;const i=16;for(let t=0,r=e.length;t<r;t++){const r=Array.isArray(e[t])?e[t]:[e[t]];for(let t=0,e=r.length;t<e;t++){const e=r[t],s=Array.isArray(e.value)?e.value:[e.value];for(let t=0,r=s.length;t<r;t++){const r=u(s[t]),a=n%i,o=a%r.boundary,l=a+o;n+=o,0!==l&&i-l<r.storage&&(n+=i-l),e.__data=new Float32Array(r.storage/Float32Array.BYTES_PER_ELEMENT),e.__offset=n,n+=r.storage}}}const r=n%i;r>0&&(n+=i-r);t.__size=n,t.__cache={}}(n),A=function(e){const n=function(){for(let t=0;t<o;t++)if(-1===a.indexOf(t))return a.push(t),t;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();e.__bindingPointIndex=n;const i=t.createBuffer(),r=e.__size,s=e.usage;return t.bindBuffer(t.UNIFORM_BUFFER,i),t.bufferData(t.UNIFORM_BUFFER,r,s),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,n,i),i}(n),r[n.id]=A,n.addEventListener("dispose",h));const d=c.program;i.updateUBOMapping(n,d);const p=e.render.frame;s[n.id]!==p&&(!function(e){const n=r[e.id],i=e.uniforms,s=e.__cache;t.bindBuffer(t.UNIFORM_BUFFER,n);for(let e=0,n=i.length;e<n;e++){const n=Array.isArray(i[e])?i[e]:[i[e]];for(let i=0,r=n.length;i<r;i++){const r=n[i];if(!0===l(r,e,i,s)){const e=r.__offset,n=Array.isArray(r.value)?r.value:[r.value];let i=0;for(let s=0;s<n.length;s++){const a=n[s],o=u(a);"number"==typeof a||"boolean"==typeof a?(r.__data[0]=a,t.bufferSubData(t.UNIFORM_BUFFER,e+i,r.__data)):a.isMatrix3?(r.__data[0]=a.elements[0],r.__data[1]=a.elements[1],r.__data[2]=a.elements[2],r.__data[3]=0,r.__data[4]=a.elements[3],r.__data[5]=a.elements[4],r.__data[6]=a.elements[5],r.__data[7]=0,r.__data[8]=a.elements[6],r.__data[9]=a.elements[7],r.__data[10]=a.elements[8],r.__data[11]=0):(a.toArray(r.__data,i),i+=o.storage/Float32Array.BYTES_PER_ELEMENT)}t.bufferSubData(t.UNIFORM_BUFFER,e,r.__data)}}}t.bindBuffer(t.UNIFORM_BUFFER,null)}(n),s[n.id]=p)},dispose:function(){for(const e in r)t.deleteBuffer(r[e]);a=[],r={},s={}}}}let fo=class{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=ce,this.updateRanges=[],this.version=0,this.uuid=_e()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let i=0,r=this.stride;i<r;i++)this.array[t+i]=e.array[n+i];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=_e()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(e,this.stride);return n.setUsage(this.usage),n}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=_e()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}};const mo=new en;let go=class t{constructor(t,e,n,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=n,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,n=this.data.count;e<n;e++)mo.fromBufferAttribute(this,e),mo.applyMatrix4(t),this.setXYZ(e,mo.x,mo.y,mo.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)mo.fromBufferAttribute(this,e),mo.applyNormalMatrix(t),this.setXYZ(e,mo.x,mo.y,mo.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)mo.fromBufferAttribute(this,e),mo.transformDirection(t),this.setXYZ(e,mo.x,mo.y,mo.z);return this}getComponent(t,e){let n=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(n=Me(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=we(n,this.array)),this.data.array[t*this.data.stride+this.offset+e]=n,this}setX(t,e){return this.normalized&&(e=we(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=we(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=we(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=we(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=Me(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=Me(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=Me(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=Me(e,this.array)),e}setXY(t,e,n){return t=t*this.data.stride+this.offset,this.normalized&&(e=we(e,this.array),n=we(n,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this}setXYZ(t,e,n,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=we(e,this.array),n=we(n,this.array),i=we(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this}setXYZW(t,e,n,i,r){return t=t*this.data.stride+this.offset,this.normalized&&(e=we(e,this.array),n=we(n,this.array),i=we(i,this.array),r=we(r,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this.data.array[t+3]=r,this}clone(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const n=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[n+e])}return new Pi(new this.array.constructor(t),this.itemSize,this.normalized)}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new t(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const n=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[n+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}},yo=class extends Pi{constructor(t,e,n,i=1){super(t,e,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){const t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}},vo=class extends Ei{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Mi(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}};const _o=new en,xo=new en,bo=new Dn,So=new Pn,Mo=new Sn,wo=new en,To=new en;class Eo extends si{constructor(t=new Gi,e=new vo){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(null===t.index){const e=t.attributes.position,n=[0];for(let t=1,i=e.count;t<i;t++)_o.fromBufferAttribute(e,t-1),xo.fromBufferAttribute(e,t),n[t]=n[t-1],n[t]+=_o.distanceTo(xo);t.setAttribute("lineDistance",new Li(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,e){const n=this.geometry,i=this.matrixWorld,r=t.params.Line.threshold,s=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),Mo.copy(n.boundingSphere),Mo.applyMatrix4(i),Mo.radius+=r,!1===t.ray.intersectsSphere(Mo))return;bo.copy(i).invert(),So.copy(t.ray).applyMatrix4(bo);const a=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,l=this.isLineSegments?2:1,u=n.index,h=n.attributes.position;if(null!==u){const n=Math.max(0,s.start),i=Math.min(u.count,s.start+s.count);for(let r=n,s=i-1;r<s;r+=l){const n=u.getX(r),i=u.getX(r+1),s=Co(this,t,So,o,n,i);s&&e.push(s)}if(this.isLineLoop){const r=u.getX(i-1),s=u.getX(n),a=Co(this,t,So,o,r,s);a&&e.push(a)}}else{const n=Math.max(0,s.start),i=Math.min(h.count,s.start+s.count);for(let r=n,s=i-1;r<s;r+=l){const n=Co(this,t,So,o,r,r+1);n&&e.push(n)}if(this.isLineLoop){const r=Co(this,t,So,o,i-1,n);r&&e.push(r)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t<e;t++){const e=n[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}}function Co(t,e,n,i,r,s){const a=t.geometry.attributes.position;_o.fromBufferAttribute(a,r),xo.fromBufferAttribute(a,s);if(n.distanceSqToSegment(_o,xo,wo,To)>i)return;wo.applyMatrix4(t.matrixWorld);const o=e.ray.origin.distanceTo(wo);return o<e.near||o>e.far?void 0:{distance:o,point:To.clone().applyMatrix4(t.matrixWorld),index:r,face:null,faceIndex:null,barycoord:null,object:t}}const Ro=new en,No=new en;class Po extends Eo{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(null===t.index){const e=t.attributes.position,n=[];for(let t=0,i=e.count;t<i;t+=2)Ro.fromBufferAttribute(e,t),No.fromBufferAttribute(e,t+1),n[t]=0===t?0:n[t-1],n[t+1]=n[t]+Ro.distanceTo(No);t.setAttribute("lineDistance",new Li(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class Do{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)}getPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e}getSpacedPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,i=this.getPoint(0),r=0;e.push(0);for(let s=1;s<=t;s++)n=this.getPoint(s/t),r+=n.distanceTo(i),e.push(r),i=n;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const n=this.getLengths();let i=0;const r=n.length;let s;s=e||t*n[r-1];let a,o=0,l=r-1;for(;o<=l;)if(i=Math.floor(o+(l-o)/2),a=n[i]-s,a<0)o=i+1;else{if(!(a>0)){l=i;break}l=i-1}if(i=l,n[i]===s)return i/(r-1);const u=n[i];return(i+(s-u)/(n[i+1]-u))/(r-1)}getTangent(t,e){const n=1e-4;let i=t-n,r=t+n;i<0&&(i=0),r>1&&(r=1);const s=this.getPoint(i),a=this.getPoint(r),o=e||(s.isVector2?new Ee:new en);return o.copy(a).sub(s).normalize(),o}getTangentAt(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)}computeFrenetFrames(t,e){const n=new en,i=[],r=[],s=[],a=new en,o=new Dn;for(let e=0;e<=t;e++){const n=e/t;i[e]=this.getTangentAt(n,new en)}r[0]=new en,s[0]=new en;let l=Number.MAX_VALUE;const u=Math.abs(i[0].x),h=Math.abs(i[0].y),c=Math.abs(i[0].z);u<=l&&(l=u,n.set(1,0,0)),h<=l&&(l=h,n.set(0,1,0)),c<=l&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],a),s[0].crossVectors(i[0],r[0]);for(let e=1;e<=t;e++){if(r[e]=r[e-1].clone(),s[e]=s[e-1].clone(),a.crossVectors(i[e-1],i[e]),a.length()>Number.EPSILON){a.normalize();const t=Math.acos(xe(i[e-1].dot(i[e]),-1,1));r[e].applyMatrix4(o.makeRotationAxis(a,t))}s[e].crossVectors(i[e],r[e])}if(!0===e){let e=Math.acos(xe(r[0].dot(r[t]),-1,1));e/=t,i[0].dot(a.crossVectors(r[0],r[t]))>0&&(e=-e);for(let n=1;n<=t;n++)r[n].applyMatrix4(o.makeRotationAxis(i[n],e*n)),s[n].crossVectors(i[n],r[n])}return{tangents:i,normals:r,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class Io extends Do{constructor(t=0,e=0,n=1,i=1,r=0,s=2*Math.PI,a=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=n,this.yRadius=i,this.aStartAngle=r,this.aEndAngle=s,this.aClockwise=a,this.aRotation=o}getPoint(t,e=new Ee){const n=e,i=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const s=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=i;for(;r>i;)r-=i;r<Number.EPSILON&&(r=s?0:i),!0!==this.aClockwise||s||(r===i?r=-i:r-=i);const a=this.aStartAngle+t*r;let o=this.aX+this.xRadius*Math.cos(a),l=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){const t=Math.cos(this.aRotation),e=Math.sin(this.aRotation),n=o-this.aX,i=l-this.aY;o=n*t-i*e+this.aX,l=n*e+i*t+this.aY}return n.set(o,l)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){const t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}function Lo(){let t=0,e=0,n=0,i=0;function r(r,s,a,o){t=r,e=a,n=-3*r+3*s-2*a-o,i=2*r-2*s+a+o}return{initCatmullRom:function(t,e,n,i,s){r(e,n,s*(n-t),s*(i-e))},initNonuniformCatmullRom:function(t,e,n,i,s,a,o){let l=(e-t)/s-(n-t)/(s+a)+(n-e)/a,u=(n-e)/a-(i-e)/(a+o)+(i-n)/o;l*=a,u*=a,r(e,n,l,u)},calc:function(r){const s=r*r;return t+e*r+n*s+i*(s*r)}}}const Bo=new en,Uo=new Lo,Oo=new Lo,Fo=new Lo;function ko(t,e,n,i,r){const s=.5*(i-e),a=.5*(r-n),o=t*t;return(2*n-2*i+s+a)*(t*o)+(-3*n+3*i-2*s-a)*o+s*t+n}function zo(t,e,n,i){return function(t,e){const n=1-t;return n*n*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,n)+function(t,e){return t*t*e}(t,i)}function qo(t,e,n,i,r){return function(t,e){const n=1-t;return n*n*n*e}(t,e)+function(t,e){const n=1-t;return 3*n*n*t*e}(t,n)+function(t,e){return 3*(1-t)*t*t*e}(t,i)+function(t,e){return t*t*t*e}(t,r)}class Go extends Do{constructor(t=new Ee,e=new Ee,n=new Ee,i=new Ee){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=n,this.v3=i}getPoint(t,e=new Ee){const n=e,i=this.v0,r=this.v1,s=this.v2,a=this.v3;return n.set(qo(t,i.x,r.x,s.x,a.x),qo(t,i.y,r.y,s.y,a.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class Vo extends Do{constructor(t=new en,e=new en,n=new en,i=new en){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=n,this.v3=i}getPoint(t,e=new en){const n=e,i=this.v0,r=this.v1,s=this.v2,a=this.v3;return n.set(qo(t,i.x,r.x,s.x,a.x),qo(t,i.y,r.y,s.y,a.y),qo(t,i.z,r.z,s.z,a.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class Ho extends Do{constructor(t=new Ee,e=new Ee){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new Ee){const n=e;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new Ee){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class jo extends Do{constructor(t=new Ee,e=new Ee,n=new Ee){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new Ee){const n=e,i=this.v0,r=this.v1,s=this.v2;return n.set(zo(t,i.x,r.x,s.x),zo(t,i.y,r.y,s.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Wo extends Do{constructor(t=new en,e=new en,n=new en){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new en){const n=e,i=this.v0,r=this.v1,s=this.v2;return n.set(zo(t,i.x,r.x,s.x),zo(t,i.y,r.y,s.y),zo(t,i.z,r.z,s.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Xo extends Do{constructor(t=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=t}getPoint(t,e=new Ee){const n=e,i=this.points,r=(i.length-1)*t,s=Math.floor(r),a=r-s,o=i[0===s?s:s-1],l=i[s],u=i[s>i.length-2?i.length-1:s+1],h=i[s>i.length-3?i.length-1:s+2];return n.set(ko(a,o.x,l.x,u.x,h.x),ko(a,o.y,l.y,u.y,h.y)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push(n.clone())}return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const n=this.points[e];t.points.push(n.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push((new Ee).fromArray(n))}return this}}var Yo=Object.freeze({__proto__:null,ArcCurve:class extends Io{constructor(t,e,n,i,r,s){super(t,e,n,n,i,r,s),this.isArcCurve=!0,this.type="ArcCurve"}},CatmullRomCurve3:class extends Do{constructor(t=[],e=!1,n="centripetal",i=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=n,this.tension=i}getPoint(t,e=new en){const n=e,i=this.points,r=i.length,s=(r-(this.closed?0:1))*t;let a,o,l=Math.floor(s),u=s-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/r)+1)*r:0===u&&l===r-1&&(l=r-2,u=1),this.closed||l>0?a=i[(l-1)%r]:(Bo.subVectors(i[0],i[1]).add(i[0]),a=Bo);const h=i[l%r],c=i[(l+1)%r];if(this.closed||l+2<r?o=i[(l+2)%r]:(Bo.subVectors(i[r-1],i[r-2]).add(i[r-1]),o=Bo),"centripetal"===this.curveType||"chordal"===this.curveType){const t="chordal"===this.curveType?.5:.25;let e=Math.pow(a.distanceToSquared(h),t),n=Math.pow(h.distanceToSquared(c),t),i=Math.pow(c.distanceToSquared(o),t);n<1e-4&&(n=1),e<1e-4&&(e=n),i<1e-4&&(i=n),Uo.initNonuniformCatmullRom(a.x,h.x,c.x,o.x,e,n,i),Oo.initNonuniformCatmullRom(a.y,h.y,c.y,o.y,e,n,i),Fo.initNonuniformCatmullRom(a.z,h.z,c.z,o.z,e,n,i)}else"catmullrom"===this.curveType&&(Uo.initCatmullRom(a.x,h.x,c.x,o.x,this.tension),Oo.initCatmullRom(a.y,h.y,c.y,o.y,this.tension),Fo.initCatmullRom(a.z,h.z,c.z,o.z,this.tension));return n.set(Uo.calc(u),Oo.calc(u),Fo.calc(u)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push(n.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const n=this.points[e];t.points.push(n.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push((new en).fromArray(n))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}},CubicBezierCurve:Go,CubicBezierCurve3:Vo,EllipseCurve:Io,LineCurve:Ho,LineCurve3:class extends Do{constructor(t=new en,e=new en){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=t,this.v2=e}getPoint(t,e=new en){const n=e;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new en){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},QuadraticBezierCurve:jo,QuadraticBezierCurve3:Wo,SplineCurve:Xo});class Qo extends Do{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){const t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);if(!t.equals(e)){const n=!0===t.isVector2?"LineCurve":"LineCurve3";this.curves.push(new Yo[n](e,t))}return this}getPoint(t,e){const n=t*this.getLength(),i=this.getCurveLengths();let r=0;for(;r<i.length;){if(i[r]>=n){const t=i[r]-n,s=this.curves[r],a=s.getLength(),o=0===a?0:1-t/a;return s.getPointAt(o,e)}r++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let n=0,i=this.curves.length;n<i;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){const e=[];let n;for(let i=0,r=this.curves;i<r.length;i++){const s=r[i],a=s.isEllipseCurve?2*t:s.isLineCurve||s.isLineCurve3?1:s.isSplineCurve?t*s.points.length:t,o=s.getPoints(a);for(let t=0;t<o.length;t++){const i=o[t];n&&n.equals(i)||(e.push(i),n=i)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const n=t.curves[e];this.curves.push(n.clone())}return this.autoClose=t.autoClose,this}toJSON(){const t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,n=this.curves.length;e<n;e++){const n=this.curves[e];t.curves.push(n.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const n=t.curves[e];this.curves.push((new Yo[n.type]).fromJSON(n))}return this}}let $o=class extends Qo{constructor(t){super(),this.type="Path",this.currentPoint=new Ee,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){const n=new Ho(this.currentPoint.clone(),new Ee(t,e));return this.curves.push(n),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,n,i){const r=new jo(this.currentPoint.clone(),new Ee(t,e),new Ee(n,i));return this.curves.push(r),this.currentPoint.set(n,i),this}bezierCurveTo(t,e,n,i,r,s){const a=new Go(this.currentPoint.clone(),new Ee(t,e),new Ee(n,i),new Ee(r,s));return this.curves.push(a),this.currentPoint.set(r,s),this}splineThru(t){const e=[this.currentPoint.clone()].concat(t),n=new Xo(e);return this.curves.push(n),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,n,i,r,s){const a=this.currentPoint.x,o=this.currentPoint.y;return this.absarc(t+a,e+o,n,i,r,s),this}absarc(t,e,n,i,r,s){return this.absellipse(t,e,n,n,i,r,s),this}ellipse(t,e,n,i,r,s,a,o){const l=this.currentPoint.x,u=this.currentPoint.y;return this.absellipse(t+l,e+u,n,i,r,s,a,o),this}absellipse(t,e,n,i,r,s,a,o){const l=new Io(t,e,n,i,r,s,a,o);if(this.curves.length>0){const t=l.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(l);const u=l.getPoint(1);return this.currentPoint.copy(u),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}};class Zo extends Gi{constructor(t=1,e=32,n=0,i=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},e=Math.max(3,e);const r=[],s=[],a=[],o=[],l=new en,u=new Ee;s.push(0,0,0),a.push(0,0,1),o.push(.5,.5);for(let r=0,h=3;r<=e;r++,h+=3){const c=n+r/e*i;l.x=t*Math.cos(c),l.y=t*Math.sin(c),s.push(l.x,l.y,l.z),a.push(0,0,1),u.x=(s[h]/t+1)/2,u.y=(s[h+1]/t+1)/2,o.push(u.x,u.y)}for(let t=1;t<=e;t++)r.push(t,t+1,0);this.setIndex(r),this.setAttribute("position",new Li(s,3)),this.setAttribute("normal",new Li(a,3)),this.setAttribute("uv",new Li(o,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Zo(t.radius,t.segments,t.thetaStart,t.thetaLength)}}class Ko extends Gi{constructor(t=1,e=1,n=1,i=32,r=1,s=!1,a=0,o=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:i,heightSegments:r,openEnded:s,thetaStart:a,thetaLength:o};const l=this;i=Math.floor(i),r=Math.floor(r);const u=[],h=[],c=[],A=[];let d=0;const p=[],f=n/2;let m=0;function g(n){const r=d,s=new Ee,p=new en;let g=0;const y=!0===n?t:e,v=!0===n?1:-1;for(let t=1;t<=i;t++)h.push(0,f*v,0),c.push(0,v,0),A.push(.5,.5),d++;const _=d;for(let t=0;t<=i;t++){const e=t/i*o+a,n=Math.cos(e),r=Math.sin(e);p.x=y*r,p.y=f*v,p.z=y*n,h.push(p.x,p.y,p.z),c.push(0,v,0),s.x=.5*n+.5,s.y=.5*r*v+.5,A.push(s.x,s.y),d++}for(let t=0;t<i;t++){const e=r+t,i=_+t;!0===n?u.push(i,i+1,e):u.push(i+1,i,e),g+=3}l.addGroup(m,g,!0===n?1:2),m+=g}!function(){const s=new en,g=new en;let y=0;const v=(e-t)/n;for(let l=0;l<=r;l++){const u=[],m=l/r,y=m*(e-t)+t;for(let t=0;t<=i;t++){const e=t/i,r=e*o+a,l=Math.sin(r),p=Math.cos(r);g.x=y*l,g.y=-m*n+f,g.z=y*p,h.push(g.x,g.y,g.z),s.set(l,v,p).normalize(),c.push(s.x,s.y,s.z),A.push(e,1-m),u.push(d++)}p.push(u)}for(let n=0;n<i;n++)for(let i=0;i<r;i++){const r=p[i][n],s=p[i+1][n],a=p[i+1][n+1],o=p[i][n+1];t>0&&(u.push(r,s,o),y+=3),e>0&&(u.push(s,a,o),y+=3)}l.addGroup(m,y,0),m+=y}(),!1===s&&(t>0&&g(!0),e>0&&g(!1)),this.setIndex(u),this.setAttribute("position",new Li(h,3)),this.setAttribute("normal",new Li(c,3)),this.setAttribute("uv",new Li(A,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Ko(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class Jo extends $o{constructor(t){super(t),this.uuid=_e(),this.type="Shape",this.holes=[]}getPointsHoles(t){const e=[];for(let n=0,i=this.holes.length;n<i;n++)e[n]=this.holes[n].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const n=t.holes[e];this.holes.push(n.clone())}return this}toJSON(){const t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,n=this.holes.length;e<n;e++){const n=this.holes[e];t.holes.push(n.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const n=t.holes[e];this.holes.push((new $o).fromJSON(n))}return this}}const tl=function(t,e,n=2){const i=e&&e.length,r=i?e[0]*n:t.length;let s=el(t,0,r,n,!0);const a=[];if(!s||s.next===s.prev)return a;let o,l,u,h,c,A,d;if(i&&(s=function(t,e,n,i){const r=[];let s,a,o,l,u;for(s=0,a=e.length;s<a;s++)o=e[s]*i,l=s<a-1?e[s+1]*i:t.length,u=el(t,o,l,i,!1),u===u.next&&(u.steiner=!0),r.push(Al(u));for(r.sort(ll),s=0;s<r.length;s++)n=ul(r[s],n);return n}(t,e,s,n)),t.length>80*n){o=u=t[0],l=h=t[1];for(let e=n;e<r;e+=n)c=t[e],A=t[e+1],c<o&&(o=c),A<l&&(l=A),c>u&&(u=c),A>h&&(h=A);d=Math.max(u-o,h-l),d=0!==d?32767/d:0}return il(s,a,n,o,l,d,0),a};function el(t,e,n,i,r){let s,a;if(r===function(t,e,n,i){let r=0;for(let s=e,a=n-i;s<n;s+=i)r+=(t[a]-t[s])*(t[s+1]+t[a+1]),a=s;return r}(t,e,n,i)>0)for(s=e;s<n;s+=i)a=bl(s,t[s],t[s+1],a);else for(s=n-i;s>=e;s-=i)a=bl(s,t[s],t[s+1],a);return a&&ml(a,a.next)&&(Sl(a),a=a.next),a}function nl(t,e){if(!t)return t;e||(e=t);let n,i=t;do{if(n=!1,i.steiner||!ml(i,i.next)&&0!==fl(i.prev,i,i.next))i=i.next;else{if(Sl(i),i=e=i.prev,i===i.next)break;n=!0}}while(n||i!==e);return e}function il(t,e,n,i,r,s,a){if(!t)return;!a&&s&&function(t,e,n,i){let r=t;do{0===r.z&&(r.z=cl(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){let e,n,i,r,s,a,o,l,u=1;do{for(n=t,t=null,s=null,a=0;n;){for(a++,i=n,o=0,e=0;e<u&&(o++,i=i.nextZ,i);e++);for(l=u;o>0||l>0&&i;)0!==o&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,o--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;n=i}s.nextZ=null,u*=2}while(a>1)}(r)}(t,i,r,s);let o,l,u=t;for(;t.prev!==t.next;)if(o=t.prev,l=t.next,s?sl(t,i,r,s):rl(t))e.push(o.i/n|0),e.push(t.i/n|0),e.push(l.i/n|0),Sl(t),t=l.next,u=l.next;else if((t=l)===u){a?1===a?il(t=al(nl(t),e,n),e,n,i,r,s,2):2===a&&ol(t,e,n,i,r,s):il(nl(t),e,n,i,r,s,1);break}}function rl(t){const e=t.prev,n=t,i=t.next;if(fl(e,n,i)>=0)return!1;const r=e.x,s=n.x,a=i.x,o=e.y,l=n.y,u=i.y,h=r<s?r<a?r:a:s<a?s:a,c=o<l?o<u?o:u:l<u?l:u,A=r>s?r>a?r:a:s>a?s:a,d=o>l?o>u?o:u:l>u?l:u;let p=i.next;for(;p!==e;){if(p.x>=h&&p.x<=A&&p.y>=c&&p.y<=d&&dl(r,o,s,l,a,u,p.x,p.y)&&fl(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function sl(t,e,n,i){const r=t.prev,s=t,a=t.next;if(fl(r,s,a)>=0)return!1;const o=r.x,l=s.x,u=a.x,h=r.y,c=s.y,A=a.y,d=o<l?o<u?o:u:l<u?l:u,p=h<c?h<A?h:A:c<A?c:A,f=o>l?o>u?o:u:l>u?l:u,m=h>c?h>A?h:A:c>A?c:A,g=cl(d,p,e,n,i),y=cl(f,m,e,n,i);let v=t.prevZ,_=t.nextZ;for(;v&&v.z>=g&&_&&_.z<=y;){if(v.x>=d&&v.x<=f&&v.y>=p&&v.y<=m&&v!==r&&v!==a&&dl(o,h,l,c,u,A,v.x,v.y)&&fl(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,_.x>=d&&_.x<=f&&_.y>=p&&_.y<=m&&_!==r&&_!==a&&dl(o,h,l,c,u,A,_.x,_.y)&&fl(_.prev,_,_.next)>=0)return!1;_=_.nextZ}for(;v&&v.z>=g;){if(v.x>=d&&v.x<=f&&v.y>=p&&v.y<=m&&v!==r&&v!==a&&dl(o,h,l,c,u,A,v.x,v.y)&&fl(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;_&&_.z<=y;){if(_.x>=d&&_.x<=f&&_.y>=p&&_.y<=m&&_!==r&&_!==a&&dl(o,h,l,c,u,A,_.x,_.y)&&fl(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function al(t,e,n){let i=t;do{const r=i.prev,s=i.next.next;!ml(r,s)&&gl(r,i,i.next,s)&&_l(r,s)&&_l(s,r)&&(e.push(r.i/n|0),e.push(i.i/n|0),e.push(s.i/n|0),Sl(i),Sl(i.next),i=t=s),i=i.next}while(i!==t);return nl(i)}function ol(t,e,n,i,r,s){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.i!==t.i&&pl(a,t)){let o=xl(a,t);return a=nl(a,a.next),o=nl(o,o.next),il(a,e,n,i,r,s,0),void il(o,e,n,i,r,s,0)}t=t.next}a=a.next}while(a!==t)}function ll(t,e){return t.x-e.x}function ul(t,e){const n=function(t,e){let n,i=e,r=-1/0;const s=t.x,a=t.y;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){const t=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=s&&t>r&&(r=t,n=i.x<i.next.x?i:i.next,t===s))return n}i=i.next}while(i!==e);if(!n)return null;const o=n,l=n.x,u=n.y;let h,c=1/0;i=n;do{s>=i.x&&i.x>=l&&s!==i.x&&dl(a<u?s:r,a,l,u,a<u?r:s,a,i.x,i.y)&&(h=Math.abs(a-i.y)/(s-i.x),_l(i,t)&&(h<c||h===c&&(i.x>n.x||i.x===n.x&&hl(n,i)))&&(n=i,c=h)),i=i.next}while(i!==o);return n}(t,e);if(!n)return e;const i=xl(n,t);return nl(i,i.next),nl(n,n.next)}function hl(t,e){return fl(t.prev,t,e.prev)<0&&fl(e.next,t,t.next)<0}function cl(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Al(t){let e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function dl(t,e,n,i,r,s,a,o){return(r-a)*(e-o)>=(t-a)*(s-o)&&(t-a)*(i-o)>=(n-a)*(e-o)&&(n-a)*(s-o)>=(r-a)*(i-o)}function pl(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&gl(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(_l(t,e)&&_l(e,t)&&function(t,e){let n=t,i=!1;const r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{n.y>s!=n.next.y>s&&n.next.y!==n.y&&r<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)&&(fl(t.prev,t,e.prev)||fl(t,e.prev,e))||ml(t,e)&&fl(t.prev,t,t.next)>0&&fl(e.prev,e,e.next)>0)}function fl(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function ml(t,e){return t.x===e.x&&t.y===e.y}function gl(t,e,n,i){const r=vl(fl(t,e,n)),s=vl(fl(t,e,i)),a=vl(fl(n,i,t)),o=vl(fl(n,i,e));return r!==s&&a!==o||(!(0!==r||!yl(t,n,e))||(!(0!==s||!yl(t,i,e))||(!(0!==a||!yl(n,t,i))||!(0!==o||!yl(n,e,i)))))}function yl(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function vl(t){return t>0?1:t<0?-1:0}function _l(t,e){return fl(t.prev,t,t.next)<0?fl(t,e,t.next)>=0&&fl(t,t.prev,e)>=0:fl(t,e,t.prev)<0||fl(t,t.next,e)<0}function xl(t,e){const n=new Ml(t.i,t.x,t.y),i=new Ml(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,s.next=i,i.prev=s,i}function bl(t,e,n,i){const r=new Ml(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Sl(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ml(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class wl{static area(t){const e=t.length;let n=0;for(let i=e-1,r=0;r<e;i=r++)n+=t[i].x*t[r].y-t[r].x*t[i].y;return.5*n}static isClockWise(t){return wl.area(t)<0}static triangulateShape(t,e){const n=[],i=[],r=[];Tl(t),El(n,t);let s=t.length;e.forEach(Tl);for(let t=0;t<e.length;t++)i.push(s),s+=e[t].length,El(n,e[t]);const a=tl(n,i);for(let t=0;t<a.length;t+=3)r.push(a.slice(t,t+3));return r}}function Tl(t){const e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function El(t,e){for(let n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}class Cl extends Gi{constructor(t=new Jo([new Ee(.5,.5),new Ee(-.5,.5),new Ee(-.5,-.5),new Ee(.5,-.5)]),e={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];const n=this,i=[],r=[];for(let e=0,n=t.length;e<n;e++){s(t[e])}function s(t){const s=[],a=void 0!==e.curveSegments?e.curveSegments:12,o=void 0!==e.steps?e.steps:1,l=void 0!==e.depth?e.depth:1;let u=void 0===e.bevelEnabled||e.bevelEnabled,h=void 0!==e.bevelThickness?e.bevelThickness:.2,c=void 0!==e.bevelSize?e.bevelSize:h-.1,A=void 0!==e.bevelOffset?e.bevelOffset:0,d=void 0!==e.bevelSegments?e.bevelSegments:3;const p=e.extrudePath,f=void 0!==e.UVGenerator?e.UVGenerator:Rl;let m,g,y,v,_,x=!1;p&&(m=p.getSpacedPoints(o),x=!0,u=!1,g=p.computeFrenetFrames(o,!1),y=new en,v=new en,_=new en),u||(d=0,h=0,c=0,A=0);const b=t.extractPoints(a);let S=b.shape;const M=b.holes;if(!wl.isClockWise(S)){S=S.reverse();for(let t=0,e=M.length;t<e;t++){const e=M[t];wl.isClockWise(e)&&(M[t]=e.reverse())}}const w=wl.triangulateShape(S,M),T=S;for(let t=0,e=M.length;t<e;t++){const e=M[t];S=S.concat(e)}function E(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().addScaledVector(e,n)}const C=S.length,R=w.length;function N(t,e,n){let i,r,s;const a=t.x-e.x,o=t.y-e.y,l=n.x-t.x,u=n.y-t.y,h=a*a+o*o,c=a*u-o*l;if(Math.abs(c)>Number.EPSILON){const c=Math.sqrt(h),A=Math.sqrt(l*l+u*u),d=e.x-o/c,p=e.y+a/c,f=((n.x-u/A-d)*u-(n.y+l/A-p)*l)/(a*u-o*l);i=d+a*f-t.x,r=p+o*f-t.y;const m=i*i+r*r;if(m<=2)return new Ee(i,r);s=Math.sqrt(m/2)}else{let t=!1;a>Number.EPSILON?l>Number.EPSILON&&(t=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(t=!0):Math.sign(o)===Math.sign(u)&&(t=!0),t?(i=-o,r=a,s=Math.sqrt(h)):(i=a,r=o,s=Math.sqrt(h/2))}return new Ee(i/s,r/s)}const P=[];for(let t=0,e=T.length,n=e-1,i=t+1;t<e;t++,n++,i++)n===e&&(n=0),i===e&&(i=0),P[t]=N(T[t],T[n],T[i]);const D=[];let I,L=P.concat();for(let t=0,e=M.length;t<e;t++){const e=M[t];I=[];for(let t=0,n=e.length,i=n-1,r=t+1;t<n;t++,i++,r++)i===n&&(i=0),r===n&&(r=0),I[t]=N(e[t],e[i],e[r]);D.push(I),L=L.concat(I)}for(let t=0;t<d;t++){const e=t/d,n=h*Math.cos(e*Math.PI/2),i=c*Math.sin(e*Math.PI/2)+A;for(let t=0,e=T.length;t<e;t++){const e=E(T[t],P[t],i);O(e.x,e.y,-n)}for(let t=0,e=M.length;t<e;t++){const e=M[t];I=D[t];for(let t=0,r=e.length;t<r;t++){const r=E(e[t],I[t],i);O(r.x,r.y,-n)}}}const B=c+A;for(let t=0;t<C;t++){const e=u?E(S[t],L[t],B):S[t];x?(v.copy(g.normals[0]).multiplyScalar(e.x),y.copy(g.binormals[0]).multiplyScalar(e.y),_.copy(m[0]).add(v).add(y),O(_.x,_.y,_.z)):O(e.x,e.y,0)}for(let t=1;t<=o;t++)for(let e=0;e<C;e++){const n=u?E(S[e],L[e],B):S[e];x?(v.copy(g.normals[t]).multiplyScalar(n.x),y.copy(g.binormals[t]).multiplyScalar(n.y),_.copy(m[t]).add(v).add(y),O(_.x,_.y,_.z)):O(n.x,n.y,l/o*t)}for(let t=d-1;t>=0;t--){const e=t/d,n=h*Math.cos(e*Math.PI/2),i=c*Math.sin(e*Math.PI/2)+A;for(let t=0,e=T.length;t<e;t++){const e=E(T[t],P[t],i);O(e.x,e.y,l+n)}for(let t=0,e=M.length;t<e;t++){const e=M[t];I=D[t];for(let t=0,r=e.length;t<r;t++){const r=E(e[t],I[t],i);x?O(r.x,r.y+m[o-1].y,m[o-1].x+n):O(r.x,r.y,l+n)}}}function U(t,e){let n=t.length;for(;--n>=0;){const i=n;let r=n-1;r<0&&(r=t.length-1);for(let t=0,n=o+2*d;t<n;t++){const n=C*t,s=C*(t+1);k(e+i+n,e+r+n,e+r+s,e+i+s)}}}function O(t,e,n){s.push(t),s.push(e),s.push(n)}function F(t,e,r){z(t),z(e),z(r);const s=i.length/3,a=f.generateTopUV(n,i,s-3,s-2,s-1);q(a[0]),q(a[1]),q(a[2])}function k(t,e,r,s){z(t),z(e),z(s),z(e),z(r),z(s);const a=i.length/3,o=f.generateSideWallUV(n,i,a-6,a-3,a-2,a-1);q(o[0]),q(o[1]),q(o[3]),q(o[1]),q(o[2]),q(o[3])}function z(t){i.push(s[3*t+0]),i.push(s[3*t+1]),i.push(s[3*t+2])}function q(t){r.push(t.x),r.push(t.y)}!function(){const t=i.length/3;if(u){let t=0,e=C*t;for(let t=0;t<R;t++){const n=w[t];F(n[2]+e,n[1]+e,n[0]+e)}t=o+2*d,e=C*t;for(let t=0;t<R;t++){const n=w[t];F(n[0]+e,n[1]+e,n[2]+e)}}else{for(let t=0;t<R;t++){const e=w[t];F(e[2],e[1],e[0])}for(let t=0;t<R;t++){const e=w[t];F(e[0]+C*o,e[1]+C*o,e[2]+C*o)}}n.addGroup(t,i.length/3-t,0)}(),function(){const t=i.length/3;let e=0;U(T,e),e+=T.length;for(let t=0,n=M.length;t<n;t++){const n=M[t];U(n,e),e+=n.length}n.addGroup(t,i.length/3-t,1)}()}this.setAttribute("position",new Li(i,3)),this.setAttribute("uv",new Li(r,2)),this.computeVertexNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){const t=super.toJSON();return function(t,e,n){if(n.shapes=[],Array.isArray(t))for(let e=0,i=t.length;e<i;e++){const i=t[e];n.shapes.push(i.uuid)}else n.shapes.push(t.uuid);n.options=Object.assign({},e),void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON());return n}(this.parameters.shapes,this.parameters.options,t)}static fromJSON(t,e){const n=[];for(let i=0,r=t.shapes.length;i<r;i++){const r=e[t.shapes[i]];n.push(r)}const i=t.options.extrudePath;return void 0!==i&&(t.options.extrudePath=(new Yo[i.type]).fromJSON(i)),new Cl(n,t.options)}}const Rl={generateTopUV:function(t,e,n,i,r){const s=e[3*n],a=e[3*n+1],o=e[3*i],l=e[3*i+1],u=e[3*r],h=e[3*r+1];return[new Ee(s,a),new Ee(o,l),new Ee(u,h)]},generateSideWallUV:function(t,e,n,i,r,s){const a=e[3*n],o=e[3*n+1],l=e[3*n+2],u=e[3*i],h=e[3*i+1],c=e[3*i+2],A=e[3*r],d=e[3*r+1],p=e[3*r+2],f=e[3*s],m=e[3*s+1],g=e[3*s+2];return Math.abs(o-h)<Math.abs(a-u)?[new Ee(a,1-l),new Ee(u,1-c),new Ee(A,1-p),new Ee(f,1-g)]:[new Ee(o,1-l),new Ee(h,1-c),new Ee(d,1-p),new Ee(m,1-g)]}};let Nl=class t extends Gi{constructor(t=1,e=32,n=16,i=0,r=2*Math.PI,s=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:s,thetaLength:a},e=Math.max(3,Math.floor(e)),n=Math.max(2,Math.floor(n));const o=Math.min(s+a,Math.PI);let l=0;const u=[],h=new en,c=new en,A=[],d=[],p=[],f=[];for(let A=0;A<=n;A++){const m=[],g=A/n;let y=0;0===A&&0===s?y=.5/e:A===n&&o===Math.PI&&(y=-.5/e);for(let n=0;n<=e;n++){const o=n/e;h.x=-t*Math.cos(i+o*r)*Math.sin(s+g*a),h.y=t*Math.cos(s+g*a),h.z=t*Math.sin(i+o*r)*Math.sin(s+g*a),d.push(h.x,h.y,h.z),c.copy(h).normalize(),p.push(c.x,c.y,c.z),f.push(o+y,1-g),m.push(l++)}u.push(m)}for(let t=0;t<n;t++)for(let i=0;i<e;i++){const e=u[t][i+1],r=u[t][i],a=u[t+1][i],l=u[t+1][i+1];(0!==t||s>0)&&A.push(e,r,l),(t!==n-1||o<Math.PI)&&A.push(r,a,l)}this.setIndex(A),this.setAttribute("position",new Li(d,3)),this.setAttribute("normal",new Li(p,3)),this.setAttribute("uv",new Li(f,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(e){return new t(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}};class Pl extends Gi{constructor(t=new Wo(new en(-1,-1,0),new en(-1,1,0),new en(1,1,0)),e=64,n=1,i=8,r=!1){super(),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:i,closed:r};const s=t.computeFrenetFrames(e,r);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;const a=new en,o=new en,l=new Ee;let u=new en;const h=[],c=[],A=[],d=[];function p(r){u=t.getPointAt(r/e,u);const l=s.normals[r],A=s.binormals[r];for(let t=0;t<=i;t++){const e=t/i*Math.PI*2,r=Math.sin(e),s=-Math.cos(e);o.x=s*l.x+r*A.x,o.y=s*l.y+r*A.y,o.z=s*l.z+r*A.z,o.normalize(),c.push(o.x,o.y,o.z),a.x=u.x+n*o.x,a.y=u.y+n*o.y,a.z=u.z+n*o.z,h.push(a.x,a.y,a.z)}}!function(){for(let t=0;t<e;t++)p(t);p(!1===r?e:0),function(){for(let t=0;t<=e;t++)for(let n=0;n<=i;n++)l.x=t/e,l.y=n/i,A.push(l.x,l.y)}(),function(){for(let t=1;t<=e;t++)for(let e=1;e<=i;e++){const n=(i+1)*(t-1)+(e-1),r=(i+1)*t+(e-1),s=(i+1)*t+e,a=(i+1)*(t-1)+e;d.push(n,r,a),d.push(r,s,a)}}()}(),this.setIndex(d),this.setAttribute("position",new Li(h,3)),this.setAttribute("normal",new Li(c,3)),this.setAttribute("uv",new Li(A,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){const t=super.toJSON();return t.path=this.parameters.path.toJSON(),t}static fromJSON(t){return new Pl((new Yo[t.path.type]).fromJSON(t.path),t.tubularSegments,t.radius,t.radialSegments,t.closed)}}class Dl extends Gi{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},null!==t){const e=[],n=new Set,i=new en,r=new en;if(null!==t.index){const s=t.attributes.position,a=t.index;let o=t.groups;0===o.length&&(o=[{start:0,count:a.count,materialIndex:0}]);for(let t=0,l=o.length;t<l;++t){const l=o[t],u=l.start;for(let t=u,o=u+l.count;t<o;t+=3)for(let o=0;o<3;o++){const l=a.getX(t+o),u=a.getX(t+(o+1)%3);i.fromBufferAttribute(s,l),r.fromBufferAttribute(s,u),!0===Il(i,r,n)&&(e.push(i.x,i.y,i.z),e.push(r.x,r.y,r.z))}}}else{const s=t.attributes.position;for(let t=0,a=s.count/3;t<a;t++)for(let a=0;a<3;a++){const o=3*t+a,l=3*t+(a+1)%3;i.fromBufferAttribute(s,o),r.fromBufferAttribute(s,l),!0===Il(i,r,n)&&(e.push(i.x,i.y,i.z),e.push(r.x,r.y,r.z))}}this.setAttribute("position",new Li(e,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}function Il(t,e,n){const i=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`,r=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`;return!0!==n.has(i)&&!0!==n.has(r)&&(n.add(i),n.add(r),!0)}let Ll=class extends Ei{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Mi(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Mi(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Ee(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Gn,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}};const Bl={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};class Ul{constructor(t,e,n){const i=this;let r,s=!1,a=0,o=0;const l=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){o++,!1===s&&void 0!==i.onStart&&i.onStart(t,a,o),s=!0},this.itemEnd=function(t){a++,void 0!==i.onProgress&&i.onProgress(t,a,o),a===o&&(s=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(t){void 0!==i.onError&&i.onError(t)},this.resolveURL=function(t){return r?r(t):t},this.setURLModifier=function(t){return r=t,this},this.addHandler=function(t,e){return l.push(t,e),this},this.removeHandler=function(t){const e=l.indexOf(t);return-1!==e&&l.splice(e,2),this},this.getHandler=function(t){for(let e=0,n=l.length;e<n;e+=2){const n=l[e],i=l[e+1];if(n.global&&(n.lastIndex=0),n.test(t))return i}return null}}}const Ol=new Ul;class Fl{constructor(t){this.manager=void 0!==t?t:Ol,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){const n=this;return new Promise((function(i,r){n.load(t,i,e,r)}))}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}Fl.DEFAULT_MATERIAL_NAME="__DEFAULT";class kl extends Fl{constructor(t){super(t)}load(t,e,n,i){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,s=Bl.get(t);if(void 0!==s)return r.manager.itemStart(t),setTimeout((function(){e&&e(s),r.manager.itemEnd(t)}),0),s;const a=Pe("img");function o(){u(),Bl.add(t,this),e&&e(this),r.manager.itemEnd(t)}function l(e){u(),i&&i(e),r.manager.itemError(t),r.manager.itemEnd(t)}function u(){a.removeEventListener("load",o,!1),a.removeEventListener("error",l,!1)}return a.addEventListener("load",o,!1),a.addEventListener("error",l,!1),"data:"!==t.slice(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(t),a.src=t,a}}class zl extends Fl{constructor(t){super(t)}load(t,e,n,i){const r=new Ye,s=new kl(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(t,(function(t){r.image=t,r.needsUpdate=!0,void 0!==e&&e(r)}),n,i),r}}let ql=class extends si{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new Mi(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),void 0!==this.target&&(e.object.target=this.target.uuid),e}};const Gl=new Dn,Vl=new en,Hl=new en;let jl=class{constructor(t){this.camera=t,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ee(512,512),this.map=null,this.mapPass=null,this.matrix=new Dn,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Sr,this._frameExtents=new Ee(1,1),this._viewportCount=1,this._viewports=[new Qe(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,n=this.matrix;Vl.setFromMatrixPosition(t.matrixWorld),e.position.copy(Vl),Hl.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(Hl),e.updateMatrixWorld(),Gl.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Gl),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(Gl)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.intensity=t.intensity,this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const t={};return 1!==this.intensity&&(t.intensity=this.intensity),0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}},Wl=class extends jl{constructor(){super(new kr(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}};class Xl extends Gi{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}toJSON(){const t=super.toJSON();return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}class Yl{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Ql(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=Ql();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}function Ql(){return performance.now()}let $l=class extends fo{constructor(t,e,n=1){super(t,e),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){const e=super.clone(t);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(t){const e=super.toJSON(t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}};const Zl=new Dn;function Kl(t,e){return t.distance-e.distance}function Jl(t,e,n,i){let r=!0;if(t.layers.test(e.layers)){!1===t.raycast(e,n)&&(r=!1)}if(!0===r&&!0===i){const i=t.children;for(let t=0,r=i.length;t<r;t++)Jl(i[t],e,n,!0)}}class tu{constructor(t=1,e=0,n=0){return this.radius=t,this.phi=e,this.theta=n,this}set(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){const t=1e-6;return this.phi=Math.max(t,Math.min(Math.PI-t,this.phi)),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(xe(e/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}const eu=new en,nu=new en;class iu{constructor(){this.type="ShapePath",this.color=new Mi,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new $o,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,n,i){return this.currentPath.quadraticCurveTo(t,e,n,i),this}bezierCurveTo(t,e,n,i,r,s){return this.currentPath.bezierCurveTo(t,e,n,i,r,s),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function e(t,e){const n=e.length;let i=!1;for(let r=n-1,s=0;s<n;r=s++){let n=e[r],a=e[s],o=a.x-n.x,l=a.y-n.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(n=e[s],o=-o,a=e[r],l=-l),t.y<n.y||t.y>a.y)continue;if(t.y===n.y){if(t.x===n.x)return!0}else{const e=l*(t.x-n.x)-o*(t.y-n.y);if(0===e)return!0;if(e<0)continue;i=!i}}else{if(t.y!==n.y)continue;if(a.x<=t.x&&t.x<=n.x||n.x<=t.x&&t.x<=a.x)return!0}}return i}const n=wl.isClockWise,i=this.subPaths;if(0===i.length)return[];let r,s,a;const o=[];if(1===i.length)return s=i[0],a=new Jo,a.curves=s.curves,o.push(a),o;let l=!n(i[0].getPoints());l=t?!l:l;const u=[],h=[];let c,A,d=[],p=0;h[p]=void 0,d[p]=[];for(let e=0,a=i.length;e<a;e++)s=i[e],c=s.getPoints(),r=n(c),r=t?!r:r,r?(!l&&h[p]&&p++,h[p]={s:new Jo,p:c},h[p].s.curves=s.curves,l&&p++,d[p]=[]):d[p].push({h:s,p:c[0]});if(!h[0])return function(t){const e=[];for(let n=0,i=t.length;n<i;n++){const i=t[n],r=new Jo;r.curves=i.curves,e.push(r)}return e}(i);if(h.length>1){let t=!1,n=0;for(let t=0,e=h.length;t<e;t++)u[t]=[];for(let i=0,r=h.length;i<r;i++){const r=d[i];for(let s=0;s<r.length;s++){const a=r[s];let o=!0;for(let r=0;r<h.length;r++)e(a.p,h[r].p)&&(i!==r&&n++,o?(o=!1,u[r].push(a)):t=!0);o&&u[i].push(a)}}n>0&&!1===t&&(d=u)}for(let t=0,e=h.length;t<e;t++){a=h[t].s,o.push(a),A=d[t];for(let t=0,e=A.length;t<e;t++)a.holes.push(A[t].h)}return o}}class ru extends fe{constructor(t,e=null){super(),this.object=t,this.domElement=e,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(){}disconnect(){}dispose(){}update(){}}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:s}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=s);const su=new en,au=new Dn,ou=new Dn,lu=new en,uu=new en;function hu(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var cu="object"==typeof global&&global&&global.Object===Object&&global,Au="object"==typeof self&&self&&self.Object===Object&&self,du=cu||Au||Function("return this")(),pu=function(){return du.Date.now()},fu=/\s/;var mu=/^\s+/;function gu(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&fu.test(t.charAt(e)););return e}(t)+1).replace(mu,""):t}var yu=du.Symbol,vu=Object.prototype,_u=vu.hasOwnProperty,xu=vu.toString,bu=yu?yu.toStringTag:void 0;var Su=Object.prototype.toString;var Mu=yu?yu.toStringTag:void 0;function wu(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Mu&&Mu in Object(t)?function(t){var e=_u.call(t,bu),n=t[bu];try{t[bu]=void 0;var i=!0}catch(t){}var r=xu.call(t);return i&&(e?t[bu]=n:delete t[bu]),r}(t):function(t){return Su.call(t)}(t)}var Tu=/^[-+]0x[0-9a-f]+$/i,Eu=/^0b[01]+$/i,Cu=/^0o[0-7]+$/i,Ru=parseInt;function Nu(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return null!=t&&"object"==typeof t}(t)&&"[object Symbol]"==wu(t)}(t))return NaN;if(hu(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=hu(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=gu(t);var n=Eu.test(t);return n||Cu.test(t)?Ru(t.slice(2),n?2:8):Tu.test(t)?NaN:+t}var Pu=Math.max,Du=Math.min;function Iu(t,e,n){var i,r,s,a,o,l,u=0,h=!1,c=!1,A=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function d(e){var n=i,s=r;return i=r=void 0,u=e,a=t.apply(s,n)}function p(t){var n=t-l;return void 0===l||n>=e||n<0||c&&t-u>=s}function f(){var t=pu();if(p(t))return m(t);o=setTimeout(f,function(t){var n=e-(t-l);return c?Du(n,s-(t-u)):n}(t))}function m(t){return o=void 0,A&&i?d(t):(i=r=void 0,a)}function g(){var t=pu(),n=p(t);if(i=arguments,r=this,l=t,n){if(void 0===o)return function(t){return u=t,o=setTimeout(f,e),h?d(t):a}(l);if(c)return clearTimeout(o),o=setTimeout(f,e),d(l)}return void 0===o&&(o=setTimeout(f,e)),a}return e=Nu(e)||0,hu(n)&&(h=!!n.leading,s=(c="maxWait"in n)?Pu(Nu(n.maxWait)||0,e):s,A="trailing"in n?!!n.trailing:A),g.cancel=function(){void 0!==o&&clearTimeout(o),u=0,i=l=r=o=void 0},g.flush=function(){return void 0===o?a:m(pu())},g}function Lu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function Bu(t,e,n){return Object.defineProperty(t,"prototype",{writable:!1}),t}function Uu(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(t)).next,0===e);else for(;!(l=(i=s.call(n)).done)&&(o.push(i.value),o.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return o}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Lu(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lu(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Ou=Bu((function t(e,n){var i=n.default,r=void 0===i?null:i,s=n.triggerUpdate,a=void 0===s||s,o=n.onChange,l=void 0===o?function(t,e){}:o;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=e,this.defaultVal=r,this.triggerUpdate=a,this.onChange=l}));function Fu(t){var e=t.stateInit,n=void 0===e?function(){return{}}:e,i=t.props,r=void 0===i?{}:i,s=t.methods,a=void 0===s?{}:s,o=t.aliases,l=void 0===o?{}:o,u=t.init,h=void 0===u?function(){}:u,c=t.update,A=void 0===c?function(){}:c,d=Object.keys(r).map((function(t){return new Ou(t,r[t])}));return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object.assign({},n instanceof Function?n(t):n,{initialised:!1}),i={};function r(e){return s(e,t),o(),r}var s=function(t,n){h.call(r,t,e,n),e.initialised=!0},o=Iu((function(){e.initialised&&(A.call(r,e,i),i={})}),1);return d.forEach((function(t){r[t.name]=function(t){var n=t.name,s=t.triggerUpdate,a=void 0!==s&&s,l=t.onChange,u=void 0===l?function(t,e){}:l,h=t.defaultVal,c=void 0===h?null:h;return function(t){var s=e[n];if(!arguments.length)return s;var l=void 0===t?c:t;return e[n]=l,u.call(r,l,e,s),!i.hasOwnProperty(n)&&(i[n]=s),a&&o(),r}}(t)})),Object.keys(a).forEach((function(t){r[t]=function(){for(var n,i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return(n=a[t]).call.apply(n,[r,e].concat(s))}})),Object.entries(l).forEach((function(t){var e=Uu(t,2),n=e[0],i=e[1];return r[n]=r[i]})),r.resetProps=function(){return d.forEach((function(t){r[t.name](t.defaultVal)})),r},r.resetProps(),e._rerender=o,r}}var ku,zu=Object.freeze({Linear:Object.freeze({None:function(t){return t},In:function(t){return t},Out:function(t){return t},InOut:function(t){return t}}),Quadratic:Object.freeze({In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}}),Cubic:Object.freeze({In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}}),Quartic:Object.freeze({In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}}),Quintic:Object.freeze({In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}}),Sinusoidal:Object.freeze({In:function(t){return 1-Math.sin((1-t)*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.sin(Math.PI*(.5-t)))}}),Exponential:Object.freeze({In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}}),Circular:Object.freeze({In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}}),Elastic:Object.freeze({In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}}),Back:Object.freeze({In:function(t){var e=1.70158;return 1===t?1:t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return 0===t?0:--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}}),Bounce:Object.freeze({In:function(t){return 1-zu.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*zu.Bounce.In(2*t):.5*zu.Bounce.Out(2*t-1)+.5}}),generatePow:function(t){return void 0===t&&(t=4),t=(t=t<Number.EPSILON?Number.EPSILON:t)>1e4?1e4:t,{In:function(e){return Math.pow(e,t)},Out:function(e){return 1-Math.pow(1-e,t)},InOut:function(e){return e<.5?Math.pow(2*e,t)/2:(1-Math.pow(2-2*e,t))/2+.5}}}}),qu=function(){return performance.now()},Gu=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map((function(e){return t._tweens[e]}))},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var i=0,r=e;i<r.length;i++){var s=r[i];null===(t=s._group)||void 0===t||t.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},t.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=0,i=t;n<i.length;n++){var r=i[n];r._group=void 0,delete this._tweens[r.getId()],delete this._tweensAddedDuringUpdate[r.getId()]}},t.prototype.allStopped=function(){return this.getAll().every((function(t){return!t.isPlaying()}))},t.prototype.update=function(t,e){void 0===t&&(t=qu()),void 0===e&&(e=!0);var n=Object.keys(this._tweens);if(0!==n.length)for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<n.length;i++){var r=this._tweens[n[i]],s=!e;r&&!1===r.update(t,s)&&!e&&this.remove(r)}n=Object.keys(this._tweensAddedDuringUpdate)}},t}(),Vu={Linear:function(t,e){var n=t.length-1,i=n*e,r=Math.floor(i),s=Vu.Utils.Linear;return e<0?s(t[0],t[1],i):e>1?s(t[n],t[n-1],n-i):s(t[r],t[r+1>n?n:r+1],i-r)},Bezier:function(t,e){for(var n=0,i=t.length-1,r=Math.pow,s=Vu.Utils.Bernstein,a=0;a<=i;a++)n+=r(1-e,i-a)*r(e,a)*t[a]*s(i,a);return n},CatmullRom:function(t,e){var n=t.length-1,i=n*e,r=Math.floor(i),s=Vu.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(r=Math.floor(i=n*(1+e))),s(t[(r-1+n)%n],t[r],t[(r+1)%n],t[(r+2)%n],i-r)):e<0?t[0]-(s(t[0],t[0],t[1],t[1],-i)-t[0]):e>1?t[n]-(s(t[n],t[n],t[n-1],t[n-1],i-n)-t[n]):s(t[r?r-1:0],t[r],t[n<r+1?n:r+1],t[n<r+2?n:r+2],i-r)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Bernstein:function(t,e){var n=Vu.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:(ku=[1],function(t){var e=1;if(ku[t])return ku[t];for(var n=t;n>1;n--)e*=n;return ku[t]=e,e}),CatmullRom:function(t,e,n,i,r){var s=.5*(n-t),a=.5*(i-e),o=r*r;return(2*e-2*n+s+a)*(r*o)+(-3*e+3*n-2*s-a)*o+s*r+e}}},Hu=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),ju=new Gu,Wu=function(){function t(t,e){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=zu.Linear.None,this._interpolationFunction=Vu.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Hu.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,"object"==typeof e?(this._group=e,e.add(this)):!0===e&&(this._group=ju,ju.add(this))}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.getDuration=function(){return this._duration},t.prototype.to=function(t,e){if(void 0===e&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e<0?0:e,this},t.prototype.duration=function(t){return void 0===t&&(t=1e3),this._duration=t<0?0:t,this},t.prototype.dynamic=function(t){return void 0===t&&(t=!1),this._isDynamic=t,this},t.prototype.start=function(t,e){if(void 0===t&&(t=qu()),void 0===e&&(e=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed)for(var n in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var i={};for(var r in this._valuesEnd)i[r]=this._valuesEnd[r];this._valuesEnd=i}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},t.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},t.prototype._setupProperties=function(t,e,n,i,r){for(var s in n){var a=t[s],o=Array.isArray(a),l=o?"array":typeof a,u=!o&&Array.isArray(n[s]);if("undefined"!==l&&"function"!==l){if(u){if(0===(m=n[s]).length)continue;for(var h=[a],c=0,A=m.length;c<A;c+=1){var d=this._handleRelativeValue(a,m[c]);if(isNaN(d)){u=!1,console.warn("Found invalid interpolation list. Skipping.");break}h.push(d)}u&&(n[s]=h)}if("object"!==l&&!o||!a||u)(void 0===e[s]||r)&&(e[s]=a),o||(e[s]*=1),i[s]=u?n[s].slice().reverse():e[s]||0;else{e[s]=o?[]:{};var p=a;for(var f in p)e[s][f]=p[f];i[s]=o?[]:{};var m=n[s];if(!this._isDynamic){var g={};for(var f in m)g[f]=m[f];n[s]=m=g}this._setupProperties(p,e[s],m,i[s],r)}}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},t.prototype.pause=function(t){return void 0===t&&(t=qu()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=t),this},t.prototype.resume=function(t){return void 0===t&&(t=qu()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this):this},t.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},t.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},t.prototype.remove=function(){var t;return null===(t=this._group)||void 0===t||t.remove(this),this},t.prototype.delay=function(t){return void 0===t&&(t=0),this._delayTime=t,this},t.prototype.repeat=function(t){return void 0===t&&(t=0),this._initialRepeat=t,this._repeat=t,this},t.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},t.prototype.yoyo=function(t){return void 0===t&&(t=!1),this._yoyo=t,this},t.prototype.easing=function(t){return void 0===t&&(t=zu.Linear.None),this._easingFunction=t,this},t.prototype.interpolation=function(t){return void 0===t&&(t=Vu.Linear),this._interpolationFunction=t,this},t.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},t.prototype.onStart=function(t){return this._onStartCallback=t,this},t.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},t.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},t.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},t.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},t.prototype.onStop=function(t){return this._onStopCallback=t,this},t.prototype.update=function(e,n){var i,r,s=this;if(void 0===e&&(e=qu()),void 0===n&&(n=t.autoStartOnUpdate),this._isPaused)return!0;if(!this._goToEnd&&!this._isPlaying){if(!n)return!1;this.start(e,!0)}if(this._goToEnd=!1,e<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),!1===this._onEveryStartCallbackFired&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=e-this._startTime,o=this._duration+(null!==(i=this._repeatDelayTime)&&void 0!==i?i:this._delayTime),l=this._duration+this._repeat*o,u=function(){if(0===s._duration)return 1;if(a>l)return 1;var t=Math.trunc(a/o),e=a-t*o,n=Math.min(e/s._duration,1);return 0===n&&a===s._duration?1:n}(),h=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,h),this._onUpdateCallback&&this._onUpdateCallback(this._object,u),0===this._duration||a>=this._duration){if(this._repeat>0){var c=Math.min(Math.trunc((a-this._duration)/o)+1,this._repeat);for(r in isFinite(this._repeat)&&(this._repeat-=c),this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[r]||(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=o*c,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var A=0,d=this._chainedTweens.length;A<d;A++)this._chainedTweens[A].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},t.prototype._updateProperties=function(t,e,n,i){for(var r in n)if(void 0!==e[r]){var s=e[r]||0,a=n[r],o=Array.isArray(t[r]),l=Array.isArray(a);!o&&l?t[r]=this._interpolationFunction(a,i):"object"==typeof a&&a?this._updateProperties(t[r],s,a,i):"number"==typeof(a=this._handleRelativeValue(s,a))&&(t[r]=s+(a-s)*i)}},t.prototype._handleRelativeValue=function(t,e){return"string"!=typeof e?e:"+"===e.charAt(0)||"-"===e.charAt(0)?t+parseFloat(e):parseFloat(e)},t.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],n=this._valuesEnd[t];this._valuesStartRepeat[t]="string"==typeof n?this._valuesStartRepeat[t]+parseFloat(n):this._valuesEnd[t],this._valuesEnd[t]=e},t.autoStartOnUpdate=!1,t}(),Xu=ju;function Yu(t,e,n=2){const i=e&&e.length,r=i?e[0]*n:t.length;let s=Qu(t,0,r,n,!0);const a=[];if(!s||s.next===s.prev)return a;let o,l,u;if(i&&(s=function(t,e,n,i){const r=[];for(let n=0,s=e.length;n<s;n++){const a=Qu(t,e[n]*i,n<s-1?e[n+1]*i:t.length,i,!1);a===a.next&&(a.steiner=!0),r.push(ah(a))}r.sort(nh);for(let t=0;t<r.length;t++)n=ih(r[t],n);return n}(t,e,s,n)),t.length>80*n){o=1/0,l=1/0;let e=-1/0,i=-1/0;for(let s=n;s<r;s+=n){const n=t[s],r=t[s+1];n<o&&(o=n),r<l&&(l=r),n>e&&(e=n),r>i&&(i=r)}u=Math.max(e-o,i-l),u=0!==u?32767/u:0}return Zu(s,a,n,o,l,u,0),a}function Qu(t,e,n,i,r){let s;if(r===function(t,e,n,i){let r=0;for(let s=e,a=n-i;s<n;s+=i)r+=(t[a]-t[s])*(t[s+1]+t[a+1]),a=s;return r}(t,e,n,i)>0)for(let r=e;r<n;r+=i)s=mh(r/i|0,t[r],t[r+1],s);else for(let r=n-i;r>=e;r-=i)s=mh(r/i|0,t[r],t[r+1],s);return s&&hh(s,s.next)&&(gh(s),s=s.next),s}function $u(t,e){if(!t)return t;e||(e=t);let n,i=t;do{if(n=!1,i.steiner||!hh(i,i.next)&&0!==uh(i.prev,i,i.next))i=i.next;else{if(gh(i),i=e=i.prev,i===i.next)break;n=!0}}while(n||i!==e);return e}function Zu(t,e,n,i,r,s,a){if(!t)return;!a&&s&&function(t,e,n,i){let r=t;do{0===r.z&&(r.z=sh(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){let e,n=1;do{let i,r=t;t=null;let s=null;for(e=0;r;){e++;let a=r,o=0;for(let t=0;t<n&&(o++,a=a.nextZ,a);t++);let l=n;for(;o>0||l>0&&a;)0!==o&&(0===l||!a||r.z<=a.z)?(i=r,r=r.nextZ,o--):(i=a,a=a.nextZ,l--),s?s.nextZ=i:t=i,i.prevZ=s,s=i;r=a}s.nextZ=null,n*=2}while(e>1)}(r)}(t,i,r,s);let o=t;for(;t.prev!==t.next;){const l=t.prev,u=t.next;if(s?Ju(t,i,r,s):Ku(t))e.push(l.i,t.i,u.i),gh(t),t=u.next,o=u.next;else if((t=u)===o){a?1===a?Zu(t=th($u(t),e),e,n,i,r,s,2):2===a&&eh(t,e,n,i,r,s):Zu($u(t),e,n,i,r,s,1);break}}}function Ku(t){const e=t.prev,n=t,i=t.next;if(uh(e,n,i)>=0)return!1;const r=e.x,s=n.x,a=i.x,o=e.y,l=n.y,u=i.y,h=r<s?r<a?r:a:s<a?s:a,c=o<l?o<u?o:u:l<u?l:u,A=r>s?r>a?r:a:s>a?s:a,d=o>l?o>u?o:u:l>u?l:u;let p=i.next;for(;p!==e;){if(p.x>=h&&p.x<=A&&p.y>=c&&p.y<=d&&oh(r,o,s,l,a,u,p.x,p.y)&&uh(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Ju(t,e,n,i){const r=t.prev,s=t,a=t.next;if(uh(r,s,a)>=0)return!1;const o=r.x,l=s.x,u=a.x,h=r.y,c=s.y,A=a.y,d=o<l?o<u?o:u:l<u?l:u,p=h<c?h<A?h:A:c<A?c:A,f=o>l?o>u?o:u:l>u?l:u,m=h>c?h>A?h:A:c>A?c:A,g=sh(d,p,e,n,i),y=sh(f,m,e,n,i);let v=t.prevZ,_=t.nextZ;for(;v&&v.z>=g&&_&&_.z<=y;){if(v.x>=d&&v.x<=f&&v.y>=p&&v.y<=m&&v!==r&&v!==a&&oh(o,h,l,c,u,A,v.x,v.y)&&uh(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,_.x>=d&&_.x<=f&&_.y>=p&&_.y<=m&&_!==r&&_!==a&&oh(o,h,l,c,u,A,_.x,_.y)&&uh(_.prev,_,_.next)>=0)return!1;_=_.nextZ}for(;v&&v.z>=g;){if(v.x>=d&&v.x<=f&&v.y>=p&&v.y<=m&&v!==r&&v!==a&&oh(o,h,l,c,u,A,v.x,v.y)&&uh(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;_&&_.z<=y;){if(_.x>=d&&_.x<=f&&_.y>=p&&_.y<=m&&_!==r&&_!==a&&oh(o,h,l,c,u,A,_.x,_.y)&&uh(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function th(t,e){let n=t;do{const i=n.prev,r=n.next.next;!hh(i,r)&&ch(i,n,n.next,r)&&ph(i,r)&&ph(r,i)&&(e.push(i.i,n.i,r.i),gh(n),gh(n.next),n=t=r),n=n.next}while(n!==t);return $u(n)}function eh(t,e,n,i,r,s){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.i!==t.i&&lh(a,t)){let o=fh(a,t);return a=$u(a,a.next),o=$u(o,o.next),Zu(a,e,n,i,r,s,0),void Zu(o,e,n,i,r,s,0)}t=t.next}a=a.next}while(a!==t)}function nh(t,e){return t.x-e.x}function ih(t,e){const n=function(t,e){let n=e;const i=t.x,r=t.y;let s,a=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){const t=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=i&&t>a&&(a=t,s=n.x<n.next.x?n:n.next,t===i))return s}n=n.next}while(n!==e);if(!s)return null;const o=s,l=s.x,u=s.y;let h=1/0;n=s;do{if(i>=n.x&&n.x>=l&&i!==n.x&&oh(r<u?i:a,r,l,u,r<u?a:i,r,n.x,n.y)){const e=Math.abs(r-n.y)/(i-n.x);ph(n,t)&&(e<h||e===h&&(n.x>s.x||n.x===s.x&&rh(s,n)))&&(s=n,h=e)}n=n.next}while(n!==o);return s}(t,e);if(!n)return e;const i=fh(n,t);return $u(i,i.next),$u(n,n.next)}function rh(t,e){return uh(t.prev,t,e.prev)<0&&uh(e.next,t,t.next)<0}function sh(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ah(t){let e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function oh(t,e,n,i,r,s,a,o){return(r-a)*(e-o)>=(t-a)*(s-o)&&(t-a)*(i-o)>=(n-a)*(e-o)&&(n-a)*(s-o)>=(r-a)*(i-o)}function lh(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&ch(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(ph(t,e)&&ph(e,t)&&function(t,e){let n=t,i=!1;const r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{n.y>s!=n.next.y>s&&n.next.y!==n.y&&r<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)&&(uh(t.prev,t,e.prev)||uh(t,e.prev,e))||hh(t,e)&&uh(t.prev,t,t.next)>0&&uh(e.prev,e,e.next)>0)}function uh(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function hh(t,e){return t.x===e.x&&t.y===e.y}function ch(t,e,n,i){const r=dh(uh(t,e,n)),s=dh(uh(t,e,i)),a=dh(uh(n,i,t)),o=dh(uh(n,i,e));return r!==s&&a!==o||(!(0!==r||!Ah(t,n,e))||(!(0!==s||!Ah(t,i,e))||(!(0!==a||!Ah(n,t,i))||!(0!==o||!Ah(n,e,i)))))}function Ah(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function dh(t){return t>0?1:t<0?-1:0}function ph(t,e){return uh(t.prev,t,t.next)<0?uh(t,e,t.next)>=0&&uh(t,t.prev,e)>=0:uh(t,e,t.prev)<0||uh(t,t.next,e)<0}function fh(t,e){const n=yh(t.i,t.x,t.y),i=yh(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,s.next=i,i.prev=s,i}function mh(t,e,n,i){const r=yh(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function gh(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function yh(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function vh(t){const e=[],n=[],i=t[0][0].length;let r=0,s=0;for(const a of t){for(const t of a)for(let n=0;n<i;n++)e.push(t[n]);s&&(r+=s,n.push(r)),s=a.length}return{vertices:e,holes:n,dimensions:i}}function _h(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function xh(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function bh(t){let e,n,i;function r(t,i,r=0,s=t.length){if(r<s){if(0!==e(i,i))return s;do{const e=r+s>>>1;n(t[e],i)<0?r=e+1:s=e}while(r<s)}return r}return 2!==t.length?(e=_h,n=(e,n)=>_h(t(e),n),i=(e,n)=>t(e)-n):(e=t===_h||t===xh?t:Sh,n=t,i=t),{left:r,center:function(t,e,n=0,s=t.length){const a=r(t,e,n,s-1);return a>n&&i(t[a-1],e)>-i(t[a],e)?a-1:a},right:function(t,i,r=0,s=t.length){if(r<s){if(0!==e(i,i))return s;do{const e=r+s>>>1;n(t[e],i)<=0?r=e+1:s=e}while(r<s)}return r}}}function Sh(){return 0}Xu.getAll.bind(Xu),Xu.removeAll.bind(Xu),Xu.add.bind(Xu),Xu.remove.bind(Xu),Xu.update.bind(Xu);const Mh=bh(_h).right;function wh(t,e){let n,i;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=i=e):(n>e&&(n=e),i<e&&(i=e)));else{let r=-1;for(let s of t)null!=(s=e(s,++r,t))&&(void 0===n?s>=s&&(n=i=s):(n>s&&(n=s),i<s&&(i=s)))}return[n,i]}bh((function(t){return null===t?NaN:+t})).center;class Th{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let i=0;i<this._n&&i<32;i++){const r=e[i],s=t+r,a=Math.abs(t)<Math.abs(r)?t-(s-r):r-(s-t);a&&(e[n++]=a),t=s}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,i,r=this._n,s=0;if(r>0){for(s=t[--r];r>0&&(e=s,n=t[--r],s=e+n,i=n-(s-e),!i););r>0&&(i<0&&t[r-1]<0||i>0&&t[r-1]>0)&&(n=2*i,e=s+n,n==e-s&&(s=e))}return s}}const Eh=Math.sqrt(50),Ch=Math.sqrt(10),Rh=Math.sqrt(2);function Nh(t,e,n){const i=(e-t)/Math.max(0,n),r=Math.floor(Math.log10(i)),s=i/Math.pow(10,r),a=s>=Eh?10:s>=Ch?5:s>=Rh?2:1;let o,l,u;return r<0?(u=Math.pow(10,-r)/a,o=Math.round(t*u),l=Math.round(e*u),o/u<t&&++o,l/u>e&&--l,u=-u):(u=Math.pow(10,r)*a,o=Math.round(t/u),l=Math.round(e/u),o*u<t&&++o,l*u>e&&--l),l<o&&.5<=n&&n<2?Nh(t,e,2*n):[o,l,u]}function Ph(t,e,n){return Nh(t=+t,e=+e,n=+n)[2]}function Dh(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function Ih(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),s=new Array(r);++i<r;)s[i]=t+i*n;return s}var Lh=1e-6,Bh=1e-12,Uh=Math.PI,Oh=Uh/2,Fh=Uh/4,kh=2*Uh,zh=180/Uh,qh=Uh/180,Gh=Math.abs,Vh=Math.atan,Hh=Math.atan2,jh=Math.cos,Wh=Math.ceil,Xh=Math.hypot,Yh=Math.sin,Qh=Math.sign||function(t){return t>0?1:t<0?-1:0},$h=Math.sqrt;function Zh(t){return t>1?Oh:t<-1?-Oh:Math.asin(t)}function Kh(t){return(t=Yh(t/2))*t}function Jh(){}function tc(t,e){t&&nc.hasOwnProperty(t.type)&&nc[t.type](t,e)}var ec={Feature:function(t,e){tc(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i<r;)tc(n[i].geometry,e)}},nc={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)t=n[i],e.point(t[0],t[1],t[2])},LineString:function(t,e){ic(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)ic(n[i],e,0)},Polygon:function(t,e){rc(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)rc(n[i],e)},GeometryCollection:function(t,e){for(var n=t.geometries,i=-1,r=n.length;++i<r;)tc(n[i],e)}};function ic(t,e,n){var i,r=-1,s=t.length-n;for(e.lineStart();++r<s;)i=t[r],e.point(i[0],i[1],i[2]);e.lineEnd()}function rc(t,e){var n=-1,i=t.length;for(e.polygonStart();++n<i;)ic(t[n],e,1);e.polygonEnd()}function sc(t,e){t&&ec.hasOwnProperty(t.type)?ec[t.type](t,e):tc(t,e)}var ac,oc,lc,uc,hc,cc,Ac,dc,pc,fc,mc,gc,yc,vc,_c,xc,bc=new Th,Sc=new Th,Mc={point:Jh,lineStart:Jh,lineEnd:Jh,polygonStart:function(){bc=new Th,Mc.lineStart=wc,Mc.lineEnd=Tc},polygonEnd:function(){var t=+bc;Sc.add(t<0?kh+t:t),this.lineStart=this.lineEnd=this.point=Jh},sphere:function(){Sc.add(kh)}};function wc(){Mc.point=Ec}function Tc(){Cc(ac,oc)}function Ec(t,e){Mc.point=Cc,ac=t,oc=e,lc=t*=qh,uc=jh(e=(e*=qh)/2+Fh),hc=Yh(e)}function Cc(t,e){var n=(t*=qh)-lc,i=n>=0?1:-1,r=i*n,s=jh(e=(e*=qh)/2+Fh),a=Yh(e),o=hc*a,l=uc*s+o*jh(r),u=o*i*Yh(r);bc.add(Hh(u,l)),lc=t,uc=s,hc=a}function Rc(t){return[Hh(t[1],t[0]),Zh(t[2])]}function Nc(t){var e=t[0],n=t[1],i=jh(n);return[i*jh(e),i*Yh(e),Yh(n)]}function Pc(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Dc(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Ic(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Lc(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Bc(t){var e=$h(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var Uc,Oc,Fc,kc,zc,qc,Gc,Vc,Hc,jc,Wc,Xc,Yc,Qc,$c,Zc,Kc={point:Jc,lineStart:eA,lineEnd:nA,polygonStart:function(){Kc.point=iA,Kc.lineStart=rA,Kc.lineEnd=sA,vc=new Th,Mc.polygonStart()},polygonEnd:function(){Mc.polygonEnd(),Kc.point=Jc,Kc.lineStart=eA,Kc.lineEnd=nA,bc<0?(cc=-(dc=180),Ac=-(pc=90)):vc>Lh?pc=90:vc<-1e-6&&(Ac=-90),xc[0]=cc,xc[1]=dc},sphere:function(){cc=-(dc=180),Ac=-(pc=90)}};function Jc(t,e){_c.push(xc=[cc=t,dc=t]),e<Ac&&(Ac=e),e>pc&&(pc=e)}function tA(t,e){var n=Nc([t*qh,e*qh]);if(yc){var i=Dc(yc,n),r=Dc([i[1],-i[0],0],i);Bc(r),r=Rc(r);var s,a=t-fc,o=a>0?1:-1,l=r[0]*zh*o,u=Gh(a)>180;u^(o*fc<l&&l<o*t)?(s=r[1]*zh)>pc&&(pc=s):u^(o*fc<(l=(l+360)%360-180)&&l<o*t)?(s=-r[1]*zh)<Ac&&(Ac=s):(e<Ac&&(Ac=e),e>pc&&(pc=e)),u?t<fc?aA(cc,t)>aA(cc,dc)&&(dc=t):aA(t,dc)>aA(cc,dc)&&(cc=t):dc>=cc?(t<cc&&(cc=t),t>dc&&(dc=t)):t>fc?aA(cc,t)>aA(cc,dc)&&(dc=t):aA(t,dc)>aA(cc,dc)&&(cc=t)}else _c.push(xc=[cc=t,dc=t]);e<Ac&&(Ac=e),e>pc&&(pc=e),yc=n,fc=t}function eA(){Kc.point=tA}function nA(){xc[0]=cc,xc[1]=dc,Kc.point=Jc,yc=null}function iA(t,e){if(yc){var n=t-fc;vc.add(Gh(n)>180?n+(n>0?360:-360):n)}else mc=t,gc=e;Mc.point(t,e),tA(t,e)}function rA(){Mc.lineStart()}function sA(){iA(mc,gc),Mc.lineEnd(),Gh(vc)>Lh&&(cc=-(dc=180)),xc[0]=cc,xc[1]=dc,yc=null}function aA(t,e){return(e-=t)<0?e+360:e}function oA(t,e){return t[0]-e[0]}function lA(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}function uA(t){var e,n,i,r,s,a,o;if(pc=dc=-(cc=Ac=1/0),_c=[],sc(t,Kc),n=_c.length){for(_c.sort(oA),e=1,s=[i=_c[0]];e<n;++e)lA(i,(r=_c[e])[0])||lA(i,r[1])?(aA(i[0],r[1])>aA(i[0],i[1])&&(i[1]=r[1]),aA(r[0],i[1])>aA(i[0],i[1])&&(i[0]=r[0])):s.push(i=r);for(a=-1/0,e=0,i=s[n=s.length-1];e<=n;i=r,++e)r=s[e],(o=aA(i[1],r[0]))>a&&(a=o,cc=r[0],dc=i[1])}return _c=xc=null,cc===1/0||Ac===1/0?[[NaN,NaN],[NaN,NaN]]:[[cc,Ac],[dc,pc]]}var hA={sphere:Jh,point:cA,lineStart:dA,lineEnd:mA,polygonStart:function(){hA.lineStart=gA,hA.lineEnd=yA},polygonEnd:function(){hA.lineStart=dA,hA.lineEnd=mA}};function cA(t,e){t*=qh;var n=jh(e*=qh);AA(n*jh(t),n*Yh(t),Yh(e))}function AA(t,e,n){++Uc,Fc+=(t-Fc)/Uc,kc+=(e-kc)/Uc,zc+=(n-zc)/Uc}function dA(){hA.point=pA}function pA(t,e){t*=qh;var n=jh(e*=qh);Qc=n*jh(t),$c=n*Yh(t),Zc=Yh(e),hA.point=fA,AA(Qc,$c,Zc)}function fA(t,e){t*=qh;var n=jh(e*=qh),i=n*jh(t),r=n*Yh(t),s=Yh(e),a=Hh($h((a=$c*s-Zc*r)*a+(a=Zc*i-Qc*s)*a+(a=Qc*r-$c*i)*a),Qc*i+$c*r+Zc*s);Oc+=a,qc+=a*(Qc+(Qc=i)),Gc+=a*($c+($c=r)),Vc+=a*(Zc+(Zc=s)),AA(Qc,$c,Zc)}function mA(){hA.point=cA}function gA(){hA.point=vA}function yA(){_A(Xc,Yc),hA.point=cA}function vA(t,e){Xc=t,Yc=e,t*=qh,e*=qh,hA.point=_A;var n=jh(e);Qc=n*jh(t),$c=n*Yh(t),Zc=Yh(e),AA(Qc,$c,Zc)}function _A(t,e){t*=qh;var n=jh(e*=qh),i=n*jh(t),r=n*Yh(t),s=Yh(e),a=$c*s-Zc*r,o=Zc*i-Qc*s,l=Qc*r-$c*i,u=Xh(a,o,l),h=Zh(u),c=u&&-h/u;Hc.add(c*a),jc.add(c*o),Wc.add(c*l),Oc+=h,qc+=h*(Qc+(Qc=i)),Gc+=h*($c+($c=r)),Vc+=h*(Zc+(Zc=s)),AA(Qc,$c,Zc)}function xA(t){Uc=Oc=Fc=kc=zc=qc=Gc=Vc=0,Hc=new Th,jc=new Th,Wc=new Th,sc(t,hA);var e=+Hc,n=+jc,i=+Wc,r=Xh(e,n,i);return r<Bh&&(e=qc,n=Gc,i=Vc,Oc<Lh&&(e=Fc,n=kc,i=zc),(r=Xh(e,n,i))<Bh)?[NaN,NaN]:[Hh(n,e)*zh,Zh(i/r)*zh]}function bA(t,e){function n(n,i){return n=t(n,i),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,i){return(n=e.invert(n,i))&&t.invert(n[0],n[1])}),n}function SA(t,e){return Gh(t)>Uh&&(t-=Math.round(t/kh)*kh),[t,e]}function MA(t,e,n){return(t%=kh)?e||n?bA(TA(t),EA(e,n)):TA(t):e||n?EA(e,n):SA}function wA(t){return function(e,n){return Gh(e+=t)>Uh&&(e-=Math.round(e/kh)*kh),[e,n]}}function TA(t){var e=wA(t);return e.invert=wA(-t),e}function EA(t,e){var n=jh(t),i=Yh(t),r=jh(e),s=Yh(e);function a(t,e){var a=jh(e),o=jh(t)*a,l=Yh(t)*a,u=Yh(e),h=u*n+o*i;return[Hh(l*r-h*s,o*n-u*i),Zh(h*r+l*s)]}return a.invert=function(t,e){var a=jh(e),o=jh(t)*a,l=Yh(t)*a,u=Yh(e),h=u*r-l*s;return[Hh(l*r+u*s,o*n+h*i),Zh(h*n-o*i)]},a}function CA(t,e){(e=Nc(e))[0]-=t,Bc(e);var n,i=(n=-e[1])>1?0:n<-1?Uh:Math.acos(n);return((-e[2]<0?-i:i)+kh-Lh)%kh}function RA(){var t,e=[];return{point:function(e,n,i){t.push([e,n,i])},lineStart:function(){e.push(t=[])},lineEnd:Jh,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function NA(t,e){return Gh(t[0]-e[0])<Lh&&Gh(t[1]-e[1])<Lh}function PA(t,e,n,i){this.x=t,this.z=e,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function DA(t,e,n,i,r){var s,a,o=[],l=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,i=t[0],a=t[e];if(NA(i,a)){if(!i[2]&&!a[2]){for(r.lineStart(),s=0;s<e;++s)r.point((i=t[s])[0],i[1]);return void r.lineEnd()}a[0]+=2e-6}o.push(n=new PA(i,t,null,!0)),l.push(n.o=new PA(i,null,n,!1)),o.push(n=new PA(a,t,null,!1)),l.push(n.o=new PA(a,null,n,!0))}})),o.length){for(l.sort(e),IA(o),IA(l),s=0,a=l.length;s<a;++s)l[s].e=n=!n;for(var u,h,c=o[0];;){for(var A=c,d=!0;A.v;)if((A=A.n)===c)return;u=A.z,r.lineStart();do{if(A.v=A.o.v=!0,A.e){if(d)for(s=0,a=u.length;s<a;++s)r.point((h=u[s])[0],h[1]);else i(A.x,A.n.x,1,r);A=A.n}else{if(d)for(u=A.p.z,s=u.length-1;s>=0;--s)r.point((h=u[s])[0],h[1]);else i(A.x,A.p.x,-1,r);A=A.p}u=(A=A.o).z,d=!d}while(!A.v);r.lineEnd()}}}function IA(t){if(e=t.length){for(var e,n,i=0,r=t[0];++i<e;)r.n=n=t[i],n.p=r,r=n;r.n=n=t[0],n.p=r}}function LA(t){return Gh(t[0])<=Uh?t[0]:Qh(t[0])*((Gh(t[0])+Uh)%kh-Uh)}function BA(t,e){var n=LA(e),i=e[1],r=Yh(i),s=[Yh(n),-jh(n),0],a=0,o=0,l=new Th;1===r?i=Oh+Lh:-1===r&&(i=-Oh-Lh);for(var u=0,h=t.length;u<h;++u)if(A=(c=t[u]).length)for(var c,A,d=c[A-1],p=LA(d),f=d[1]/2+Fh,m=Yh(f),g=jh(f),y=0;y<A;++y,p=_,m=b,g=S,d=v){var v=c[y],_=LA(v),x=v[1]/2+Fh,b=Yh(x),S=jh(x),M=_-p,w=M>=0?1:-1,T=w*M,E=T>Uh,C=m*b;if(l.add(Hh(C*w*Yh(T),g*S+C*jh(T))),a+=E?M+w*kh:M,E^p>=n^_>=n){var R=Dc(Nc(d),Nc(v));Bc(R);var N=Dc(s,R);Bc(N);var P=(E^M>=0?-1:1)*Zh(N[2]);(i>P||i===P&&(R[0]||R[1]))&&(o+=E^M>=0?1:-1)}}return(a<-1e-6||a<Lh&&l<-1e-12)^1&o}function UA(t,e,n,i){return function(r){var s,a,o,l=e(r),u=RA(),h=e(u),c=!1,A={point:d,lineStart:f,lineEnd:m,polygonStart:function(){A.point=g,A.lineStart=y,A.lineEnd=v,a=[],s=[]},polygonEnd:function(){A.point=d,A.lineStart=f,A.lineEnd=m,a=Dh(a);var t=BA(s,i);a.length?(c||(r.polygonStart(),c=!0),DA(a,FA,t,n,r)):t&&(c||(r.polygonStart(),c=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),c&&(r.polygonEnd(),c=!1),a=s=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function d(e,n){t(e,n)&&r.point(e,n)}function p(t,e){l.point(t,e)}function f(){A.point=p,l.lineStart()}function m(){A.point=d,l.lineEnd()}function g(t,e){o.push([t,e]),h.point(t,e)}function y(){h.lineStart(),o=[]}function v(){g(o[0][0],o[0][1]),h.lineEnd();var t,e,n,i,l=h.clean(),A=u.result(),d=A.length;if(o.pop(),s.push(o),o=null,d)if(1&l){if((e=(n=A[0]).length-1)>0){for(c||(r.polygonStart(),c=!0),r.lineStart(),t=0;t<e;++t)r.point((i=n[t])[0],i[1]);r.lineEnd()}}else d>1&&2&l&&A.push(A.pop().concat(A.shift())),a.push(A.filter(OA))}return A}}function OA(t){return t.length>1}function FA(t,e){return((t=t.x)[0]<0?t[1]-Oh-Lh:Oh-t[1])-((e=e.x)[0]<0?e[1]-Oh-Lh:Oh-e[1])}SA.invert=SA;var kA=UA((function(){return!0}),(function(t){var e,n=NaN,i=NaN,r=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(s,a){var o=s>0?Uh:-Uh,l=Gh(s-n);Gh(l-Uh)<Lh?(t.point(n,i=(i+a)/2>0?Oh:-Oh),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(o,i),t.point(s,i),e=0):r!==o&&l>=Uh&&(Gh(n-r)<Lh&&(n-=r*Lh),Gh(s-o)<Lh&&(s-=o*Lh),i=function(t,e,n,i){var r,s,a=Yh(t-n);return Gh(a)>Lh?Vh((Yh(e)*(s=jh(i))*Yh(n)-Yh(i)*(r=jh(e))*Yh(t))/(r*s*a)):(e+i)/2}(n,i,s,a),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(o,i),e=0),t.point(n=s,i=a),r=o},lineEnd:function(){t.lineEnd(),n=i=NaN},clean:function(){return 2-e}}}),(function(t,e,n,i){var r;if(null==t)r=n*Oh,i.point(-Uh,r),i.point(0,r),i.point(Uh,r),i.point(Uh,0),i.point(Uh,-r),i.point(0,-r),i.point(-Uh,-r),i.point(-Uh,0),i.point(-Uh,r);else if(Gh(t[0]-e[0])>Lh){var s=t[0]<e[0]?Uh:-Uh;r=n*s/2,i.point(-s,r),i.point(0,r),i.point(s,r)}else i.point(e[0],e[1])}),[-Uh,-Oh]);function zA(t){var e=jh(t),n=2*qh,i=e>0,r=Gh(e)>Lh;function s(t,n){return jh(t)*jh(n)>e}function a(t,n,i){var r=[1,0,0],s=Dc(Nc(t),Nc(n)),a=Pc(s,s),o=s[0],l=a-o*o;if(!l)return!i&&t;var u=e*a/l,h=-e*o/l,c=Dc(r,s),A=Lc(r,u);Ic(A,Lc(s,h));var d=c,p=Pc(A,d),f=Pc(d,d),m=p*p-f*(Pc(A,A)-1);if(!(m<0)){var g=$h(m),y=Lc(d,(-p-g)/f);if(Ic(y,A),y=Rc(y),!i)return y;var v,_=t[0],x=n[0],b=t[1],S=n[1];x<_&&(v=_,_=x,x=v);var M=x-_,w=Gh(M-Uh)<Lh;if(!w&&S<b&&(v=b,b=S,S=v),w||M<Lh?w?b+S>0^y[1]<(Gh(y[0]-_)<Lh?b:S):b<=y[1]&&y[1]<=S:M>Uh^(_<=y[0]&&y[0]<=x)){var T=Lc(d,(-p+g)/f);return Ic(T,A),[y,Rc(T)]}}}function o(e,n){var r=i?t:Uh-t,s=0;return e<-r?s|=1:e>r&&(s|=2),n<-r?s|=4:n>r&&(s|=8),s}return UA(s,(function(t){var e,n,l,u,h;return{lineStart:function(){u=l=!1,h=1},point:function(c,A){var d,p=[c,A],f=s(c,A),m=i?f?0:o(c,A):f?o(c+(c<0?Uh:-Uh),A):0;if(!e&&(u=l=f)&&t.lineStart(),f!==l&&(!(d=a(e,p))||NA(e,d)||NA(p,d))&&(p[2]=1),f!==l)h=0,f?(t.lineStart(),d=a(p,e),t.point(d[0],d[1])):(d=a(e,p),t.point(d[0],d[1],2),t.lineEnd()),e=d;else if(r&&e&&i^f){var g;m&n||!(g=a(p,e,!0))||(h=0,i?(t.lineStart(),t.point(g[0][0],g[0][1]),t.point(g[1][0],g[1][1]),t.lineEnd()):(t.point(g[1][0],g[1][1]),t.lineEnd(),t.lineStart(),t.point(g[0][0],g[0][1],3)))}!f||e&&NA(e,p)||t.point(p[0],p[1]),e=p,l=f,n=m},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return h|(u&&l)<<1}}}),(function(e,i,r,s){!function(t,e,n,i,r,s){if(n){var a=jh(e),o=Yh(e),l=i*n;null==r?(r=e+i*kh,s=e-l/2):(r=CA(a,r),s=CA(a,s),(i>0?r<s:r>s)&&(r+=i*kh));for(var u,h=r;i>0?h>s:h<s;h-=l)u=Rc([a,-o*jh(h),-o*Yh(h)]),t.point(u[0],u[1])}}(s,t,n,r,e,i)}),i?[0,-t]:[-Uh,t-Uh])}var qA,GA,VA,HA,jA=1e9,WA=-jA;function XA(t,e,n,i){function r(r,s){return t<=r&&r<=n&&e<=s&&s<=i}function s(r,s,o,u){var h=0,c=0;if(null==r||(h=a(r,o))!==(c=a(s,o))||l(r,s)<0^o>0)do{u.point(0===h||3===h?t:n,h>1?i:e)}while((h=(h+o+4)%4)!==c);else u.point(s[0],s[1])}function a(i,r){return Gh(i[0]-t)<Lh?r>0?0:3:Gh(i[0]-n)<Lh?r>0?2:1:Gh(i[1]-e)<Lh?r>0?1:0:r>0?3:2}function o(t,e){return l(t.x,e.x)}function l(t,e){var n=a(t,1),i=a(e,1);return n!==i?n-i:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var l,u,h,c,A,d,p,f,m,g,y,v=a,_=RA(),x={point:b,lineStart:function(){x.point=S,u&&u.push(h=[]);g=!0,m=!1,p=f=NaN},lineEnd:function(){l&&(S(c,A),d&&m&&_.rejoin(),l.push(_.result()));x.point=b,m&&v.lineEnd()},polygonStart:function(){v=_,l=[],u=[],y=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,r=u.length;n<r;++n)for(var s,a,o=u[n],l=1,h=o.length,c=o[0],A=c[0],d=c[1];l<h;++l)s=A,a=d,A=(c=o[l])[0],d=c[1],a<=i?d>i&&(A-s)*(i-a)>(d-a)*(t-s)&&++e:d<=i&&(A-s)*(i-a)<(d-a)*(t-s)&&--e;return e}(),n=y&&e,r=(l=Dh(l)).length;(n||r)&&(a.polygonStart(),n&&(a.lineStart(),s(null,null,1,a),a.lineEnd()),r&&DA(l,o,e,s,a),a.polygonEnd());v=a,l=u=h=null}};function b(t,e){r(t,e)&&v.point(t,e)}function S(s,a){var o=r(s,a);if(u&&h.push([s,a]),g)c=s,A=a,d=o,g=!1,o&&(v.lineStart(),v.point(s,a));else if(o&&m)v.point(s,a);else{var l=[p=Math.max(WA,Math.min(jA,p)),f=Math.max(WA,Math.min(jA,f))],_=[s=Math.max(WA,Math.min(jA,s)),a=Math.max(WA,Math.min(jA,a))];!function(t,e,n,i,r,s){var a,o=t[0],l=t[1],u=0,h=1,c=e[0]-o,A=e[1]-l;if(a=n-o,c||!(a>0)){if(a/=c,c<0){if(a<u)return;a<h&&(h=a)}else if(c>0){if(a>h)return;a>u&&(u=a)}if(a=r-o,c||!(a<0)){if(a/=c,c<0){if(a>h)return;a>u&&(u=a)}else if(c>0){if(a<u)return;a<h&&(h=a)}if(a=i-l,A||!(a>0)){if(a/=A,A<0){if(a<u)return;a<h&&(h=a)}else if(A>0){if(a>h)return;a>u&&(u=a)}if(a=s-l,A||!(a<0)){if(a/=A,A<0){if(a>h)return;a>u&&(u=a)}else if(A>0){if(a<u)return;a<h&&(h=a)}return u>0&&(t[0]=o+u*c,t[1]=l+u*A),h<1&&(e[0]=o+h*c,e[1]=l+h*A),!0}}}}}(l,_,t,e,n,i)?o&&(v.lineStart(),v.point(s,a),y=!1):(m||(v.lineStart(),v.point(l[0],l[1])),v.point(_[0],_[1]),o||v.lineEnd(),y=!1)}p=s,f=a,m=o}return x}}var YA={sphere:Jh,point:Jh,lineStart:function(){YA.point=$A,YA.lineEnd=QA},lineEnd:Jh,polygonStart:Jh,polygonEnd:Jh};function QA(){YA.point=YA.lineEnd=Jh}function $A(t,e){GA=t*=qh,VA=Yh(e*=qh),HA=jh(e),YA.point=ZA}function ZA(t,e){t*=qh;var n=Yh(e*=qh),i=jh(e),r=Gh(t-GA),s=jh(r),a=i*Yh(r),o=HA*n-VA*i*s,l=VA*n+HA*i*s;qA.add(Hh($h(a*a+o*o),l)),GA=t,VA=n,HA=i}var KA=[null,null],JA={type:"LineString",coordinates:KA};function td(t,e){return KA[0]=t,KA[1]=e,function(t){return qA=new Th,sc(t,YA),+qA}(JA)}var ed={Feature:function(t,e){return id(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i<r;)if(id(n[i].geometry,e))return!0;return!1}},nd={Sphere:function(){return!0},Point:function(t,e){return rd(t.coordinates,e)},MultiPoint:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)if(rd(n[i],e))return!0;return!1},LineString:function(t,e){return sd(t.coordinates,e)},MultiLineString:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)if(sd(n[i],e))return!0;return!1},Polygon:function(t,e){return ad(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)if(ad(n[i],e))return!0;return!1},GeometryCollection:function(t,e){for(var n=t.geometries,i=-1,r=n.length;++i<r;)if(id(n[i],e))return!0;return!1}};function id(t,e){return!(!t||!nd.hasOwnProperty(t.type))&&nd[t.type](t,e)}function rd(t,e){return 0===td(t,e)}function sd(t,e){for(var n,i,r,s=0,a=t.length;s<a;s++){if(0===(i=td(t[s],e)))return!0;if(s>0&&(r=td(t[s],t[s-1]))>0&&n<=r&&i<=r&&(n+i-r)*(1-Math.pow((n-i)/r,2))<Bh*r)return!0;n=i}return!1}function ad(t,e){return!!BA(t.map(od),ld(e))}function od(t){return(t=t.map(ld)).pop(),t}function ld(t){return[t[0]*qh,t[1]*qh]}function ud(t,e,n){var i=Ih(t,e-Lh,n).concat(e);return function(t){return i.map((function(e){return[t,e]}))}}function hd(t,e,n){var i=Ih(t,e-Lh,n).concat(e);return function(t){return i.map((function(e){return[e,t]}))}}function cd(){return function(){var t,e,n,i,r,s,a,o,l,u,h,c,A=10,d=A,p=90,f=360,m=2.5;function g(){return{type:"MultiLineString",coordinates:y()}}function y(){return Ih(Wh(i/p)*p,n,p).map(h).concat(Ih(Wh(o/f)*f,a,f).map(c)).concat(Ih(Wh(e/A)*A,t,A).filter((function(t){return Gh(t%p)>Lh})).map(l)).concat(Ih(Wh(s/d)*d,r,d).filter((function(t){return Gh(t%f)>Lh})).map(u))}return g.lines=function(){return y().map((function(t){return{type:"LineString",coordinates:t}}))},g.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(c(a).slice(1),h(n).reverse().slice(1),c(o).reverse().slice(1))]}},g.extent=function(t){return arguments.length?g.extentMajor(t).extentMinor(t):g.extentMinor()},g.extentMajor=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],o=+t[0][1],a=+t[1][1],i>n&&(t=i,i=n,n=t),o>a&&(t=o,o=a,a=t),g.precision(m)):[[i,o],[n,a]]},g.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],s=+n[0][1],r=+n[1][1],e>t&&(n=e,e=t,t=n),s>r&&(n=s,s=r,r=n),g.precision(m)):[[e,s],[t,r]]},g.step=function(t){return arguments.length?g.stepMajor(t).stepMinor(t):g.stepMinor()},g.stepMajor=function(t){return arguments.length?(p=+t[0],f=+t[1],g):[p,f]},g.stepMinor=function(t){return arguments.length?(A=+t[0],d=+t[1],g):[A,d]},g.precision=function(A){return arguments.length?(m=+A,l=ud(s,r,90),u=hd(e,t,m),h=ud(o,a,90),c=hd(i,n,m),g):m},g.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}()()}function Ad(t,e){var n=t[0]*qh,i=t[1]*qh,r=e[0]*qh,s=e[1]*qh,a=jh(i),o=Yh(i),l=jh(s),u=Yh(s),h=a*jh(n),c=a*Yh(n),A=l*jh(r),d=l*Yh(r),p=2*Zh($h(Kh(s-i)+a*l*Kh(r-n))),f=Yh(p),m=p?function(t){var e=Yh(t*=p)/f,n=Yh(p-t)/f,i=n*h+e*A,r=n*c+e*d,s=n*o+e*u;return[Hh(r,i)*zh,Hh(s,$h(i*i+r*r))*zh]}:function(){return[n*zh,i*zh]};return m.distance=p,m}var dd=t=>t,pd=1/0,fd=pd,md=-pd,gd=md,yd={point:function(t,e){t<pd&&(pd=t);t>md&&(md=t);e<fd&&(fd=e);e>gd&&(gd=e)},lineStart:Jh,lineEnd:Jh,polygonStart:Jh,polygonEnd:Jh,result:function(){var t=[[pd,fd],[md,gd]];return md=gd=-(fd=pd=1/0),t}};function vd(t){return function(e){var n=new _d;for(var i in t)n[i]=t[i];return n.stream=e,n}}function _d(){}function xd(t,e,n){var i=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=i&&t.clipExtent(null),sc(n,t.stream(yd)),e(yd.result()),null!=i&&t.clipExtent(i),t}function bd(t,e,n){return xd(t,(function(n){var i=e[1][0]-e[0][0],r=e[1][1]-e[0][1],s=Math.min(i/(n[1][0]-n[0][0]),r/(n[1][1]-n[0][1])),a=+e[0][0]+(i-s*(n[1][0]+n[0][0]))/2,o=+e[0][1]+(r-s*(n[1][1]+n[0][1]))/2;t.scale(150*s).translate([a,o])}),n)}_d.prototype={constructor:_d,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Sd=jh(30*qh);function Md(t,e){return+e?function(t,e){function n(i,r,s,a,o,l,u,h,c,A,d,p,f,m){var g=u-i,y=h-r,v=g*g+y*y;if(v>4*e&&f--){var _=a+A,x=o+d,b=l+p,S=$h(_*_+x*x+b*b),M=Zh(b/=S),w=Gh(Gh(b)-1)<Lh||Gh(s-c)<Lh?(s+c)/2:Hh(x,_),T=t(w,M),E=T[0],C=T[1],R=E-i,N=C-r,P=y*R-g*N;(P*P/v>e||Gh((g*R+y*N)/v-.5)>.3||a*A+o*d+l*p<Sd)&&(n(i,r,s,a,o,l,E,C,w,_/=S,x/=S,b,f,m),m.point(E,C),n(E,C,w,_,x,b,u,h,c,A,d,p,f,m))}}return function(e){var i,r,s,a,o,l,u,h,c,A,d,p,f={point:m,lineStart:g,lineEnd:v,polygonStart:function(){e.polygonStart(),f.lineStart=_},polygonEnd:function(){e.polygonEnd(),f.lineStart=g}};function m(n,i){n=t(n,i),e.point(n[0],n[1])}function g(){h=NaN,f.point=y,e.lineStart()}function y(i,r){var s=Nc([i,r]),a=t(i,r);n(h,c,u,A,d,p,h=a[0],c=a[1],u=i,A=s[0],d=s[1],p=s[2],16,e),e.point(h,c)}function v(){f.point=m,e.lineEnd()}function _(){g(),f.point=x,f.lineEnd=b}function x(t,e){y(i=t,e),r=h,s=c,a=A,o=d,l=p,f.point=y}function b(){n(h,c,u,A,d,p,r,s,i,a,o,l,16,e),f.lineEnd=v,v()}return f}}(t,e):function(t){return vd({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var wd=vd({point:function(t,e){this.stream.point(t*qh,e*qh)}});function Td(t,e,n,i,r,s){if(!s)return function(t,e,n,i,r){function s(s,a){return[e+t*(s*=i),n-t*(a*=r)]}return s.invert=function(s,a){return[(s-e)/t*i,(n-a)/t*r]},s}(t,e,n,i,r);var a=jh(s),o=Yh(s),l=a*t,u=o*t,h=a/t,c=o/t,A=(o*n-a*e)/t,d=(o*e+a*n)/t;function p(t,s){return[l*(t*=i)-u*(s*=r)+e,n-u*t-l*s]}return p.invert=function(t,e){return[i*(h*t-c*e+A),r*(d-c*t-h*e)]},p}function Ed(t){return function(t){var e,n,i,r,s,a,o,l,u,h,c=150,A=480,d=250,p=0,f=0,m=0,g=0,y=0,v=0,_=1,x=1,b=null,S=kA,M=null,w=dd,T=.5;function E(t){return l(t[0]*qh,t[1]*qh)}function C(t){return(t=l.invert(t[0],t[1]))&&[t[0]*zh,t[1]*zh]}function R(){var t=Td(c,0,0,_,x,v).apply(null,e(p,f)),i=Td(c,A-t[0],d-t[1],_,x,v);return n=MA(m,g,y),o=bA(e,i),l=bA(n,o),a=Md(o,T),N()}function N(){return u=h=null,E}return E.stream=function(t){return u&&h===t?u:u=wd(function(t){return vd({point:function(e,n){var i=t(e,n);return this.stream.point(i[0],i[1])}})}(n)(S(a(w(h=t)))))},E.preclip=function(t){return arguments.length?(S=t,b=void 0,N()):S},E.postclip=function(t){return arguments.length?(w=t,M=i=r=s=null,N()):w},E.clipAngle=function(t){return arguments.length?(S=+t?zA(b=t*qh):(b=null,kA),N()):b*zh},E.clipExtent=function(t){return arguments.length?(w=null==t?(M=i=r=s=null,dd):XA(M=+t[0][0],i=+t[0][1],r=+t[1][0],s=+t[1][1]),N()):null==M?null:[[M,i],[r,s]]},E.scale=function(t){return arguments.length?(c=+t,R()):c},E.translate=function(t){return arguments.length?(A=+t[0],d=+t[1],R()):[A,d]},E.center=function(t){return arguments.length?(p=t[0]%360*qh,f=t[1]%360*qh,R()):[p*zh,f*zh]},E.rotate=function(t){return arguments.length?(m=t[0]%360*qh,g=t[1]%360*qh,y=t.length>2?t[2]%360*qh:0,R()):[m*zh,g*zh,y*zh]},E.angle=function(t){return arguments.length?(v=t%360*qh,R()):v*zh},E.reflectX=function(t){return arguments.length?(_=t?-1:1,R()):_<0},E.reflectY=function(t){return arguments.length?(x=t?-1:1,R()):x<0},E.precision=function(t){return arguments.length?(a=Md(o,T=t*t),N()):$h(T)},E.fitExtent=function(t,e){return bd(E,t,e)},E.fitSize=function(t,e){return function(t,e,n){return bd(t,[[0,0],e],n)}(E,t,e)},E.fitWidth=function(t,e){return function(t,e,n){return xd(t,(function(n){var i=+e,r=i/(n[1][0]-n[0][0]),s=(i-r*(n[1][0]+n[0][0]))/2,a=-r*n[0][1];t.scale(150*r).translate([s,a])}),n)}(E,t,e)},E.fitHeight=function(t,e){return function(t,e,n){return xd(t,(function(n){var i=+e,r=i/(n[1][1]-n[0][1]),s=-r*n[0][0],a=(i-r*(n[1][1]+n[0][1]))/2;t.scale(150*r).translate([s,a])}),n)}(E,t,e)},function(){return e=t.apply(this,arguments),E.invert=e.invert&&C,R()}}((function(){return t}))()}function Cd(t,e){var n=jh(e),i=1+jh(t)*n;return[n*Yh(t)/i,Yh(e)/i]}function Rd(){return Ed(Cd).scale(250).clipAngle(142)}function Nd(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function Pd(t,e,n){return e=Dd(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Id()?Reflect.construct(e,[],Dd(t).constructor):e.apply(t,n))}function Dd(t){return Dd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Dd(t)}function Id(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Id=function(){return!!t})()}function Ld(t,e){return Ld=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ld(t,e)}function Bd(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=s.call(n)).done)&&(o.push(i.value),o.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return o}}(t,e)||Ud(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ud(t,e){if(t){if("string"==typeof t)return Nd(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nd(t,e):void 0}}Cd.invert=function(t){return function(e,n){var i=$h(e*e+n*n),r=t(i),s=Yh(r),a=jh(r);return[Hh(e*s,i*a),Zh(i&&n*s/i)]}}((function(t){return 2*Vh(t)}));var Od=function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,e=[],n=null;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(i){if(n){var r=180*td(i,n)/Math.PI;if(r>t)for(var s=Ad(n,i),a=1/Math.ceil(r/t),o=a;o<1;)e.push(s(o)),o+=a}e.push(n=i)})),e},Fd="undefined"!=typeof window&&window.THREE?window.THREE:{BufferGeometry:Gi,Float32BufferAttribute:Li},kd=(new Fd.BufferGeometry).setAttribute?"setAttribute":"addAttribute",zd=function(t){function e(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=Pd(this,e)).type="GeoJsonGeometry",n.parameters={geoJson:t,radius:i,resolution:r};var s=({Point:u,MultiPoint:function(t,e){var n={vertices:[],indices:[]};return t.map((function(t){return u(t,e)})).forEach((function(t){var e=Bd(t,1)[0];qd(n,e)})),[n]},LineString:h,MultiLineString:function(t,e){var n={vertices:[],indices:[]};return t.map((function(t){return h(t,e)})).forEach((function(t){var e=Bd(t,1)[0];qd(n,e)})),[n]},Polygon:c,MultiPolygon:function(t,e){var n={vertices:[],indices:[]},i={vertices:[],indices:[]};t.map((function(t){return c(t,e)})).forEach((function(t){var e=Bd(t,2),r=e[0],s=e[1];qd(n,r),s&&qd(i,s)}));var r=[n];return i.vertices.length&&r.push(i),r}}[t.type]||function(){return[]})(t.coordinates,i),a=[],o=[],l=0;function u(t,e){return[{vertices:Vd(t[1],t[0],e),indices:[]}]}function h(t,e){for(var n=vh([Od(t,r).map((function(t){var n=Bd(t,2),i=n[0];return Vd(n[1],i,e)}))]).vertices,i=Math.round(n.length/3),s=[],a=1;a<i;a++)s.push(a-1,a);return[{vertices:n,indices:s}]}function c(t,e){for(var n=vh(t.map((function(t){return Od(t,r).map((function(t){var n=Bd(t,2),i=n[0];return Vd(n[1],i,e)}))}))),i=n.vertices,s=n.holes,a=s[0]||1/0,o=i.slice(0,3*a),l=i.slice(3*a),u=new Set(s),h=Math.round(i.length/3),c=[],A=[],d=1;d<h;d++)u.has(d)||(d<a?c.push(d-1,d):A.push(d-1-a,d-a));var p=[{indices:c,vertices:o}];return s.length&&p.push({indices:A,vertices:l}),p}return s.forEach((function(t){var e=a.length;qd({indices:a,vertices:o},t),n.addGroup(e,a.length-e,l++)})),a.length&&n.setIndex(a),o.length&&n[kd]("position",new Fd.Float32BufferAttribute(o,3)),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ld(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(Fd.BufferGeometry);function qd(t,e){var n=Math.round(t.vertices.length/3);Gd(t.vertices,e.vertices),Gd(t.indices,e.indices.map((function(t){return t+n})))}function Gd(t,e){var n,i=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Ud(t))||e){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,o=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){o=!0,s=t},f:function(){try{a||null==n.return||n.return()}finally{if(o)throw s}}}}(e);try{for(i.s();!(n=i.n()).done;){var r=n.value;t.push(r)}}catch(t){i.e(t)}finally{i.f()}}function Vd(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=(90-t)*Math.PI/180,r=(90-e)*Math.PI/180;return[n*Math.sin(i)*Math.cos(r),n*Math.cos(i),n*Math.sin(i)*Math.sin(r)]}function Hd(t){let e,n,i,r=-1,s=0;for(let a=0;a<t.length;++a){const o=t[a];if(void 0===e&&(e=o.array.constructor),e!==o.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(void 0===n&&(n=o.itemSize),n!==o.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(void 0===i&&(i=o.normalized),i!==o.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(-1===r&&(r=o.gpuType),r!==o.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;s+=o.count*n}const a=new e(s),o=new Pi(a,n,i);let l=0;for(let e=0;e<t.length;++e){const i=t[e];if(i.isInterleavedBufferAttribute){const t=l/n;for(let e=0,r=i.count;e<r;e++)for(let r=0;r<n;r++){const n=i.getComponent(e,r);o.setComponent(e+t,r,n)}}else a.set(i.array,l);l+=i.count*n}return void 0!==r&&(o.gpuType=r),o}function jd(t){const e=t.data.array.constructor,n=t.count,i=t.itemSize,r=t.normalized,s=new e(n*i);let a;a=t.isInstancedInterleavedBufferAttribute?new yo(s,i,r,t.meshPerAttribute):new Pi(s,i,r);for(let e=0;e<n;e++)a.setX(e,t.getX(e)),i>=2&&a.setY(e,t.getY(e)),i>=3&&a.setZ(e,t.getZ(e)),i>=4&&a.setW(e,t.getW(e));return a}var Wd=Object.freeze({__proto__:null,computeMikkTSpaceTangents:function(t,e,n=!0){if(!e||!e.isReady)throw new Error("BufferGeometryUtils: Initialized MikkTSpace library required.");if(!t.hasAttribute("position")||!t.hasAttribute("normal")||!t.hasAttribute("uv"))throw new Error('BufferGeometryUtils: Tangents require "position", "normal", and "uv" attributes.');function i(t){if(t.normalized||t.isInterleavedBufferAttribute){const e=new Float32Array(t.count*t.itemSize);for(let n=0,i=0;n<t.count;n++)e[i++]=t.getX(n),e[i++]=t.getY(n),t.itemSize>2&&(e[i++]=t.getZ(n));return e}return t.array instanceof Float32Array?t.array:new Float32Array(t.array)}const r=t.index?t.toNonIndexed():t,s=e.generateTangents(i(r.attributes.position),i(r.attributes.normal),i(r.attributes.uv));if(n)for(let t=3;t<s.length;t+=4)s[t]*=-1;return r.setAttribute("tangent",new Pi(s,4)),t!==r&&t.copy(r),t},computeMorphedAttributes:function(t){const e=new en,n=new en,i=new en,r=new en,s=new en,a=new en,o=new en,l=new en,u=new en;function h(t,h,c,A,d,p,f,m){e.fromBufferAttribute(h,d),n.fromBufferAttribute(h,p),i.fromBufferAttribute(h,f);const g=t.morphTargetInfluences;if(c&&g){o.set(0,0,0),l.set(0,0,0),u.set(0,0,0);for(let t=0,h=c.length;t<h;t++){const h=g[t],m=c[t];0!==h&&(r.fromBufferAttribute(m,d),s.fromBufferAttribute(m,p),a.fromBufferAttribute(m,f),A?(o.addScaledVector(r,h),l.addScaledVector(s,h),u.addScaledVector(a,h)):(o.addScaledVector(r.sub(e),h),l.addScaledVector(s.sub(n),h),u.addScaledVector(a.sub(i),h)))}e.add(o),n.add(l),i.add(u)}t.isSkinnedMesh&&(t.applyBoneTransform(d,e),t.applyBoneTransform(p,n),t.applyBoneTransform(f,i)),m[3*d+0]=e.x,m[3*d+1]=e.y,m[3*d+2]=e.z,m[3*p+0]=n.x,m[3*p+1]=n.y,m[3*p+2]=n.z,m[3*f+0]=i.x,m[3*f+1]=i.y,m[3*f+2]=i.z}const c=t.geometry,A=t.material;let d,p,f;const m=c.index,g=c.attributes.position,y=c.morphAttributes.position,v=c.morphTargetsRelative,_=c.attributes.normal,x=c.morphAttributes.position,b=c.groups,S=c.drawRange;let M,w,T,E,C,R,N;const P=new Float32Array(g.count*g.itemSize),D=new Float32Array(_.count*_.itemSize);if(null!==m)if(Array.isArray(A))for(M=0,T=b.length;M<T;M++)for(C=b[M],R=Math.max(C.start,S.start),N=Math.min(C.start+C.count,S.start+S.count),w=R,E=N;w<E;w+=3)d=m.getX(w),p=m.getX(w+1),f=m.getX(w+2),h(t,g,y,v,d,p,f,P),h(t,_,x,v,d,p,f,D);else for(R=Math.max(0,S.start),N=Math.min(m.count,S.start+S.count),M=R,T=N;M<T;M+=3)d=m.getX(M),p=m.getX(M+1),f=m.getX(M+2),h(t,g,y,v,d,p,f,P),h(t,_,x,v,d,p,f,D);else if(Array.isArray(A))for(M=0,T=b.length;M<T;M++)for(C=b[M],R=Math.max(C.start,S.start),N=Math.min(C.start+C.count,S.start+S.count),w=R,E=N;w<E;w+=3)d=w,p=w+1,f=w+2,h(t,g,y,v,d,p,f,P),h(t,_,x,v,d,p,f,D);else for(R=Math.max(0,S.start),N=Math.min(g.count,S.start+S.count),M=R,T=N;M<T;M+=3)d=M,p=M+1,f=M+2,h(t,g,y,v,d,p,f,P),h(t,_,x,v,d,p,f,D);return{positionAttribute:g,normalAttribute:_,morphedPositionAttribute:new Li(P,3),morphedNormalAttribute:new Li(D,3)}},deepCloneAttribute:function(t){return t.isInstancedInterleavedBufferAttribute||t.isInterleavedBufferAttribute?jd(t):t.isInstancedBufferAttribute?(new yo).copy(t):(new Pi).copy(t)},deinterleaveAttribute:jd,deinterleaveGeometry:function(t){const e=t.attributes,n=t.morphTargets,i=new Map;for(const t in e){const n=e[t];n.isInterleavedBufferAttribute&&(i.has(n)||i.set(n,jd(n)),e[t]=i.get(n))}for(const t in n){const e=n[t];e.isInterleavedBufferAttribute&&(i.has(e)||i.set(e,jd(e)),n[t]=i.get(e))}},estimateBytesUsed:function(t){let e=0;for(const n in t.attributes){const i=t.getAttribute(n);e+=i.count*i.itemSize*i.array.BYTES_PER_ELEMENT}const n=t.getIndex();return e+=n?n.count*n.itemSize*n.array.BYTES_PER_ELEMENT:0,e},interleaveAttributes:function(t){let e,n=0,i=0;for(let r=0,s=t.length;r<s;++r){const s=t[r];if(void 0===e&&(e=s.array.constructor),e!==s.array.constructor)return console.error("AttributeBuffers of different types cannot be interleaved"),null;n+=s.array.length,i+=s.itemSize}const r=new fo(new e(n),i);let s=0;const a=[],o=["getX","getY","getZ","getW"],l=["setX","setY","setZ","setW"];for(let e=0,n=t.length;e<n;e++){const n=t[e],i=n.itemSize,u=n.count,h=new go(r,i,s,n.normalized);a.push(h),s+=i;for(let t=0;t<u;t++)for(let e=0;e<i;e++)h[l[e]](t,n[o[e]](t))}return a},mergeAttributes:Hd,mergeGeometries:function(t,e=!1){const n=null!==t[0].index,i=new Set(Object.keys(t[0].attributes)),r=new Set(Object.keys(t[0].morphAttributes)),s={},a={},o=t[0].morphTargetsRelative,l=new Gi;let u=0;for(let h=0;h<t.length;++h){const c=t[h];let A=0;if(n!==(null!==c.index))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(const t in c.attributes){if(!i.has(t))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+'. All geometries must have compatible attributes; make sure "'+t+'" attribute exists among all geometries, or in none of them.'),null;void 0===s[t]&&(s[t]=[]),s[t].push(c.attributes[t]),A++}if(A!==i.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". Make sure all geometries have the same number of attributes."),null;if(o!==c.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(const t in c.morphAttributes){if(!r.has(t))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". .morphAttributes must be consistent throughout all geometries."),null;void 0===a[t]&&(a[t]=[]),a[t].push(c.morphAttributes[t])}if(e){let t;if(n)t=c.index.count;else{if(void 0===c.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". The geometry must have either an index or a position attribute"),null;t=c.attributes.position.count}l.addGroup(u,t,h),u+=t}}if(n){let e=0;const n=[];for(let i=0;i<t.length;++i){const r=t[i].index;for(let t=0;t<r.count;++t)n.push(r.getX(t)+e);e+=t[i].attributes.position.count}l.setIndex(n)}for(const t in s){const e=Hd(s[t]);if(!e)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+t+" attribute."),null;l.setAttribute(t,e)}for(const t in a){const e=a[t][0].length;if(0===e)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[t]=[];for(let n=0;n<e;++n){const e=[];for(let i=0;i<a[t].length;++i)e.push(a[t][i][n]);const i=Hd(e);if(!i)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+t+" morphAttribute."),null;l.morphAttributes[t].push(i)}}return l},mergeGroups:function(t){if(0===t.groups.length)return console.warn("THREE.BufferGeometryUtils.mergeGroups(): No groups are defined. Nothing to merge."),t;let e=t.groups;if(e=e.sort(((t,e)=>t.materialIndex!==e.materialIndex?t.materialIndex-e.materialIndex:t.start-e.start)),null===t.getIndex()){const e=t.getAttribute("position"),n=[];for(let t=0;t<e.count;t+=3)n.push(t,t+1,t+2);t.setIndex(n)}const n=t.getIndex(),i=[];for(let t=0;t<e.length;t++){const r=e[t],s=r.start,a=s+r.count;for(let t=s;t<a;t++)i.push(n.getX(t))}t.dispose(),t.setIndex(i);let r=0;for(let t=0;t<e.length;t++){const n=e[t];n.start=r,r+=n.count}let s=e[0];t.groups=[s];for(let n=1;n<e.length;n++){const i=e[n];s.materialIndex===i.materialIndex?s.count+=i.count:(s=i,t.groups.push(s))}return t},mergeVertices:function(t,e=1e-4){e=Math.max(e,Number.EPSILON);const n={},i=t.getIndex(),r=t.getAttribute("position"),s=i?i.count:r.count;let a=0;const o=Object.keys(t.attributes),l={},u={},h=[],c=["getX","getY","getZ","getW"],A=["setX","setY","setZ","setW"];for(let e=0,n=o.length;e<n;e++){const n=o[e],i=t.attributes[n];l[n]=new i.constructor(new i.array.constructor(i.count*i.itemSize),i.itemSize,i.normalized);const r=t.morphAttributes[n];r&&(u[n]||(u[n]=[]),r.forEach(((t,e)=>{const i=new t.array.constructor(t.count*t.itemSize);u[n][e]=new t.constructor(i,t.itemSize,t.normalized)})))}const d=.5*e,p=Math.log10(1/e),f=Math.pow(10,p),m=d*f;for(let e=0;e<s;e++){const r=i?i.getX(e):e;let s="";for(let e=0,n=o.length;e<n;e++){const n=o[e],i=t.getAttribute(n),a=i.itemSize;for(let t=0;t<a;t++)s+=~~(i[c[t]](r)*f+m)+","}if(s in n)h.push(n[s]);else{for(let e=0,n=o.length;e<n;e++){const n=o[e],i=t.getAttribute(n),s=t.morphAttributes[n],h=i.itemSize,d=l[n],p=u[n];for(let t=0;t<h;t++){const e=c[t],n=A[t];if(d[n](a,i[e](r)),s)for(let t=0,i=s.length;t<i;t++)p[t][n](a,s[t][e](r))}}n[s]=a,h.push(a),a++}}const g=t.clone();for(const e in t.attributes){const t=l[e];if(g.setAttribute(e,new t.constructor(t.array.slice(0,a*t.itemSize),t.itemSize,t.normalized)),e in u)for(let t=0;t<u[e].length;t++){const n=u[e][t];g.morphAttributes[e][t]=new n.constructor(n.array.slice(0,a*n.itemSize),n.itemSize,n.normalized)}}return g.setIndex(h),g},toCreasedNormals:function(t,e=Math.PI/3){const n=Math.cos(e),i=100*(1+1e-10),r=[new en,new en,new en],s=new en,a=new en,o=new en,l=new en;function u(t){return`${~~(t.x*i)},${~~(t.y*i)},${~~(t.z*i)}`}const h=t.index?t.toNonIndexed():t,c=h.attributes.position,A={};for(let t=0,e=c.count/3;t<e;t++){const e=3*t,n=r[0].fromBufferAttribute(c,e+0),i=r[1].fromBufferAttribute(c,e+1),o=r[2].fromBufferAttribute(c,e+2);s.subVectors(o,i),a.subVectors(n,i);const l=(new en).crossVectors(s,a).normalize();for(let t=0;t<3;t++){const e=u(r[t]);e in A||(A[e]=[]),A[e].push(l)}}const d=new Float32Array(3*c.count),p=new Pi(d,3,!1);for(let t=0,e=c.count/3;t<e;t++){const e=3*t,i=r[0].fromBufferAttribute(c,e+0),h=r[1].fromBufferAttribute(c,e+1),d=r[2].fromBufferAttribute(c,e+2);s.subVectors(d,h),a.subVectors(i,h),o.crossVectors(s,a).normalize();for(let t=0;t<3;t++){const i=A[u(r[t])];l.set(0,0,0);for(let t=0,e=i.length;t<e;t++){const e=i[t];o.dot(e)>n&&l.add(e)}l.normalize(),p.setXYZ(e+t,l.x,l.y,l.z)}}return h.setAttribute("normal",p),h},toTrianglesDrawMode:function(t,e){if(0===e)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(2===e||1===e){let n=t.getIndex();if(null===n){const e=[],i=t.getAttribute("position");if(void 0===i)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t;for(let t=0;t<i.count;t++)e.push(t);t.setIndex(e),n=t.getIndex()}const i=n.count-2,r=[];if(2===e)for(let t=1;t<=i;t++)r.push(n.getX(0)),r.push(n.getX(t)),r.push(n.getX(t+1));else for(let t=0;t<i;t++)t%2==0?(r.push(n.getX(t)),r.push(n.getX(t+1)),r.push(n.getX(t+2))):(r.push(n.getX(t+2)),r.push(n.getX(t+1)),r.push(n.getX(t)));r.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=t.clone();return s.setIndex(r),s.clearGroups(),s}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),t}}),Xd=function(t){return"function"==typeof t?t:"string"==typeof t?function(e){return e[t]}:function(e){return t}};function Yd(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Qd(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function $d(){}var Zd=.7,Kd=1/Zd,Jd="\\s*([+-]?\\d+)\\s*",tp="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ep="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",np=/^#([0-9a-f]{3,8})$/,ip=new RegExp(`^rgb\\(${Jd},${Jd},${Jd}\\)$`),rp=new RegExp(`^rgb\\(${ep},${ep},${ep}\\)$`),sp=new RegExp(`^rgba\\(${Jd},${Jd},${Jd},${tp}\\)$`),ap=new RegExp(`^rgba\\(${ep},${ep},${ep},${tp}\\)$`),op=new RegExp(`^hsl\\(${tp},${ep},${ep}\\)$`),lp=new RegExp(`^hsla\\(${tp},${ep},${ep},${tp}\\)$`),up={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function hp(){return this.rgb().formatHex()}function cp(){return this.rgb().formatRgb()}function Ap(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=np.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?dp(e):3===n?new mp(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?pp(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?pp(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=ip.exec(t))?new mp(e[1],e[2],e[3],1):(e=rp.exec(t))?new mp(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=sp.exec(t))?pp(e[1],e[2],e[3],e[4]):(e=ap.exec(t))?pp(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=op.exec(t))?bp(e[1],e[2]/100,e[3]/100,1):(e=lp.exec(t))?bp(e[1],e[2]/100,e[3]/100,e[4]):up.hasOwnProperty(t)?dp(up[t]):"transparent"===t?new mp(NaN,NaN,NaN,0):null}function dp(t){return new mp(t>>16&255,t>>8&255,255&t,1)}function pp(t,e,n,i){return i<=0&&(t=e=n=NaN),new mp(t,e,n,i)}function fp(t,e,n,i){return 1===arguments.length?((r=t)instanceof $d||(r=Ap(r)),r?new mp((r=r.rgb()).r,r.g,r.b,r.opacity):new mp):new mp(t,e,n,null==i?1:i);var r}function mp(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function gp(){return`#${xp(this.r)}${xp(this.g)}${xp(this.b)}`}function yp(){const t=vp(this.opacity);return`${1===t?"rgb(":"rgba("}${_p(this.r)}, ${_p(this.g)}, ${_p(this.b)}${1===t?")":`, ${t})`}`}function vp(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function _p(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function xp(t){return((t=_p(t))<16?"0":"")+t.toString(16)}function bp(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Mp(t,e,n,i)}function Sp(t){if(t instanceof Mp)return new Mp(t.h,t.s,t.l,t.opacity);if(t instanceof $d||(t=Ap(t)),!t)return new Mp;if(t instanceof Mp)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),s=Math.max(e,n,i),a=NaN,o=s-r,l=(s+r)/2;return o?(a=e===s?(n-i)/o+6*(n<i):n===s?(i-e)/o+2:(e-n)/o+4,o/=l<.5?s+r:2-s-r,a*=60):o=l>0&&l<1?0:a,new Mp(a,o,l,t.opacity)}function Mp(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function wp(t){return(t=(t||0)%360)<0?t+360:t}function Tp(t){return Math.max(0,Math.min(1,t||0))}function Ep(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Cp(t){return Cp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cp(t)}Yd($d,Ap,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:hp,formatHex:hp,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Sp(this).formatHsl()},formatRgb:cp,toString:cp}),Yd(mp,fp,Qd($d,{brighter(t){return t=null==t?Kd:Math.pow(Kd,t),new mp(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Zd:Math.pow(Zd,t),new mp(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new mp(_p(this.r),_p(this.g),_p(this.b),vp(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:gp,formatHex:gp,formatHex8:function(){return`#${xp(this.r)}${xp(this.g)}${xp(this.b)}${xp(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:yp,toString:yp})),Yd(Mp,(function(t,e,n,i){return 1===arguments.length?Sp(t):new Mp(t,e,n,null==i?1:i)}),Qd($d,{brighter(t){return t=null==t?Kd:Math.pow(Kd,t),new Mp(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Zd:Math.pow(Zd,t),new Mp(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new mp(Ep(t>=240?t-240:t+120,r,i),Ep(t,r,i),Ep(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new Mp(wp(this.h),Tp(this.s),Tp(this.l),vp(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=vp(this.opacity);return`${1===t?"hsl(":"hsla("}${wp(this.h)}, ${100*Tp(this.s)}%, ${100*Tp(this.l)}%${1===t?")":`, ${t})`}`}}));var Rp=/^\s+/,Np=/\s+$/;function Pp(t,e){if(e=e||{},(t=t||"")instanceof Pp)return t;if(!(this instanceof Pp))return new Pp(t,e);var n=function(t){var e={r:0,g:0,b:0},n=1,i=null,r=null,s=null,a=!1,o=!1;"string"==typeof t&&(t=function(t){t=t.replace(Rp,"").replace(Np,"").toLowerCase();var e,n=!1;if(Yp[t])t=Yp[t],n=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=lf.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=lf.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=lf.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=lf.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=lf.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=lf.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=lf.hex8.exec(t))return{r:Jp(e[1]),g:Jp(e[2]),b:Jp(e[3]),a:rf(e[4]),format:n?"name":"hex8"};if(e=lf.hex6.exec(t))return{r:Jp(e[1]),g:Jp(e[2]),b:Jp(e[3]),format:n?"name":"hex"};if(e=lf.hex4.exec(t))return{r:Jp(e[1]+""+e[1]),g:Jp(e[2]+""+e[2]),b:Jp(e[3]+""+e[3]),a:rf(e[4]+""+e[4]),format:n?"name":"hex8"};if(e=lf.hex3.exec(t))return{r:Jp(e[1]+""+e[1]),g:Jp(e[2]+""+e[2]),b:Jp(e[3]+""+e[3]),format:n?"name":"hex"};return!1}(t));"object"==Cp(t)&&(uf(t.r)&&uf(t.g)&&uf(t.b)?(l=t.r,u=t.g,h=t.b,e={r:255*Zp(l,255),g:255*Zp(u,255),b:255*Zp(h,255)},a=!0,o="%"===String(t.r).substr(-1)?"prgb":"rgb"):uf(t.h)&&uf(t.s)&&uf(t.v)?(i=ef(t.s),r=ef(t.v),e=function(t,e,n){t=6*Zp(t,360),e=Zp(e,100),n=Zp(n,100);var i=Math.floor(t),r=t-i,s=n*(1-e),a=n*(1-r*e),o=n*(1-(1-r)*e),l=i%6,u=[n,a,s,s,o,n][l],h=[o,n,n,a,s,s][l],c=[s,s,o,n,n,a][l];return{r:255*u,g:255*h,b:255*c}}(t.h,i,r),a=!0,o="hsv"):uf(t.h)&&uf(t.s)&&uf(t.l)&&(i=ef(t.s),s=ef(t.l),e=function(t,e,n){var i,r,s;function a(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=Zp(t,360),e=Zp(e,100),n=Zp(n,100),0===e)i=r=s=n;else{var o=n<.5?n*(1+e):n+e-n*e,l=2*n-o;i=a(l,o,t+1/3),r=a(l,o,t),s=a(l,o,t-1/3)}return{r:255*i,g:255*r,b:255*s}}(t.h,i,s),a=!0,o="hsl"),t.hasOwnProperty("a")&&(n=t.a));var l,u,h;return n=$p(n),{ok:a,format:t.format||o,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function Dp(t,e,n){t=Zp(t,255),e=Zp(e,255),n=Zp(n,255);var i,r,s=Math.max(t,e,n),a=Math.min(t,e,n),o=(s+a)/2;if(s==a)i=r=0;else{var l=s-a;switch(r=o>.5?l/(2-s-a):l/(s+a),s){case t:i=(e-n)/l+(e<n?6:0);break;case e:i=(n-t)/l+2;break;case n:i=(t-e)/l+4}i/=6}return{h:i,s:r,l:o}}function Ip(t,e,n){t=Zp(t,255),e=Zp(e,255),n=Zp(n,255);var i,r,s=Math.max(t,e,n),a=Math.min(t,e,n),o=s,l=s-a;if(r=0===s?0:l/s,s==a)i=0;else{switch(s){case t:i=(e-n)/l+(e<n?6:0);break;case e:i=(n-t)/l+2;break;case n:i=(t-e)/l+4}i/=6}return{h:i,s:r,v:o}}function Lp(t,e,n,i){var r=[tf(Math.round(t).toString(16)),tf(Math.round(e).toString(16)),tf(Math.round(n).toString(16))];return i&&r[0].charAt(0)==r[0].charAt(1)&&r[1].charAt(0)==r[1].charAt(1)&&r[2].charAt(0)==r[2].charAt(1)?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function Bp(t,e,n,i){return[tf(nf(i)),tf(Math.round(t).toString(16)),tf(Math.round(e).toString(16)),tf(Math.round(n).toString(16))].join("")}function Up(t,e){e=0===e?0:e||10;var n=Pp(t).toHsl();return n.s-=e/100,n.s=Kp(n.s),Pp(n)}function Op(t,e){e=0===e?0:e||10;var n=Pp(t).toHsl();return n.s+=e/100,n.s=Kp(n.s),Pp(n)}function Fp(t){return Pp(t).desaturate(100)}function kp(t,e){e=0===e?0:e||10;var n=Pp(t).toHsl();return n.l+=e/100,n.l=Kp(n.l),Pp(n)}function zp(t,e){e=0===e?0:e||10;var n=Pp(t).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-e/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-e/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-e/100*255))),Pp(n)}function qp(t,e){e=0===e?0:e||10;var n=Pp(t).toHsl();return n.l-=e/100,n.l=Kp(n.l),Pp(n)}function Gp(t,e){var n=Pp(t).toHsl(),i=(n.h+e)%360;return n.h=i<0?360+i:i,Pp(n)}function Vp(t){var e=Pp(t).toHsl();return e.h=(e.h+180)%360,Pp(e)}function Hp(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var n=Pp(t).toHsl(),i=[Pp(t)],r=360/e,s=1;s<e;s++)i.push(Pp({h:(n.h+s*r)%360,s:n.s,l:n.l}));return i}function jp(t){var e=Pp(t).toHsl(),n=e.h;return[Pp(t),Pp({h:(n+72)%360,s:e.s,l:e.l}),Pp({h:(n+216)%360,s:e.s,l:e.l})]}function Wp(t,e,n){e=e||6,n=n||30;var i=Pp(t).toHsl(),r=360/n,s=[Pp(t)];for(i.h=(i.h-(r*e>>1)+720)%360;--e;)i.h=(i.h+r)%360,s.push(Pp(i));return s}function Xp(t,e){e=e||6;for(var n=Pp(t).toHsv(),i=n.h,r=n.s,s=n.v,a=[],o=1/e;e--;)a.push(Pp({h:i,s:r,v:s})),s=(s+o)%1;return a}Pp.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,n,i=this.toRgb();return t=i.r/255,e=i.g/255,n=i.b/255,.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=$p(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=Ip(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=Ip(this._r,this._g,this._b),e=Math.round(360*t.h),n=Math.round(100*t.s),i=Math.round(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+i+"%)":"hsva("+e+", "+n+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var t=Dp(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=Dp(this._r,this._g,this._b),e=Math.round(360*t.h),n=Math.round(100*t.s),i=Math.round(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+i+"%)":"hsla("+e+", "+n+"%, "+i+"%, "+this._roundA+")"},toHex:function(t){return Lp(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,n,i,r){var s=[tf(Math.round(t).toString(16)),tf(Math.round(e).toString(16)),tf(Math.round(n).toString(16)),tf(nf(i))];if(r&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1))return s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0);return s.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*Zp(this._r,255))+"%",g:Math.round(100*Zp(this._g,255))+"%",b:Math.round(100*Zp(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*Zp(this._r,255))+"%, "+Math.round(100*Zp(this._g,255))+"%, "+Math.round(100*Zp(this._b,255))+"%)":"rgba("+Math.round(100*Zp(this._r,255))+"%, "+Math.round(100*Zp(this._g,255))+"%, "+Math.round(100*Zp(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(Qp[Lp(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+Bp(this._r,this._g,this._b,this._a),n=e,i=this._gradientType?"GradientType = 1, ":"";if(t){var r=Pp(t);n="#"+Bp(r._r,r._g,r._b,r._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,i=this._a<1&&this._a>=0;return e||!i||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return Pp(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(kp,arguments)},brighten:function(){return this._applyModification(zp,arguments)},darken:function(){return this._applyModification(qp,arguments)},desaturate:function(){return this._applyModification(Up,arguments)},saturate:function(){return this._applyModification(Op,arguments)},greyscale:function(){return this._applyModification(Fp,arguments)},spin:function(){return this._applyModification(Gp,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(Wp,arguments)},complement:function(){return this._applyCombination(Vp,arguments)},monochromatic:function(){return this._applyCombination(Xp,arguments)},splitcomplement:function(){return this._applyCombination(jp,arguments)},triad:function(){return this._applyCombination(Hp,[3])},tetrad:function(){return this._applyCombination(Hp,[4])}},Pp.fromRatio=function(t,e){if("object"==Cp(t)){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]="a"===i?t[i]:ef(t[i]));t=n}return Pp(t,e)},Pp.equals=function(t,e){return!(!t||!e)&&Pp(t).toRgbString()==Pp(e).toRgbString()},Pp.random=function(){return Pp.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},Pp.mix=function(t,e,n){n=0===n?0:n||50;var i=Pp(t).toRgb(),r=Pp(e).toRgb(),s=n/100;return Pp({r:(r.r-i.r)*s+i.r,g:(r.g-i.g)*s+i.g,b:(r.b-i.b)*s+i.b,a:(r.a-i.a)*s+i.a})},1 // Version 2.34.6 globe.gl - https://github.com/vasturiano/globe.gl 2 !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Globe=t()}(this,(function(){"use strict";function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function t(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function r(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?n(Object(i),!0).forEach((function(n){t(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function i(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(t,n){if(t){if("string"==typeof t)return e(t,n);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}(".scene-container .clickable {\n cursor: pointer;\n}");const s="171",a={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},o=0,l=1,u=2,c=3,A=0,h=1,d=2,p=100,f=101,m=102,g=200,v=201,_=202,y=203,x=204,b=205,S=206,T=207,w=208,M=209,E=210,C=211,R=212,N=213,P=214,D=0,L=1,I=2,U=3,B=4,O=5,F=6,k=7,q=301,G=302,z=303,V=304,H=306,j=1e3,W=1001,X=1002,Q=1003,Y=1004,$=1005,K=1006,Z=1007,J=1008,ee=1009,te=1010,ne=1011,re=1012,ie=1013,se=1014,ae=1015,oe=1016,le=1017,ue=1018,ce=1020,Ae=35902,he=1021,de=1022,pe=1023,fe=1024,me=1025,ge=1026,ve=1027,_e=1028,ye=1029,xe=1030,be=1031,Se=1033,Te=33776,we=33777,Me=33778,Ee=33779,Ce=35840,Re=35841,Ne=35842,Pe=35843,De=36196,Le=37492,Ie=37496,Ue=37808,Be=37809,Oe=37810,Fe=37811,ke=37812,qe=37813,Ge=37814,ze=37815,Ve=37816,He=37817,je=37818,We=37819,Xe=37820,Qe=37821,Ye=36492,$e=36494,Ke=36495,Ze=36283,Je=36284,et=36285,tt=36286,nt="",rt="srgb",it="srgb-linear",st="linear",at="srgb",ot=7680,lt=512,ut=513,ct=514,At=515,ht=516,dt=517,pt=518,ft=519,mt=35044,gt=35048,vt="300 es",_t=2e3,yt=2001;class xt{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;const n=this._listeners[e];if(void 0!==n){const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;const t=this._listeners[e.type];if(void 0!==t){e.target=this;const n=t.slice(0);for(let t=0,r=n.length;t<r;t++)n[t].call(this,e);e.target=null}}}const bt=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let St=1234567;const Tt=Math.PI/180,wt=180/Math.PI;function Mt(){const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(bt[255&e]+bt[e>>8&255]+bt[e>>16&255]+bt[e>>24&255]+"-"+bt[255&t]+bt[t>>8&255]+"-"+bt[t>>16&15|64]+bt[t>>24&255]+"-"+bt[63&n|128]+bt[n>>8&255]+"-"+bt[n>>16&255]+bt[n>>24&255]+bt[255&r]+bt[r>>8&255]+bt[r>>16&255]+bt[r>>24&255]).toLowerCase()}function Et(e,t,n){return Math.max(t,Math.min(n,e))}function Ct(e,t){return(e%t+t)%t}function Rt(e,t,n){return(1-n)*e+n*t}function Nt(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function Pt(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(4294967295*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(2147483647*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("Invalid component type.")}}const Dt={DEG2RAD:Tt,RAD2DEG:wt,generateUUID:Mt,clamp:Et,euclideanModulo:Ct,mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},inverseLerp:function(e,t,n){return e!==t?(n-e)/(t-e):0},lerp:Rt,damp:function(e,t,n,r){return Rt(e,t,1-Math.exp(-n*r))},pingpong:function(e,t=1){return t-Math.abs(Ct(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(St=e);let t=St+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296},degToRad:function(e){return e*Tt},radToDeg:function(e){return e*wt},isPowerOfTwo:function(e){return!(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,r,i){const s=Math.cos,a=Math.sin,o=s(n/2),l=a(n/2),u=s((t+r)/2),c=a((t+r)/2),A=s((t-r)/2),h=a((t-r)/2),d=s((r-t)/2),p=a((r-t)/2);switch(i){case"XYX":e.set(o*c,l*A,l*h,o*u);break;case"YZY":e.set(l*h,o*c,l*A,o*u);break;case"ZXZ":e.set(l*A,l*h,o*c,o*u);break;case"XZX":e.set(o*c,l*p,l*d,o*u);break;case"YXY":e.set(l*d,o*c,l*p,o*u);break;case"ZYZ":e.set(l*p,l*d,o*c,o*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}},normalize:Pt,denormalize:Nt};class Lt{constructor(e=0,t=0){Lt.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Et(this.x,e.x,t.x),this.y=Et(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=Et(this.x,e,t),this.y=Et(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Et(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Et(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,s=this.y-e.y;return this.x=i*n-s*r+e.x,this.y=i*r+s*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class It{constructor(e,t,n,r,i,s,a,o,l){It.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,n,r,i,s,a,o,l)}set(e,t,n,r,i,s,a,o,l){const u=this.elements;return u[0]=e,u[1]=r,u[2]=a,u[3]=t,u[4]=i,u[5]=o,u[6]=n,u[7]=s,u[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,s=n[0],a=n[3],o=n[6],l=n[1],u=n[4],c=n[7],A=n[2],h=n[5],d=n[8],p=r[0],f=r[3],m=r[6],g=r[1],v=r[4],_=r[7],y=r[2],x=r[5],b=r[8];return i[0]=s*p+a*g+o*y,i[3]=s*f+a*v+o*x,i[6]=s*m+a*_+o*b,i[1]=l*p+u*g+c*y,i[4]=l*f+u*v+c*x,i[7]=l*m+u*_+c*b,i[2]=A*p+h*g+d*y,i[5]=A*f+h*v+d*x,i[8]=A*m+h*_+d*b,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],s=e[4],a=e[5],o=e[6],l=e[7],u=e[8];return t*s*u-t*a*l-n*i*u+n*a*o+r*i*l-r*s*o}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],s=e[4],a=e[5],o=e[6],l=e[7],u=e[8],c=u*s-a*l,A=a*o-u*i,h=l*i-s*o,d=t*c+n*A+r*h;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);const p=1/d;return e[0]=c*p,e[1]=(r*l-u*n)*p,e[2]=(a*n-r*s)*p,e[3]=A*p,e[4]=(u*t-r*o)*p,e[5]=(r*i-a*t)*p,e[6]=h*p,e[7]=(n*o-l*t)*p,e[8]=(s*t-n*i)*p,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,s,a){const o=Math.cos(i),l=Math.sin(i);return this.set(n*o,n*l,-n*(o*s+l*a)+s+e,-r*l,r*o,-r*(-l*s+o*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(Ut.makeScale(e,t)),this}rotate(e){return this.premultiply(Ut.makeRotation(-e)),this}translate(e,t){return this.premultiply(Ut.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}const Ut=new It;function Bt(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function Ot(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function Ft(){const e=Ot("canvas");return e.style.display="block",e}const kt={};function qt(e){e in kt||(kt[e]=!0,console.warn(e))}const Gt=(new It).set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),zt=(new It).set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Vt(){const e={enabled:!0,workingColorSpace:it,spaces:{},convert:function(e,t,n){return!1!==this.enabled&&t!==n&&t&&n?(this.spaces[t].transfer===at&&(e.r=jt(e.r),e.g=jt(e.g),e.b=jt(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===at&&(e.r=Wt(e.r),e.g=Wt(e.g),e.b=Wt(e.b)),e):e},fromWorkingColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return e===nt?st:this.spaces[e].transfer},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace}},t=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return e.define({[it]:{primaries:t,whitePoint:r,transfer:st,toXYZ:Gt,fromXYZ:zt,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:rt},outputColorSpaceConfig:{drawingBufferColorSpace:rt}},[rt]:{primaries:t,whitePoint:r,transfer:at,toXYZ:Gt,fromXYZ:zt,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:rt}}}),e}const Ht=Vt();function jt(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Wt(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}let Xt;class Qt{static getDataURL(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===Xt&&(Xt=Ot("canvas")),Xt.width=e.width,Xt.height=e.height;const n=Xt.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Xt}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const t=Ot("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e<i.length;e++)i[e]=255*jt(i[e]/255);return n.putImageData(r,0,0),t}if(e.data){const t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(255*jt(t[e]/255)):t[e]=jt(t[e]);return{data:t,width:e.width,height:e.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let Yt=0;class $t{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Yt++}),this.uuid=Mt(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){!0===e&&this.version++}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];const n={uuid:this.uuid,url:""},r=this.data;if(null!==r){let e;if(Array.isArray(r)){e=[];for(let t=0,n=r.length;t<n;t++)r[t].isDataTexture?e.push(Kt(r[t].image)):e.push(Kt(r[t]))}else e=Kt(r);n.url=e}return t||(e.images[this.uuid]=n),n}}function Kt(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?Qt.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Zt=0;class Jt extends xt{constructor(e=Jt.DEFAULT_IMAGE,t=Jt.DEFAULT_MAPPING,n=1001,r=1001,i=1006,s=1008,a=1023,o=1009,l=Jt.DEFAULT_ANISOTROPY,u=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Zt++}),this.uuid=Mt(),this.name="",this.source=new $t(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=s,this.anisotropy=l,this.format=a,this.internalFormat=null,this.type=o,this.offset=new Lt(0,0),this.repeat=new Lt(1,1),this.center=new Lt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new It,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case j:e.x=e.x-Math.floor(e.x);break;case W:e.x=e.x<0?0:1;break;case X:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case j:e.y=e.y-Math.floor(e.y);break;case W:e.y=e.y<0?0:1;break;case X:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){!0===e&&this.pmremVersion++}}Jt.DEFAULT_IMAGE=null,Jt.DEFAULT_MAPPING=300,Jt.DEFAULT_ANISOTROPY=1;class en{constructor(e=0,t=0,n=0,r=1){en.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,i=this.w,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*r+s[12]*i,this.y=s[1]*t+s[5]*n+s[9]*r+s[13]*i,this.z=s[2]*t+s[6]*n+s[10]*r+s[14]*i,this.w=s[3]*t+s[7]*n+s[11]*r+s[15]*i,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i;const s=.01,a=.1,o=e.elements,l=o[0],u=o[4],c=o[8],A=o[1],h=o[5],d=o[9],p=o[2],f=o[6],m=o[10];if(Math.abs(u-A)<s&&Math.abs(c-p)<s&&Math.abs(d-f)<s){if(Math.abs(u+A)<a&&Math.abs(c+p)<a&&Math.abs(d+f)<a&&Math.abs(l+h+m-3)<a)return this.set(1,0,0,0),this;t=Math.PI;const e=(l+1)/2,o=(h+1)/2,g=(m+1)/2,v=(u+A)/4,_=(c+p)/4,y=(d+f)/4;return e>o&&e>g?e<s?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=v/n,i=_/n):o>g?o<s?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(o),n=v/r,i=y/r):g<s?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(g),n=_/i,r=y/i),this.set(n,r,i,t),this}let g=Math.sqrt((f-d)*(f-d)+(c-p)*(c-p)+(A-u)*(A-u));return Math.abs(g)<.001&&(g=1),this.x=(f-d)/g,this.y=(c-p)/g,this.z=(A-u)/g,this.w=Math.acos((l+h+m-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Et(this.x,e.x,t.x),this.y=Et(this.y,e.y,t.y),this.z=Et(this.z,e.z,t.z),this.w=Et(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=Et(this.x,e,t),this.y=Et(this.y,e,t),this.z=Et(this.z,e,t),this.w=Et(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Et(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class tn extends xt{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new en(0,0,e,t),this.scissorTest=!1,this.viewport=new en(0,0,e,t);const r={width:e,height:t,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:K,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);const i=new Jt(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);i.flipY=!1,i.generateMipmaps=n.generateMipmaps,i.internalFormat=n.internalFormat,this.textures=[];const s=n.count;for(let e=0;e<s;e++)this.textures[e]=i.clone(),this.textures[e].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,i=this.textures.length;r<i;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=n;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++)this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new $t(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class nn extends tn{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class rn extends Jt{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Q,this.minFilter=Q,this.wrapR=W,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class sn extends Jt{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Q,this.minFilter=Q,this.wrapR=W,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class an{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,s,a){let o=n[r+0],l=n[r+1],u=n[r+2],c=n[r+3];const A=i[s+0],h=i[s+1],d=i[s+2],p=i[s+3];if(0===a)return e[t+0]=o,e[t+1]=l,e[t+2]=u,void(e[t+3]=c);if(1===a)return e[t+0]=A,e[t+1]=h,e[t+2]=d,void(e[t+3]=p);if(c!==p||o!==A||l!==h||u!==d){let e=1-a;const t=o*A+l*h+u*d+c*p,n=t>=0?1:-1,r=1-t*t;if(r>Number.EPSILON){const i=Math.sqrt(r),s=Math.atan2(i,t*n);e=Math.sin(e*s)/i,a=Math.sin(a*s)/i}const i=a*n;if(o=o*e+A*i,l=l*e+h*i,u=u*e+d*i,c=c*e+p*i,e===1-a){const e=1/Math.sqrt(o*o+l*l+u*u+c*c);o*=e,l*=e,u*=e,c*=e}}e[t]=o,e[t+1]=l,e[t+2]=u,e[t+3]=c}static multiplyQuaternionsFlat(e,t,n,r,i,s){const a=n[r],o=n[r+1],l=n[r+2],u=n[r+3],c=i[s],A=i[s+1],h=i[s+2],d=i[s+3];return e[t]=a*d+u*c+o*h-l*A,e[t+1]=o*d+u*A+l*c-a*h,e[t+2]=l*d+u*h+a*A-o*c,e[t+3]=u*d-a*c-o*A-l*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,r=e._y,i=e._z,s=e._order,a=Math.cos,o=Math.sin,l=a(n/2),u=a(r/2),c=a(i/2),A=o(n/2),h=o(r/2),d=o(i/2);switch(s){case"XYZ":this._x=A*u*c+l*h*d,this._y=l*h*c-A*u*d,this._z=l*u*d+A*h*c,this._w=l*u*c-A*h*d;break;case"YXZ":this._x=A*u*c+l*h*d,this._y=l*h*c-A*u*d,this._z=l*u*d-A*h*c,this._w=l*u*c+A*h*d;break;case"ZXY":this._x=A*u*c-l*h*d,this._y=l*h*c+A*u*d,this._z=l*u*d+A*h*c,this._w=l*u*c-A*h*d;break;case"ZYX":this._x=A*u*c-l*h*d,this._y=l*h*c+A*u*d,this._z=l*u*d-A*h*c,this._w=l*u*c+A*h*d;break;case"YZX":this._x=A*u*c+l*h*d,this._y=l*h*c+A*u*d,this._z=l*u*d-A*h*c,this._w=l*u*c-A*h*d;break;case"XZY":this._x=A*u*c-l*h*d,this._y=l*h*c-A*u*d,this._z=l*u*d+A*h*c,this._w=l*u*c+A*h*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],i=t[8],s=t[1],a=t[5],o=t[9],l=t[2],u=t[6],c=t[10],A=n+a+c;if(A>0){const e=.5/Math.sqrt(A+1);this._w=.25/e,this._x=(u-o)*e,this._y=(i-l)*e,this._z=(s-r)*e}else if(n>a&&n>c){const e=2*Math.sqrt(1+n-a-c);this._w=(u-o)/e,this._x=.25*e,this._y=(r+s)/e,this._z=(i+l)/e}else if(a>c){const e=2*Math.sqrt(1+a-n-c);this._w=(i-l)/e,this._x=(r+s)/e,this._y=.25*e,this._z=(o+u)/e}else{const e=2*Math.sqrt(1+c-n-a);this._w=(s-r)/e,this._x=(i+l)/e,this._y=(o+u)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Et(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,i=e._z,s=e._w,a=t._x,o=t._y,l=t._z,u=t._w;return this._x=n*u+s*a+r*l-i*o,this._y=r*u+s*o+i*a-n*l,this._z=i*u+s*l+n*o-r*a,this._w=s*u-n*a-r*o-i*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,r=this._y,i=this._z,s=this._w;let a=s*e._w+n*e._x+r*e._y+i*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=s,this._x=n,this._y=r,this._z=i,this;const o=1-a*a;if(o<=Number.EPSILON){const e=1-t;return this._w=e*s+t*this._w,this._x=e*n+t*this._x,this._y=e*r+t*this._y,this._z=e*i+t*this._z,this.normalize(),this}const l=Math.sqrt(o),u=Math.atan2(l,a),c=Math.sin((1-t)*u)/l,A=Math.sin(t*u)/l;return this._w=s*c+this._w*A,this._x=n*c+this._x*A,this._y=r*c+this._y*A,this._z=i*c+this._z*A,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),i*Math.sin(t),i*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class on{constructor(e=0,t=0,n=0){on.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(un.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(un.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,i=e.elements,s=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*s,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*s,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*s,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,i=e.x,s=e.y,a=e.z,o=e.w,l=2*(s*r-a*n),u=2*(a*t-i*r),c=2*(i*n-s*t);return this.x=t+o*l+s*c-a*u,this.y=n+o*u+a*l-i*c,this.z=r+o*c+i*u-s*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Et(this.x,e.x,t.x),this.y=Et(this.y,e.y,t.y),this.z=Et(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=Et(this.x,e,t),this.y=Et(this.y,e,t),this.z=Et(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Et(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,i=e.z,s=t.x,a=t.y,o=t.z;return this.x=r*o-i*a,this.y=i*s-n*o,this.z=n*a-r*s,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return ln.copy(this).projectOnVector(e),this.sub(ln)}reflect(e){return this.sub(ln.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Et(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=2*Math.random()-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const ln=new on,un=new an;class cn{constructor(e=new on(1/0,1/0,1/0),t=new on(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(hn.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(hn.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=hn.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(void 0!==n){const r=n.getAttribute("position");if(!0===t&&void 0!==r&&!0!==e.isInstancedMesh)for(let t=0,n=r.count;t<n;t++)!0===e.isMesh?e.getVertexPosition(t,hn):hn.fromBufferAttribute(r,t),hn.applyMatrix4(e.matrixWorld),this.expandByPoint(hn);else void 0!==e.boundingBox?(null===e.boundingBox&&e.computeBoundingBox(),dn.copy(e.boundingBox)):(null===n.boundingBox&&n.computeBoundingBox(),dn.copy(n.boundingBox)),dn.applyMatrix4(e.matrixWorld),this.union(dn)}const r=e.children;for(let e=0,n=r.length;e<n;e++)this.expandByObject(r[e],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,hn),hn.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(yn),xn.subVectors(this.max,yn),pn.subVectors(e.a,yn),fn.subVectors(e.b,yn),mn.subVectors(e.c,yn),gn.subVectors(fn,pn),vn.subVectors(mn,fn),_n.subVectors(pn,mn);let t=[0,-gn.z,gn.y,0,-vn.z,vn.y,0,-_n.z,_n.y,gn.z,0,-gn.x,vn.z,0,-vn.x,_n.z,0,-_n.x,-gn.y,gn.x,0,-vn.y,vn.x,0,-_n.y,_n.x,0];return!!Tn(t,pn,fn,mn,xn)&&(t=[1,0,0,0,1,0,0,0,1],!!Tn(t,pn,fn,mn,xn)&&(bn.crossVectors(gn,vn),t=[bn.x,bn.y,bn.z],Tn(t,pn,fn,mn,xn)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,hn).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(hn).length()),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(An[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),An[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),An[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),An[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),An[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),An[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),An[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),An[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(An)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const An=[new on,new on,new on,new on,new on,new on,new on,new on],hn=new on,dn=new cn,pn=new on,fn=new on,mn=new on,gn=new on,vn=new on,_n=new on,yn=new on,xn=new on,bn=new on,Sn=new on;function Tn(e,t,n,r,i){for(let s=0,a=e.length-3;s<=a;s+=3){Sn.fromArray(e,s);const a=i.x*Math.abs(Sn.x)+i.y*Math.abs(Sn.y)+i.z*Math.abs(Sn.z),o=t.dot(Sn),l=n.dot(Sn),u=r.dot(Sn);if(Math.max(-Math.max(o,l,u),Math.min(o,l,u))>a)return!1}return!0}const wn=new cn,Mn=new on,En=new on;class Cn{constructor(e=new on,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;void 0!==t?n.copy(t):wn.setFromPoints(e).getCenter(n);let r=0;for(let t=0,i=e.length;t<i;t++)r=Math.max(r,n.distanceToSquared(e[t]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Mn.subVectors(e,this.center);const t=Mn.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),n=.5*(e-this.radius);this.center.addScaledVector(Mn,n/e),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(En.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Mn.copy(e.center).add(En)),this.expandByPoint(Mn.copy(e.center).sub(En))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Rn=new on,Nn=new on,Pn=new on,Dn=new on,Ln=new on,In=new on,Un=new on;class Bn{constructor(e=new on,t=new on(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Rn)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Rn.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Rn.copy(this.origin).addScaledVector(this.direction,t),Rn.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){Nn.copy(e).add(t).multiplyScalar(.5),Pn.copy(t).sub(e).normalize(),Dn.copy(this.origin).sub(Nn);const i=.5*e.distanceTo(t),s=-this.direction.dot(Pn),a=Dn.dot(this.direction),o=-Dn.dot(Pn),l=Dn.lengthSq(),u=Math.abs(1-s*s);let c,A,h,d;if(u>0)if(c=s*o-a,A=s*a-o,d=i*u,c>=0)if(A>=-d)if(A<=d){const e=1/u;c*=e,A*=e,h=c*(c+s*A+2*a)+A*(s*c+A+2*o)+l}else A=i,c=Math.max(0,-(s*A+a)),h=-c*c+A*(A+2*o)+l;else A=-i,c=Math.max(0,-(s*A+a)),h=-c*c+A*(A+2*o)+l;else A<=-d?(c=Math.max(0,-(-s*i+a)),A=c>0?-i:Math.min(Math.max(-i,-o),i),h=-c*c+A*(A+2*o)+l):A<=d?(c=0,A=Math.min(Math.max(-i,-o),i),h=A*(A+2*o)+l):(c=Math.max(0,-(s*i+a)),A=c>0?i:Math.min(Math.max(-i,-o),i),h=-c*c+A*(A+2*o)+l);else A=s>0?-i:i,c=Math.max(0,-(s*A+a)),h=-c*c+A*(A+2*o)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,c),r&&r.copy(Nn).addScaledVector(Pn,A),h}intersectSphere(e,t){Rn.subVectors(e.center,this.origin);const n=Rn.dot(this.direction),r=Rn.dot(Rn)-n*n,i=e.radius*e.radius;if(r>i)return null;const s=Math.sqrt(i-r),a=n-s,o=n+s;return o<0?null:a<0?this.at(o,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);if(0===t)return!0;return e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,s,a,o;const l=1/this.direction.x,u=1/this.direction.y,c=1/this.direction.z,A=this.origin;return l>=0?(n=(e.min.x-A.x)*l,r=(e.max.x-A.x)*l):(n=(e.max.x-A.x)*l,r=(e.min.x-A.x)*l),u>=0?(i=(e.min.y-A.y)*u,s=(e.max.y-A.y)*u):(i=(e.max.y-A.y)*u,s=(e.min.y-A.y)*u),n>s||i>r?null:((i>n||isNaN(n))&&(n=i),(s<r||isNaN(r))&&(r=s),c>=0?(a=(e.min.z-A.z)*c,o=(e.max.z-A.z)*c):(a=(e.max.z-A.z)*c,o=(e.min.z-A.z)*c),n>o||a>r?null:((a>n||n!=n)&&(n=a),(o<r||r!=r)&&(r=o),r<0?null:this.at(n>=0?n:r,t)))}intersectsBox(e){return null!==this.intersectBox(e,Rn)}intersectTriangle(e,t,n,r,i){Ln.subVectors(t,e),In.subVectors(n,e),Un.crossVectors(Ln,In);let s,a=this.direction.dot(Un);if(a>0){if(r)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}Dn.subVectors(this.origin,e);const o=s*this.direction.dot(In.crossVectors(Dn,In));if(o<0)return null;const l=s*this.direction.dot(Ln.cross(Dn));if(l<0)return null;if(o+l>a)return null;const u=-s*Dn.dot(Un);return u<0?null:this.at(u/a,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class On{constructor(e,t,n,r,i,s,a,o,l,u,c,A,h,d,p,f){On.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,n,r,i,s,a,o,l,u,c,A,h,d,p,f)}set(e,t,n,r,i,s,a,o,l,u,c,A,h,d,p,f){const m=this.elements;return m[0]=e,m[4]=t,m[8]=n,m[12]=r,m[1]=i,m[5]=s,m[9]=a,m[13]=o,m[2]=l,m[6]=u,m[10]=c,m[14]=A,m[3]=h,m[7]=d,m[11]=p,m[15]=f,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new On).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,r=1/Fn.setFromMatrixColumn(e,0).length(),i=1/Fn.setFromMatrixColumn(e,1).length(),s=1/Fn.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*s,t[9]=n[9]*s,t[10]=n[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,r=e.y,i=e.z,s=Math.cos(n),a=Math.sin(n),o=Math.cos(r),l=Math.sin(r),u=Math.cos(i),c=Math.sin(i);if("XYZ"===e.order){const e=s*u,n=s*c,r=a*u,i=a*c;t[0]=o*u,t[4]=-o*c,t[8]=l,t[1]=n+r*l,t[5]=e-i*l,t[9]=-a*o,t[2]=i-e*l,t[6]=r+n*l,t[10]=s*o}else if("YXZ"===e.order){const e=o*u,n=o*c,r=l*u,i=l*c;t[0]=e+i*a,t[4]=r*a-n,t[8]=s*l,t[1]=s*c,t[5]=s*u,t[9]=-a,t[2]=n*a-r,t[6]=i+e*a,t[10]=s*o}else if("ZXY"===e.order){const e=o*u,n=o*c,r=l*u,i=l*c;t[0]=e-i*a,t[4]=-s*c,t[8]=r+n*a,t[1]=n+r*a,t[5]=s*u,t[9]=i-e*a,t[2]=-s*l,t[6]=a,t[10]=s*o}else if("ZYX"===e.order){const e=s*u,n=s*c,r=a*u,i=a*c;t[0]=o*u,t[4]=r*l-n,t[8]=e*l+i,t[1]=o*c,t[5]=i*l+e,t[9]=n*l-r,t[2]=-l,t[6]=a*o,t[10]=s*o}else if("YZX"===e.order){const e=s*o,n=s*l,r=a*o,i=a*l;t[0]=o*u,t[4]=i-e*c,t[8]=r*c+n,t[1]=c,t[5]=s*u,t[9]=-a*u,t[2]=-l*u,t[6]=n*c+r,t[10]=e-i*c}else if("XZY"===e.order){const e=s*o,n=s*l,r=a*o,i=a*l;t[0]=o*u,t[4]=-c,t[8]=l*u,t[1]=e*c+i,t[5]=s*u,t[9]=n*c-r,t[2]=r*c-n,t[6]=a*u,t[10]=i*c+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(qn,e,Gn)}lookAt(e,t,n){const r=this.elements;return Hn.subVectors(e,t),0===Hn.lengthSq()&&(Hn.z=1),Hn.normalize(),zn.crossVectors(n,Hn),0===zn.lengthSq()&&(1===Math.abs(n.z)?Hn.x+=1e-4:Hn.z+=1e-4,Hn.normalize(),zn.crossVectors(n,Hn)),zn.normalize(),Vn.crossVectors(Hn,zn),r[0]=zn.x,r[4]=Vn.x,r[8]=Hn.x,r[1]=zn.y,r[5]=Vn.y,r[9]=Hn.y,r[2]=zn.z,r[6]=Vn.z,r[10]=Hn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,s=n[0],a=n[4],o=n[8],l=n[12],u=n[1],c=n[5],A=n[9],h=n[13],d=n[2],p=n[6],f=n[10],m=n[14],g=n[3],v=n[7],_=n[11],y=n[15],x=r[0],b=r[4],S=r[8],T=r[12],w=r[1],M=r[5],E=r[9],C=r[13],R=r[2],N=r[6],P=r[10],D=r[14],L=r[3],I=r[7],U=r[11],B=r[15];return i[0]=s*x+a*w+o*R+l*L,i[4]=s*b+a*M+o*N+l*I,i[8]=s*S+a*E+o*P+l*U,i[12]=s*T+a*C+o*D+l*B,i[1]=u*x+c*w+A*R+h*L,i[5]=u*b+c*M+A*N+h*I,i[9]=u*S+c*E+A*P+h*U,i[13]=u*T+c*C+A*D+h*B,i[2]=d*x+p*w+f*R+m*L,i[6]=d*b+p*M+f*N+m*I,i[10]=d*S+p*E+f*P+m*U,i[14]=d*T+p*C+f*D+m*B,i[3]=g*x+v*w+_*R+y*L,i[7]=g*b+v*M+_*N+y*I,i[11]=g*S+v*E+_*P+y*U,i[15]=g*T+v*C+_*D+y*B,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],s=e[1],a=e[5],o=e[9],l=e[13],u=e[2],c=e[6],A=e[10],h=e[14];return e[3]*(+i*o*c-r*l*c-i*a*A+n*l*A+r*a*h-n*o*h)+e[7]*(+t*o*h-t*l*A+i*s*A-r*s*h+r*l*u-i*o*u)+e[11]*(+t*l*c-t*a*h-i*s*c+n*s*h+i*a*u-n*l*u)+e[15]*(-r*a*u-t*o*c+t*a*A+r*s*c-n*s*A+n*o*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],s=e[4],a=e[5],o=e[6],l=e[7],u=e[8],c=e[9],A=e[10],h=e[11],d=e[12],p=e[13],f=e[14],m=e[15],g=c*f*l-p*A*l+p*o*h-a*f*h-c*o*m+a*A*m,v=d*A*l-u*f*l-d*o*h+s*f*h+u*o*m-s*A*m,_=u*p*l-d*c*l+d*a*h-s*p*h-u*a*m+s*c*m,y=d*c*o-u*p*o-d*a*A+s*p*A+u*a*f-s*c*f,x=t*g+n*v+r*_+i*y;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const b=1/x;return e[0]=g*b,e[1]=(p*A*i-c*f*i-p*r*h+n*f*h+c*r*m-n*A*m)*b,e[2]=(a*f*i-p*o*i+p*r*l-n*f*l-a*r*m+n*o*m)*b,e[3]=(c*o*i-a*A*i-c*r*l+n*A*l+a*r*h-n*o*h)*b,e[4]=v*b,e[5]=(u*f*i-d*A*i+d*r*h-t*f*h-u*r*m+t*A*m)*b,e[6]=(d*o*i-s*f*i-d*r*l+t*f*l+s*r*m-t*o*m)*b,e[7]=(s*A*i-u*o*i+u*r*l-t*A*l-s*r*h+t*o*h)*b,e[8]=_*b,e[9]=(d*c*i-u*p*i-d*n*h+t*p*h+u*n*m-t*c*m)*b,e[10]=(s*p*i-d*a*i+d*n*l-t*p*l-s*n*m+t*a*m)*b,e[11]=(u*a*i-s*c*i-u*n*l+t*c*l+s*n*h-t*a*h)*b,e[12]=y*b,e[13]=(u*p*r-d*c*r+d*n*A-t*p*A-u*n*f+t*c*f)*b,e[14]=(d*a*r-s*p*r-d*n*o+t*p*o+s*n*f-t*a*f)*b,e[15]=(s*c*r-u*a*r+u*n*o-t*c*o-s*n*A+t*a*A)*b,this}scale(e){const t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),i=1-n,s=e.x,a=e.y,o=e.z,l=i*s,u=i*a;return this.set(l*s+n,l*a-r*o,l*o+r*a,0,l*a+r*o,u*a+n,u*o-r*s,0,l*o-r*a,u*o+r*s,i*o*o+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,i,s){return this.set(1,n,i,0,e,1,s,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,i=t._x,s=t._y,a=t._z,o=t._w,l=i+i,u=s+s,c=a+a,A=i*l,h=i*u,d=i*c,p=s*u,f=s*c,m=a*c,g=o*l,v=o*u,_=o*c,y=n.x,x=n.y,b=n.z;return r[0]=(1-(p+m))*y,r[1]=(h+_)*y,r[2]=(d-v)*y,r[3]=0,r[4]=(h-_)*x,r[5]=(1-(A+m))*x,r[6]=(f+g)*x,r[7]=0,r[8]=(d+v)*b,r[9]=(f-g)*b,r[10]=(1-(A+p))*b,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let i=Fn.set(r[0],r[1],r[2]).length();const s=Fn.set(r[4],r[5],r[6]).length(),a=Fn.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],kn.copy(this);const o=1/i,l=1/s,u=1/a;return kn.elements[0]*=o,kn.elements[1]*=o,kn.elements[2]*=o,kn.elements[4]*=l,kn.elements[5]*=l,kn.elements[6]*=l,kn.elements[8]*=u,kn.elements[9]*=u,kn.elements[10]*=u,t.setFromRotationMatrix(kn),n.x=i,n.y=s,n.z=a,this}makePerspective(e,t,n,r,i,s,a=2e3){const o=this.elements,l=2*i/(t-e),u=2*i/(n-r),c=(t+e)/(t-e),A=(n+r)/(n-r);let h,d;if(a===_t)h=-(s+i)/(s-i),d=-2*s*i/(s-i);else{if(a!==yt)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);h=-s/(s-i),d=-s*i/(s-i)}return o[0]=l,o[4]=0,o[8]=c,o[12]=0,o[1]=0,o[5]=u,o[9]=A,o[13]=0,o[2]=0,o[6]=0,o[10]=h,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(e,t,n,r,i,s,a=2e3){const o=this.elements,l=1/(t-e),u=1/(n-r),c=1/(s-i),A=(t+e)*l,h=(n+r)*u;let d,p;if(a===_t)d=(s+i)*c,p=-2*c;else{if(a!==yt)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);d=i*c,p=-1*c}return o[0]=2*l,o[4]=0,o[8]=0,o[12]=-A,o[1]=0,o[5]=2*u,o[9]=0,o[13]=-h,o[2]=0,o[6]=0,o[10]=p,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const Fn=new on,kn=new On,qn=new on(0,0,0),Gn=new on(1,1,1),zn=new on,Vn=new on,Hn=new on,jn=new On,Wn=new an;class Xn{constructor(e=0,t=0,n=0,r=Xn.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const r=e.elements,i=r[0],s=r[4],a=r[8],o=r[1],l=r[5],u=r[9],c=r[2],A=r[6],h=r[10];switch(t){case"XYZ":this._y=Math.asin(Et(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-s,i)):(this._x=Math.atan2(A,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Et(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-c,i),this._z=0);break;case"ZXY":this._x=Math.asin(Et(A,-1,1)),Math.abs(A)<.9999999?(this._y=Math.atan2(-c,h),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(o,i));break;case"ZYX":this._y=Math.asin(-Et(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(A,h),this._z=Math.atan2(o,i)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(Et(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-c,i)):(this._x=0,this._y=Math.atan2(a,h));break;case"XZY":this._z=Math.asin(-Et(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(A,l),this._y=Math.atan2(a,i)):(this._x=Math.atan2(-u,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return jn.makeRotationFromQuaternion(e),this.setFromRotationMatrix(jn,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Wn.setFromEuler(this),this.setFromQuaternion(Wn,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Xn.DEFAULT_ORDER="XYZ";class Qn{constructor(){this.mask=1}set(e){this.mask=1<<e>>>0}enable(e){this.mask|=1<<e}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e}disable(e){this.mask&=~(1<<e)}disableAll(){this.mask=0}test(e){return!!(this.mask&e.mask)}isEnabled(e){return!!(this.mask&1<<e)}}let Yn=0;const $n=new on,Kn=new an,Zn=new On,Jn=new on,er=new on,tr=new on,nr=new an,rr=new on(1,0,0),ir=new on(0,1,0),sr=new on(0,0,1),ar={type:"added"},or={type:"removed"},lr={type:"childadded",child:null},ur={type:"childremoved",child:null};class cr extends xt{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Yn++}),this.uuid=Mt(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=cr.DEFAULT_UP.clone();const e=new on,t=new Xn,n=new an,r=new on(1,1,1);t._onChange((function(){n.setFromEuler(t,!1)})),n._onChange((function(){t.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new On},normalMatrix:{value:new It}}),this.matrix=new On,this.matrixWorld=new On,this.matrixAutoUpdate=cr.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=cr.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Qn,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Kn.setFromAxisAngle(e,t),this.quaternion.multiply(Kn),this}rotateOnWorldAxis(e,t){return Kn.setFromAxisAngle(e,t),this.quaternion.premultiply(Kn),this}rotateX(e){return this.rotateOnAxis(rr,e)}rotateY(e){return this.rotateOnAxis(ir,e)}rotateZ(e){return this.rotateOnAxis(sr,e)}translateOnAxis(e,t){return $n.copy(e).applyQuaternion(this.quaternion),this.position.add($n.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(rr,e)}translateY(e){return this.translateOnAxis(ir,e)}translateZ(e){return this.translateOnAxis(sr,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Zn.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Jn.copy(e):Jn.set(e,t,n);const r=this.parent;this.updateWorldMatrix(!0,!1),er.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Zn.lookAt(er,Jn,this.up):Zn.lookAt(Jn,er,this.up),this.quaternion.setFromRotationMatrix(Zn),r&&(Zn.extractRotation(r.matrixWorld),Kn.setFromRotationMatrix(Zn),this.quaternion.premultiply(Kn.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(ar),lr.child=e,this.dispatchEvent(lr),lr.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}const t=this.children.indexOf(e);return-1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(or),ur.child=e,this.dispatchEvent(ur),ur.child=null),this}removeFromParent(){const e=this.parent;return null!==e&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Zn.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),Zn.multiply(e.parent.matrixWorld)),e.applyMatrix4(Zn),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(ar),lr.child=e,this.dispatchEvent(lr),lr.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){const r=this.children[n].getObjectByProperty(e,t);if(void 0!==r)return r}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const r=this.children;for(let i=0,s=r.length;i<s;i++)r[i].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(er,e,tr),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(er,nr,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,r=t.length;n<r;n++){t[n].updateMatrixWorld(e)}}updateWorldMatrix(e,t){const n=this.parent;if(!0===e&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),!0===t){const e=this.children;for(let t=0,n=e.length;t<n;t++){e[t].updateWorldMatrix(!1,!0)}}}toJSON(e){const t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const r={};function i(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map((e=>({boxInitialized:e.boxInitialized,boxMin:e.box.min.toArray(),boxMax:e.box.max.toArray(),sphereInitialized:e.sphereInitialized,sphereRadius:e.sphere.radius,sphereCenter:e.sphere.center.toArray()}))),r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),null!==this._colorsTexture&&(r.colorsTexture=this._colorsTexture.toJSON(e)),null!==this.boundingSphere&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),null!==this.boundingBox&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t<r;t++){const r=n[t];i(e.shapes,r)}else i(e.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(i(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const t=[];for(let n=0,r=this.material.length;n<r;n++)t.push(i(e.materials,this.material[n]));r.material=t}else r.material=i(e.materials,this.material);if(this.children.length>0){r.children=[];for(let t=0;t<this.children.length;t++)r.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let t=0;t<this.animations.length;t++){const n=this.animations[t];r.animations.push(i(e.animations,n))}}if(t){const t=s(e.geometries),r=s(e.materials),i=s(e.textures),a=s(e.images),o=s(e.shapes),l=s(e.skeletons),u=s(e.animations),c=s(e.nodes);t.length>0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),a.length>0&&(n.images=a),o.length>0&&(n.shapes=o),l.length>0&&(n.skeletons=l),u.length>0&&(n.animations=u),c.length>0&&(n.nodes=c)}return n.object=r,n;function s(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t<e.children.length;t++){const n=e.children[t];this.add(n.clone())}return this}}cr.DEFAULT_UP=new on(0,1,0),cr.DEFAULT_MATRIX_AUTO_UPDATE=!0,cr.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Ar=new on,hr=new on,dr=new on,pr=new on,fr=new on,mr=new on,gr=new on,vr=new on,_r=new on,yr=new on,xr=new en,br=new en,Sr=new en;class Tr{constructor(e=new on,t=new on,n=new on){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),Ar.subVectors(e,t),r.cross(Ar);const i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){Ar.subVectors(r,t),hr.subVectors(n,t),dr.subVectors(e,t);const s=Ar.dot(Ar),a=Ar.dot(hr),o=Ar.dot(dr),l=hr.dot(hr),u=hr.dot(dr),c=s*l-a*a;if(0===c)return i.set(0,0,0),null;const A=1/c,h=(l*o-a*u)*A,d=(s*u-a*o)*A;return i.set(1-h-d,d,h)}static containsPoint(e,t,n,r){return null!==this.getBarycoord(e,t,n,r,pr)&&(pr.x>=0&&pr.y>=0&&pr.x+pr.y<=1)}static getInterpolation(e,t,n,r,i,s,a,o){return null===this.getBarycoord(e,t,n,r,pr)?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(i,pr.x),o.addScaledVector(s,pr.y),o.addScaledVector(a,pr.z),o)}static getInterpolatedAttribute(e,t,n,r,i,s){return xr.setScalar(0),br.setScalar(0),Sr.setScalar(0),xr.fromBufferAttribute(e,t),br.fromBufferAttribute(e,n),Sr.fromBufferAttribute(e,r),s.setScalar(0),s.addScaledVector(xr,i.x),s.addScaledVector(br,i.y),s.addScaledVector(Sr,i.z),s}static isFrontFacing(e,t,n,r){return Ar.subVectors(n,t),hr.subVectors(e,t),Ar.cross(hr).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ar.subVectors(this.c,this.b),hr.subVectors(this.a,this.b),.5*Ar.cross(hr).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Tr.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Tr.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,r,i){return Tr.getInterpolation(e,this.a,this.b,this.c,t,n,r,i)}containsPoint(e){return Tr.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Tr.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,i=this.c;let s,a;fr.subVectors(r,n),mr.subVectors(i,n),vr.subVectors(e,n);const o=fr.dot(vr),l=mr.dot(vr);if(o<=0&&l<=0)return t.copy(n);_r.subVectors(e,r);const u=fr.dot(_r),c=mr.dot(_r);if(u>=0&&c<=u)return t.copy(r);const A=o*c-u*l;if(A<=0&&o>=0&&u<=0)return s=o/(o-u),t.copy(n).addScaledVector(fr,s);yr.subVectors(e,i);const h=fr.dot(yr),d=mr.dot(yr);if(d>=0&&h<=d)return t.copy(i);const p=h*l-o*d;if(p<=0&&l>=0&&d<=0)return a=l/(l-d),t.copy(n).addScaledVector(mr,a);const f=u*d-h*c;if(f<=0&&c-u>=0&&h-d>=0)return gr.subVectors(i,r),a=(c-u)/(c-u+(h-d)),t.copy(r).addScaledVector(gr,a);const m=1/(f+p+A);return s=p*m,a=A*m,t.copy(n).addScaledVector(fr,s).addScaledVector(mr,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const wr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Mr={h:0,s:0,l:0},Er={h:0,s:0,l:0};function Cr(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}let Rr=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(void 0===t&&void 0===n){const t=e;t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=rt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,Ht.toWorkingColorSpace(this,t),this}setRGB(e,t,n,r=Ht.workingColorSpace){return this.r=e,this.g=t,this.b=n,Ht.toWorkingColorSpace(this,r),this}setHSL(e,t,n,r=Ht.workingColorSpace){if(e=Ct(e,1),t=Et(t,0,1),n=Et(n,0,1),0===t)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=Cr(i,r,e+1/3),this.g=Cr(i,r,e),this.b=Cr(i,r,e-1/3)}return Ht.toWorkingColorSpace(this,r),this}setStyle(e,t=rt){function n(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let i;const s=r[1],a=r[2];switch(s){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const n=r[1],i=n.length;if(3===i)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(6===i)return this.setHex(parseInt(n,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=rt){const n=wr[e.toLowerCase()];return void 0!==n?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=jt(e.r),this.g=jt(e.g),this.b=jt(e.b),this}copyLinearToSRGB(e){return this.r=Wt(e.r),this.g=Wt(e.g),this.b=Wt(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=rt){return Ht.fromWorkingColorSpace(Nr.copy(this),e),65536*Math.round(Et(255*Nr.r,0,255))+256*Math.round(Et(255*Nr.g,0,255))+Math.round(Et(255*Nr.b,0,255))}getHexString(e=rt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Ht.workingColorSpace){Ht.fromWorkingColorSpace(Nr.copy(this),t);const n=Nr.r,r=Nr.g,i=Nr.b,s=Math.max(n,r,i),a=Math.min(n,r,i);let o,l;const u=(a+s)/2;if(a===s)o=0,l=0;else{const e=s-a;switch(l=u<=.5?e/(s+a):e/(2-s-a),s){case n:o=(r-i)/e+(r<i?6:0);break;case r:o=(i-n)/e+2;break;case i:o=(n-r)/e+4}o/=6}return e.h=o,e.s=l,e.l=u,e}getRGB(e,t=Ht.workingColorSpace){return Ht.fromWorkingColorSpace(Nr.copy(this),t),e.r=Nr.r,e.g=Nr.g,e.b=Nr.b,e}getStyle(e=rt){Ht.fromWorkingColorSpace(Nr.copy(this),e);const t=Nr.r,n=Nr.g,r=Nr.b;return e!==rt?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(255*t)},${Math.round(255*n)},${Math.round(255*r)})`}offsetHSL(e,t,n){return this.getHSL(Mr),this.setHSL(Mr.h+e,Mr.s+t,Mr.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(Mr),e.getHSL(Er);const n=Rt(Mr.h,Er.h,t),r=Rt(Mr.s,Er.s,t),i=Rt(Mr.l,Er.l,t);return this.setHSL(n,r,i),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,r=this.b,i=e.elements;return this.r=i[0]*t+i[3]*n+i[6]*r,this.g=i[1]*t+i[4]*n+i[7]*r,this.b=i[2]*t+i[5]*n+i[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};const Nr=new Rr;Rr.NAMES=wr;let Pr=0;class Dr extends xt{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Pr++}),this.uuid=Mt(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=x,this.blendDst=b,this.blendEquation=p,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Rr(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ot,this.stencilZFail=ot,this.stencilZPass=ot,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const n=e[t];if(void 0===n){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n:console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`)}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function r(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.dispersion&&(n.dispersion=this.dispersion),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),0!==this.side&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),this.blendSrc!==x&&(n.blendSrc=this.blendSrc),this.blendDst!==b&&(n.blendDst=this.blendDst),this.blendEquation!==p&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ot&&(n.stencilFail=this.stencilFail),this.stencilZFail!==ot&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==ot&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),t){const t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(null!==t){const e=t.length;n=new Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class Lr extends Dr{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Rr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Xn,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Ir=Ur();function Ur(){const e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),r=new Uint32Array(512),i=new Uint32Array(512);for(let e=0;e<256;++e){const t=e-127;t<-27?(r[e]=0,r[256|e]=32768,i[e]=24,i[256|e]=24):t<-14?(r[e]=1024>>-t-14,r[256|e]=1024>>-t-14|32768,i[e]=-t-1,i[256|e]=-t-1):t<=15?(r[e]=t+15<<10,r[256|e]=t+15<<10|32768,i[e]=13,i[256|e]=13):t<128?(r[e]=31744,r[256|e]=64512,i[e]=24,i[256|e]=24):(r[e]=31744,r[256|e]=64512,i[e]=13,i[256|e]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;!(8388608&t);)t<<=1,n-=8388608;t&=-8388609,n+=947912704,s[e]=t|n}for(let e=1024;e<2048;++e)s[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)a[e]=e<<23;a[31]=1199570944,a[32]=2147483648;for(let e=33;e<63;++e)a[e]=2147483648+(e-32<<23);a[63]=3347054592;for(let e=1;e<64;++e)32!==e&&(o[e]=1024);return{floatView:t,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:s,exponentTable:a,offsetTable:o}}function Br(e){Math.abs(e)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=Et(e,-65504,65504),Ir.floatView[0]=e;const t=Ir.uint32View[0],n=t>>23&511;return Ir.baseTable[n]+((8388607&t)>>Ir.shiftTable[n])}function Or(e){const t=e>>10;return Ir.uint32View[0]=Ir.mantissaTable[Ir.offsetTable[t]+(1023&e)]+Ir.exponentTable[t],Ir.floatView[0]}const Fr=new on,kr=new Lt;class qr{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=n,this.usage=mt,this.updateRanges=[],this.gpuType=ae,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,n=this.count;t<n;t++)kr.fromBufferAttribute(this,t),kr.applyMatrix3(e),this.setXY(t,kr.x,kr.y);else if(3===this.itemSize)for(let t=0,n=this.count;t<n;t++)Fr.fromBufferAttribute(this,t),Fr.applyMatrix3(e),this.setXYZ(t,Fr.x,Fr.y,Fr.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Fr.fromBufferAttribute(this,t),Fr.applyMatrix4(e),this.setXYZ(t,Fr.x,Fr.y,Fr.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Fr.fromBufferAttribute(this,t),Fr.applyNormalMatrix(e),this.setXYZ(t,Fr.x,Fr.y,Fr.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Fr.fromBufferAttribute(this,t),Fr.transformDirection(e),this.setXYZ(t,Fr.x,Fr.y,Fr.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=Nt(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Pt(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Nt(t,this.array)),t}setX(e,t){return this.normalized&&(t=Pt(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Nt(t,this.array)),t}setY(e,t){return this.normalized&&(t=Pt(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Nt(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Pt(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Nt(t,this.array)),t}setW(e,t){return this.normalized&&(t=Pt(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Pt(t,this.array),n=Pt(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Pt(t,this.array),n=Pt(n,this.array),r=Pt(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=Pt(t,this.array),n=Pt(n,this.array),r=Pt(r,this.array),i=Pt(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==mt&&(e.usage=this.usage),e}}class Gr extends qr{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class zr extends qr{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class Vr extends qr{constructor(e,t,n){super(new Uint16Array(e),t,n),this.isFloat16BufferAttribute=!0}getX(e){let t=Or(this.array[e*this.itemSize]);return this.normalized&&(t=Nt(t,this.array)),t}setX(e,t){return this.normalized&&(t=Pt(t,this.array)),this.array[e*this.itemSize]=Br(t),this}getY(e){let t=Or(this.array[e*this.itemSize+1]);return this.normalized&&(t=Nt(t,this.array)),t}setY(e,t){return this.normalized&&(t=Pt(t,this.array)),this.array[e*this.itemSize+1]=Br(t),this}getZ(e){let t=Or(this.array[e*this.itemSize+2]);return this.normalized&&(t=Nt(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Pt(t,this.array)),this.array[e*this.itemSize+2]=Br(t),this}getW(e){let t=Or(this.array[e*this.itemSize+3]);return this.normalized&&(t=Nt(t,this.array)),t}setW(e,t){return this.normalized&&(t=Pt(t,this.array)),this.array[e*this.itemSize+3]=Br(t),this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Pt(t,this.array),n=Pt(n,this.array)),this.array[e+0]=Br(t),this.array[e+1]=Br(n),this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Pt(t,this.array),n=Pt(n,this.array),r=Pt(r,this.array)),this.array[e+0]=Br(t),this.array[e+1]=Br(n),this.array[e+2]=Br(r),this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=Pt(t,this.array),n=Pt(n,this.array),r=Pt(r,this.array),i=Pt(i,this.array)),this.array[e+0]=Br(t),this.array[e+1]=Br(n),this.array[e+2]=Br(r),this.array[e+3]=Br(i),this}}class Hr extends qr{constructor(e,t,n){super(new Float32Array(e),t,n)}}let jr=0;const Wr=new On,Xr=new cr,Qr=new on,Yr=new cn,$r=new cn,Kr=new on;class Zr extends xt{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:jr++}),this.uuid=Mt(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(Bt(e)?zr:Gr)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const t=(new It).getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}const r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(e),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return Wr.makeRotationFromQuaternion(e),this.applyMatrix4(Wr),this}rotateX(e){return Wr.makeRotationX(e),this.applyMatrix4(Wr),this}rotateY(e){return Wr.makeRotationY(e),this.applyMatrix4(Wr),this}rotateZ(e){return Wr.makeRotationZ(e),this.applyMatrix4(Wr),this}translate(e,t,n){return Wr.makeTranslation(e,t,n),this.applyMatrix4(Wr),this}scale(e,t,n){return Wr.makeScale(e,t,n),this.applyMatrix4(Wr),this}lookAt(e){return Xr.lookAt(e),Xr.updateMatrix(),this.applyMatrix4(Xr.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Qr).negate(),this.translate(Qr.x,Qr.y,Qr.z),this}setFromPoints(e){const t=this.getAttribute("position");if(void 0===t){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];t.push(r.x,r.y,r.z||0)}this.setAttribute("position",new Hr(t,3))}else{const n=Math.min(e.length,t.count);for(let r=0;r<n;r++){const n=e[r];t.setXYZ(r,n.x,n.y,n.z||0)}e.length>t.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new cn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new on(-1/0,-1/0,-1/0),new on(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){const n=t[e];Yr.setFromBufferAttribute(n),this.morphTargetsRelative?(Kr.addVectors(this.boundingBox.min,Yr.min),this.boundingBox.expandByPoint(Kr),Kr.addVectors(this.boundingBox.max,Yr.max),this.boundingBox.expandByPoint(Kr)):(this.boundingBox.expandByPoint(Yr.min),this.boundingBox.expandByPoint(Yr.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Cn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new on,1/0);if(e){const n=this.boundingSphere.center;if(Yr.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){const n=t[e];$r.setFromBufferAttribute(n),this.morphTargetsRelative?(Kr.addVectors(Yr.min,$r.min),Yr.expandByPoint(Kr),Kr.addVectors(Yr.max,$r.max),Yr.expandByPoint(Kr)):(Yr.expandByPoint($r.min),Yr.expandByPoint($r.max))}Yr.getCenter(n);let r=0;for(let t=0,i=e.count;t<i;t++)Kr.fromBufferAttribute(e,t),r=Math.max(r,n.distanceToSquared(Kr));if(t)for(let i=0,s=t.length;i<s;i++){const s=t[i],a=this.morphTargetsRelative;for(let t=0,i=s.count;t<i;t++)Kr.fromBufferAttribute(s,t),a&&(Qr.fromBufferAttribute(e,t),Kr.add(Qr)),r=Math.max(r,n.distanceToSquared(Kr))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=t.position,r=t.normal,i=t.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new qr(new Float32Array(4*n.count),4));const s=this.getAttribute("tangent"),a=[],o=[];for(let e=0;e<n.count;e++)a[e]=new on,o[e]=new on;const l=new on,u=new on,c=new on,A=new Lt,h=new Lt,d=new Lt,p=new on,f=new on;function m(e,t,r){l.fromBufferAttribute(n,e),u.fromBufferAttribute(n,t),c.fromBufferAttribute(n,r),A.fromBufferAttribute(i,e),h.fromBufferAttribute(i,t),d.fromBufferAttribute(i,r),u.sub(l),c.sub(l),h.sub(A),d.sub(A);const s=1/(h.x*d.y-d.x*h.y);isFinite(s)&&(p.copy(u).multiplyScalar(d.y).addScaledVector(c,-h.y).multiplyScalar(s),f.copy(c).multiplyScalar(h.x).addScaledVector(u,-d.x).multiplyScalar(s),a[e].add(p),a[t].add(p),a[r].add(p),o[e].add(f),o[t].add(f),o[r].add(f))}let g=this.groups;0===g.length&&(g=[{start:0,count:e.count}]);for(let t=0,n=g.length;t<n;++t){const n=g[t],r=n.start;for(let t=r,i=r+n.count;t<i;t+=3)m(e.getX(t+0),e.getX(t+1),e.getX(t+2))}const v=new on,_=new on,y=new on,x=new on;function b(e){y.fromBufferAttribute(r,e),x.copy(y);const t=a[e];v.copy(t),v.sub(y.multiplyScalar(y.dot(t))).normalize(),_.crossVectors(x,t);const n=_.dot(o[e])<0?-1:1;s.setXYZW(e,v.x,v.y,v.z,n)}for(let t=0,n=g.length;t<n;++t){const n=g[t],r=n.start;for(let t=r,i=r+n.count;t<i;t+=3)b(e.getX(t+0)),b(e.getX(t+1)),b(e.getX(t+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(void 0!==t){let n=this.getAttribute("normal");if(void 0===n)n=new qr(new Float32Array(3*t.count),3),this.setAttribute("normal",n);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);const r=new on,i=new on,s=new on,a=new on,o=new on,l=new on,u=new on,c=new on;if(e)for(let A=0,h=e.count;A<h;A+=3){const h=e.getX(A+0),d=e.getX(A+1),p=e.getX(A+2);r.fromBufferAttribute(t,h),i.fromBufferAttribute(t,d),s.fromBufferAttribute(t,p),u.subVectors(s,i),c.subVectors(r,i),u.cross(c),a.fromBufferAttribute(n,h),o.fromBufferAttribute(n,d),l.fromBufferAttribute(n,p),a.add(u),o.add(u),l.add(u),n.setXYZ(h,a.x,a.y,a.z),n.setXYZ(d,o.x,o.y,o.z),n.setXYZ(p,l.x,l.y,l.z)}else for(let e=0,a=t.count;e<a;e+=3)r.fromBufferAttribute(t,e+0),i.fromBufferAttribute(t,e+1),s.fromBufferAttribute(t,e+2),u.subVectors(s,i),c.subVectors(r,i),u.cross(c),n.setXYZ(e+0,u.x,u.y,u.z),n.setXYZ(e+1,u.x,u.y,u.z),n.setXYZ(e+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Kr.fromBufferAttribute(e,t),Kr.normalize(),e.setXYZ(t,Kr.x,Kr.y,Kr.z)}toNonIndexed(){function e(e,t){const n=e.array,r=e.itemSize,i=e.normalized,s=new n.constructor(t.length*r);let a=0,o=0;for(let i=0,l=t.length;i<l;i++){a=e.isInterleavedBufferAttribute?t[i]*e.data.stride+e.offset:t[i]*r;for(let e=0;e<r;e++)s[o++]=n[a++]}return new qr(s,r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Zr,n=this.index.array,r=this.attributes;for(const i in r){const s=e(r[i],n);t.setAttribute(i,s)}const i=this.morphAttributes;for(const r in i){const s=[],a=i[r];for(let t=0,r=a.length;t<r;t++){const r=e(a[t],n);s.push(r)}t.morphAttributes[r]=s}t.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let e=0,n=s.length;e<n;e++){const n=s[e];t.addGroup(n.start,n.count,n.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const t in n){const r=n[t];e.data.attributes[t]=r.toJSON(e.data)}const r={};let i=!1;for(const t in this.morphAttributes){const n=this.morphAttributes[t],s=[];for(let t=0,r=n.length;t<r;t++){const r=n[t];s.push(r.toJSON(e.data))}s.length>0&&(r[t]=s,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return null!==a&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;null!==n&&this.setIndex(n.clone(t));const r=e.attributes;for(const e in r){const n=r[e];this.setAttribute(e,n.clone(t))}const i=e.morphAttributes;for(const e in i){const n=[],r=i[e];for(let e=0,i=r.length;e<i;e++)n.push(r[e].clone(t));this.morphAttributes[e]=n}this.morphTargetsRelative=e.morphTargetsRelative;const s=e.groups;for(let e=0,t=s.length;e<t;e++){const t=s[e];this.addGroup(t.start,t.count,t.materialIndex)}const a=e.boundingBox;null!==a&&(this.boundingBox=a.clone());const o=e.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const Jr=new On,ei=new Bn,ti=new Cn,ni=new on,ri=new on,ii=new on,si=new on,ai=new on,oi=new on,li=new on,ui=new on;class ci extends cr{constructor(e=new Zr,t=new Lr){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){const n=this.geometry,r=n.attributes.position,i=n.morphAttributes.position,s=n.morphTargetsRelative;t.fromBufferAttribute(r,e);const a=this.morphTargetInfluences;if(i&&a){oi.set(0,0,0);for(let n=0,r=i.length;n<r;n++){const r=a[n],o=i[n];0!==r&&(ai.fromBufferAttribute(o,e),s?oi.addScaledVector(ai,r):oi.addScaledVector(ai.sub(t),r))}t.add(oi)}return t}raycast(e,t){const n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0!==r){if(null===n.boundingSphere&&n.computeBoundingSphere(),ti.copy(n.boundingSphere),ti.applyMatrix4(i),ei.copy(e.ray).recast(e.near),!1===ti.containsPoint(ei.origin)){if(null===ei.intersectSphere(ti,ni))return;if(ei.origin.distanceToSquared(ni)>(e.far-e.near)**2)return}Jr.copy(i).invert(),ei.copy(e.ray).applyMatrix4(Jr),null!==n.boundingBox&&!1===ei.intersectsBox(n.boundingBox)||this._computeIntersections(e,t,ei)}}_computeIntersections(e,t,n){let r;const i=this.geometry,s=this.material,a=i.index,o=i.attributes.position,l=i.attributes.uv,u=i.attributes.uv1,c=i.attributes.normal,A=i.groups,h=i.drawRange;if(null!==a)if(Array.isArray(s))for(let i=0,o=A.length;i<o;i++){const o=A[i],d=s[o.materialIndex];for(let i=Math.max(o.start,h.start),s=Math.min(a.count,Math.min(o.start+o.count,h.start+h.count));i<s;i+=3){r=Ai(this,d,e,n,l,u,c,a.getX(i),a.getX(i+1),a.getX(i+2)),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=o.materialIndex,t.push(r))}}else{for(let i=Math.max(0,h.start),o=Math.min(a.count,h.start+h.count);i<o;i+=3){r=Ai(this,s,e,n,l,u,c,a.getX(i),a.getX(i+1),a.getX(i+2)),r&&(r.faceIndex=Math.floor(i/3),t.push(r))}}else if(void 0!==o)if(Array.isArray(s))for(let i=0,a=A.length;i<a;i++){const a=A[i],d=s[a.materialIndex];for(let i=Math.max(a.start,h.start),s=Math.min(o.count,Math.min(a.start+a.count,h.start+h.count));i<s;i+=3){r=Ai(this,d,e,n,l,u,c,i,i+1,i+2),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=a.materialIndex,t.push(r))}}else{for(let i=Math.max(0,h.start),a=Math.min(o.count,h.start+h.count);i<a;i+=3){r=Ai(this,s,e,n,l,u,c,i,i+1,i+2),r&&(r.faceIndex=Math.floor(i/3),t.push(r))}}}}function Ai(e,t,n,r,i,s,a,o,l,u){e.getVertexPosition(o,ri),e.getVertexPosition(l,ii),e.getVertexPosition(u,si);const c=function(e,t,n,r,i,s,a,o){let l;if(l=1===t.side?r.intersectTriangle(a,s,i,!0,o):r.intersectTriangle(i,s,a,0===t.side,o),null===l)return null;ui.copy(o),ui.applyMatrix4(e.matrixWorld);const u=n.ray.origin.distanceTo(ui);return u<n.near||u>n.far?null:{distance:u,point:ui.clone(),object:e}}(e,t,n,r,ri,ii,si,li);if(c){const e=new on;Tr.getBarycoord(li,ri,ii,si,e),i&&(c.uv=Tr.getInterpolatedAttribute(i,o,l,u,e,new Lt)),s&&(c.uv1=Tr.getInterpolatedAttribute(s,o,l,u,e,new Lt)),a&&(c.normal=Tr.getInterpolatedAttribute(a,o,l,u,e,new on),c.normal.dot(r.direction)>0&&c.normal.multiplyScalar(-1));const t={a:o,b:l,c:u,normal:new on,materialIndex:0};Tr.getNormal(ri,ii,si,t.normal),c.face=t,c.barycoord=e}return c}class hi extends Zr{constructor(e=1,t=1,n=1,r=1,i=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:s};const a=this;r=Math.floor(r),i=Math.floor(i),s=Math.floor(s);const o=[],l=[],u=[],c=[];let A=0,h=0;function d(e,t,n,r,i,s,d,p,f,m,g){const v=s/f,_=d/m,y=s/2,x=d/2,b=p/2,S=f+1,T=m+1;let w=0,M=0;const E=new on;for(let s=0;s<T;s++){const a=s*_-x;for(let o=0;o<S;o++){const A=o*v-y;E[e]=A*r,E[t]=a*i,E[n]=b,l.push(E.x,E.y,E.z),E[e]=0,E[t]=0,E[n]=p>0?1:-1,u.push(E.x,E.y,E.z),c.push(o/f),c.push(1-s/m),w+=1}}for(let e=0;e<m;e++)for(let t=0;t<f;t++){const n=A+t+S*e,r=A+t+S*(e+1),i=A+(t+1)+S*(e+1),s=A+(t+1)+S*e;o.push(n,r,s),o.push(r,i,s),M+=6}a.addGroup(h,M,g),h+=M,A+=w}d("z","y","x",-1,-1,n,t,e,s,i,0),d("z","y","x",1,-1,n,t,-e,s,i,1),d("x","z","y",1,1,e,n,t,r,s,2),d("x","z","y",1,-1,e,n,-t,r,s,3),d("x","y","z",1,-1,e,t,n,r,i,4),d("x","y","z",-1,-1,e,t,-n,r,i,5),this.setIndex(o),this.setAttribute("position",new Hr(l,3)),this.setAttribute("normal",new Hr(u,3)),this.setAttribute("uv",new Hr(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new hi(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function di(e){const t={};for(const n in e){t[n]={};for(const r in e[n]){const i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[n][r]=null):t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}}return t}function pi(e){const t={};for(let n=0;n<e.length;n++){const r=di(e[n]);for(const e in r)t[e]=r[e]}return t}function fi(e){const t=e.getRenderTarget();return null===t?e.outputColorSpace:!0===t.isXRRenderTarget?t.texture.colorSpace:Ht.workingColorSpace}const mi={clone:di,merge:pi};class gi extends Dr{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=di(e.uniforms),this.uniformsGroups=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].clone());return t}(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const n in this.uniforms){const r=this.uniforms[n].value;r&&r.isTexture?t.uniforms[n]={type:"t",value:r.toJSON(e).uuid}:r&&r.isColor?t.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?t.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?t.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?t.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?t.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?t.uniforms[n]={type:"m4",value:r.toArray()}:t.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class vi extends cr{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new On,this.projectionMatrix=new On,this.projectionMatrixInverse=new On,this.coordinateSystem=_t}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}const _i=new on,yi=new Lt,xi=new Lt;class bi extends vi{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*wt*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*Tt*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*wt*Math.atan(Math.tan(.5*Tt*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){_i.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(_i.x,_i.y).multiplyScalar(-e/_i.z),_i.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(_i.x,_i.y).multiplyScalar(-e/_i.z)}getViewSize(e,t){return this.getViewBounds(e,yi,xi),t.subVectors(xi,yi)}setViewOffset(e,t,n,r,i,s){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*Tt*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r;const s=this.view;if(null!==this.view&&this.view.enabled){const e=s.fullWidth,a=s.fullHeight;i+=s.offsetX*r/e,t-=s.offsetY*n/a,r*=s.width/e,n*=s.height/a}const a=this.filmOffset;0!==a&&(i+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Si=-90;class Ti extends cr{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new bi(Si,1,e,t);r.layers=this.layers,this.add(r);const i=new bi(Si,1,e,t);i.layers=this.layers,this.add(i);const s=new bi(Si,1,e,t);s.layers=this.layers,this.add(s);const a=new bi(Si,1,e,t);a.layers=this.layers,this.add(a);const o=new bi(Si,1,e,t);o.layers=this.layers,this.add(o);const l=new bi(Si,1,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,r,i,s,a,o]=t;for(const e of t)this.remove(e);if(e===_t)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else{if(e!==yt)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),o.up.set(0,-1,0),o.lookAt(0,0,-1)}for(const e of t)this.add(e),e.updateMatrixWorld()}update(e,t){null===this.parent&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[i,s,a,o,l,u]=this.children,c=e.getRenderTarget(),A=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),d=e.xr.enabled;e.xr.enabled=!1;const p=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,r),e.render(t,i),e.setRenderTarget(n,1,r),e.render(t,s),e.setRenderTarget(n,2,r),e.render(t,a),e.setRenderTarget(n,3,r),e.render(t,o),e.setRenderTarget(n,4,r),e.render(t,l),n.texture.generateMipmaps=p,e.setRenderTarget(n,5,r),e.render(t,u),e.setRenderTarget(c,A,h),e.xr.enabled=d,n.texture.needsPMREMUpdate=!0}}class wi extends Jt{constructor(e,t,n,r,i,s,a,o,l,u){super(e=void 0!==e?e:[],t=void 0!==t?t:q,n,r,i,s,a,o,l,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Mi extends nn{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];this.texture=new wi(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:K}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},r=new hi(5,5,5),i=new gi({name:"CubemapFromEquirect",uniforms:di(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=t;const s=new ci(r,i),a=t.minFilter;t.minFilter===J&&(t.minFilter=K);return new Ti(1,10,this).update(e,s),t.minFilter=a,s.geometry.dispose(),s.material.dispose(),this}clear(e,t,n,r){const i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,r);e.setRenderTarget(i)}}class Ei extends cr{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Xn,this.environmentIntensity=1,this.environmentRotation=new Xn,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class Ci{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=mt,this.updateRanges=[],this.version=0,this.uuid=Mt()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Mt()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Mt()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const Ri=new on;class Ni{constructor(e,t,n,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)Ri.fromBufferAttribute(this,t),Ri.applyMatrix4(e),this.setXYZ(t,Ri.x,Ri.y,Ri.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Ri.fromBufferAttribute(this,t),Ri.applyNormalMatrix(e),this.setXYZ(t,Ri.x,Ri.y,Ri.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Ri.fromBufferAttribute(this,t),Ri.transformDirection(e),this.setXYZ(t,Ri.x,Ri.y,Ri.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=Nt(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Pt(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=Pt(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Pt(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Pt(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Pt(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=Nt(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Nt(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Nt(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Nt(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Pt(t,this.array),n=Pt(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Pt(t,this.array),n=Pt(n,this.array),r=Pt(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Pt(t,this.array),n=Pt(n,this.array),r=Pt(r,this.array),i=Pt(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}clone(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return new qr(new this.array.constructor(e),this.itemSize,this.normalized)}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Ni(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class Pi extends Dr{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Rr(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}class Di extends Jt{constructor(e=null,t=1,n=1,r,i,s,a,o,l=1003,u=1003,c,A){super(null,s,a,o,l,u,r,i,c,A),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Li extends qr{constructor(e,t,n,r=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const Ii=new on,Ui=new on,Bi=new It;class Oi{constructor(e=new on(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const r=Ii.subVectors(n,t).cross(Ui.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(Ii),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:t.copy(e.start).addScaledVector(n,i)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||Bi.getNormalMatrix(e),r=this.coplanarPoint(Ii).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const Fi=new Cn,ki=new on;class qi{constructor(e=new Oi,t=new Oi,n=new Oi,r=new Oi,i=new Oi,s=new Oi){this.planes=[e,t,n,r,i,s]}set(e,t,n,r,i,s){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(r),a[4].copy(i),a[5].copy(s),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=2e3){const n=this.planes,r=e.elements,i=r[0],s=r[1],a=r[2],o=r[3],l=r[4],u=r[5],c=r[6],A=r[7],h=r[8],d=r[9],p=r[10],f=r[11],m=r[12],g=r[13],v=r[14],_=r[15];if(n[0].setComponents(o-i,A-l,f-h,_-m).normalize(),n[1].setComponents(o+i,A+l,f+h,_+m).normalize(),n[2].setComponents(o+s,A+u,f+d,_+g).normalize(),n[3].setComponents(o-s,A-u,f-d,_-g).normalize(),n[4].setComponents(o-a,A-c,f-p,_-v).normalize(),t===_t)n[5].setComponents(o+a,A+c,f+p,_+v).normalize();else{if(t!==yt)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);n[5].setComponents(a,c,p,v).normalize()}return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),Fi.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),Fi.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Fi)}intersectsSprite(e){return Fi.center.set(0,0,0),Fi.radius=.7071067811865476,Fi.applyMatrix4(e.matrixWorld),this.intersectsSphere(Fi)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++){if(t[e].distanceToPoint(n)<r)return!1}return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const r=t[n];if(ki.x=r.normal.x>0?e.max.x:e.min.x,ki.y=r.normal.y>0?e.max.y:e.min.y,ki.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(ki)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}class Gi extends Dr{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Rr(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const zi=new on,Vi=new on,Hi=new On,ji=new Bn,Wi=new Cn,Xi=new on,Qi=new on;class Yi extends cr{constructor(e=new Zr,t=new Gi){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,n=[0];for(let e=1,r=t.count;e<r;e++)zi.fromBufferAttribute(t,e-1),Vi.fromBufferAttribute(t,e),n[e]=n[e-1],n[e]+=zi.distanceTo(Vi);e.setAttribute("lineDistance",new Hr(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold,s=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),Wi.copy(n.boundingSphere),Wi.applyMatrix4(r),Wi.radius+=i,!1===e.ray.intersectsSphere(Wi))return;Hi.copy(r).invert(),ji.copy(e.ray).applyMatrix4(Hi);const a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,l=this.isLineSegments?2:1,u=n.index,c=n.attributes.position;if(null!==u){const n=Math.max(0,s.start),r=Math.min(u.count,s.start+s.count);for(let i=n,s=r-1;i<s;i+=l){const n=u.getX(i),r=u.getX(i+1),s=$i(this,e,ji,o,n,r);s&&t.push(s)}if(this.isLineLoop){const i=u.getX(r-1),s=u.getX(n),a=$i(this,e,ji,o,i,s);a&&t.push(a)}}else{const n=Math.max(0,s.start),r=Math.min(c.count,s.start+s.count);for(let i=n,s=r-1;i<s;i+=l){const n=$i(this,e,ji,o,i,i+1);n&&t.push(n)}if(this.isLineLoop){const i=$i(this,e,ji,o,r-1,n);i&&t.push(i)}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}function $i(e,t,n,r,i,s){const a=e.geometry.attributes.position;zi.fromBufferAttribute(a,i),Vi.fromBufferAttribute(a,s);if(n.distanceSqToSegment(zi,Vi,Xi,Qi)>r)return;Xi.applyMatrix4(e.matrixWorld);const o=t.ray.origin.distanceTo(Xi);return o<t.near||o>t.far?void 0:{distance:o,point:Qi.clone().applyMatrix4(e.matrixWorld),index:i,face:null,faceIndex:null,barycoord:null,object:e}}const Ki=new on,Zi=new on;class Ji extends Yi{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,n=[];for(let e=0,r=t.count;e<r;e+=2)Ki.fromBufferAttribute(t,e),Zi.fromBufferAttribute(t,e+1),n[e]=0===e?0:n[e-1],n[e+1]=n[e]+Ki.distanceTo(Zi);e.setAttribute("lineDistance",new Hr(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class es extends Dr{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Rr(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let ts=class extends cr{constructor(){super(),this.isGroup=!0,this.type="Group"}};class ns extends Jt{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Q,this.minFilter=Q,this.generateMipmaps=!1,this.needsUpdate=!0}}class rs extends Jt{constructor(e,t,n,r,i,s,a,o,l,u=1026){if(u!==ge&&u!==ve)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&u===ge&&(n=se),void 0===n&&u===ve&&(n=ce),super(null,r,i,s,a,o,u,n,l),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=void 0!==a?a:Q,this.minFilter=void 0!==o?o:Q,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return null!==this.compareFunction&&(t.compareFunction=this.compareFunction),t}}class is{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,r=this.getPoint(0),i=0;t.push(0);for(let s=1;s<=e;s++)n=this.getPoint(s/e),i+=n.distanceTo(r),t.push(i),r=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let r=0;const i=n.length;let s;s=t||e*n[i-1];let a,o=0,l=i-1;for(;o<=l;)if(r=Math.floor(o+(l-o)/2),a=n[r]-s,a<0)o=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(r=l,n[r]===s)return r/(i-1);const u=n[r];return(r+(s-u)/(n[r+1]-u))/(i-1)}getTangent(e,t){const n=1e-4;let r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);const s=this.getPoint(r),a=this.getPoint(i),o=t||(s.isVector2?new Lt:new on);return o.copy(a).sub(s).normalize(),o}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new on,r=[],i=[],s=[],a=new on,o=new On;for(let t=0;t<=e;t++){const n=t/e;r[t]=this.getTangentAt(n,new on)}i[0]=new on,s[0]=new on;let l=Number.MAX_VALUE;const u=Math.abs(r[0].x),c=Math.abs(r[0].y),A=Math.abs(r[0].z);u<=l&&(l=u,n.set(1,0,0)),c<=l&&(l=c,n.set(0,1,0)),A<=l&&n.set(0,0,1),a.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],a),s[0].crossVectors(r[0],i[0]);for(let t=1;t<=e;t++){if(i[t]=i[t-1].clone(),s[t]=s[t-1].clone(),a.crossVectors(r[t-1],r[t]),a.length()>Number.EPSILON){a.normalize();const e=Math.acos(Et(r[t-1].dot(r[t]),-1,1));i[t].applyMatrix4(o.makeRotationAxis(a,e))}s[t].crossVectors(r[t],i[t])}if(!0===t){let t=Math.acos(Et(i[0].dot(i[e]),-1,1));t/=e,r[0].dot(a.crossVectors(i[0],i[e]))>0&&(t=-t);for(let n=1;n<=e;n++)i[n].applyMatrix4(o.makeRotationAxis(r[n],t*n)),s[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class ss extends is{constructor(e=0,t=0,n=1,r=1,i=0,s=2*Math.PI,a=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=s,this.aClockwise=a,this.aRotation=o}getPoint(e,t=new Lt){const n=t,r=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const s=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=s?0:r),!0!==this.aClockwise||s||(i===r?i=-r:i-=r);const a=this.aStartAngle+e*i;let o=this.aX+this.xRadius*Math.cos(a),l=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){const e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),n=o-this.aX,r=l-this.aY;o=n*e-r*t+this.aX,l=n*t+r*e+this.aY}return n.set(o,l)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}function as(){let e=0,t=0,n=0,r=0;function i(i,s,a,o){e=i,t=a,n=-3*i+3*s-2*a-o,r=2*i-2*s+a+o}return{initCatmullRom:function(e,t,n,r,s){i(t,n,s*(n-e),s*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,s,a,o){let l=(t-e)/s-(n-e)/(s+a)+(n-t)/a,u=(n-t)/a-(r-t)/(a+o)+(r-n)/o;l*=a,u*=a,i(t,n,l,u)},calc:function(i){const s=i*i;return e+t*i+n*s+r*(s*i)}}}const os=new on,ls=new as,us=new as,cs=new as;function As(e,t,n,r,i){const s=.5*(r-t),a=.5*(i-n),o=e*e;return(2*n-2*r+s+a)*(e*o)+(-3*n+3*r-2*s-a)*o+s*e+n}function hs(e,t,n,r){return function(e,t){const n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,r)}function ds(e,t,n,r,i){return function(e,t){const n=1-e;return n*n*n*t}(e,t)+function(e,t){const n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,r)+function(e,t){return e*e*e*t}(e,i)}class ps extends is{constructor(e=new Lt,t=new Lt,n=new Lt,r=new Lt){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new Lt){const n=t,r=this.v0,i=this.v1,s=this.v2,a=this.v3;return n.set(ds(e,r.x,i.x,s.x,a.x),ds(e,r.y,i.y,s.y,a.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class fs extends is{constructor(e=new on,t=new on,n=new on,r=new on){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new on){const n=t,r=this.v0,i=this.v1,s=this.v2,a=this.v3;return n.set(ds(e,r.x,i.x,s.x,a.x),ds(e,r.y,i.y,s.y,a.y),ds(e,r.z,i.z,s.z,a.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class ms extends is{constructor(e=new Lt,t=new Lt){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Lt){const n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new Lt){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class gs extends is{constructor(e=new Lt,t=new Lt,n=new Lt){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new Lt){const n=t,r=this.v0,i=this.v1,s=this.v2;return n.set(hs(e,r.x,i.x,s.x),hs(e,r.y,i.y,s.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class vs extends is{constructor(e=new on,t=new on,n=new on){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new on){const n=t,r=this.v0,i=this.v1,s=this.v2;return n.set(hs(e,r.x,i.x,s.x),hs(e,r.y,i.y,s.y),hs(e,r.z,i.z,s.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class _s extends is{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new Lt){const n=t,r=this.points,i=(r.length-1)*e,s=Math.floor(i),a=i-s,o=r[0===s?s:s-1],l=r[s],u=r[s>r.length-2?r.length-1:s+1],c=r[s>r.length-3?r.length-1:s+2];return n.set(As(a,o.x,l.x,u.x,c.x),As(a,o.y,l.y,u.y,c.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const n=this.points[t];e.points.push(n.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push((new Lt).fromArray(n))}return this}}var ys=Object.freeze({__proto__:null,ArcCurve:class extends ss{constructor(e,t,n,r,i,s){super(e,t,n,n,r,i,s),this.isArcCurve=!0,this.type="ArcCurve"}},CatmullRomCurve3:class extends is{constructor(e=[],t=!1,n="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=r}getPoint(e,t=new on){const n=t,r=this.points,i=r.length,s=(i-(this.closed?0:1))*e;let a,o,l=Math.floor(s),u=s-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/i)+1)*i:0===u&&l===i-1&&(l=i-2,u=1),this.closed||l>0?a=r[(l-1)%i]:(os.subVectors(r[0],r[1]).add(r[0]),a=os);const c=r[l%i],A=r[(l+1)%i];if(this.closed||l+2<i?o=r[(l+2)%i]:(os.subVectors(r[i-1],r[i-2]).add(r[i-1]),o=os),"centripetal"===this.curveType||"chordal"===this.curveType){const e="chordal"===this.curveType?.5:.25;let t=Math.pow(a.distanceToSquared(c),e),n=Math.pow(c.distanceToSquared(A),e),r=Math.pow(A.distanceToSquared(o),e);n<1e-4&&(n=1),t<1e-4&&(t=n),r<1e-4&&(r=n),ls.initNonuniformCatmullRom(a.x,c.x,A.x,o.x,t,n,r),us.initNonuniformCatmullRom(a.y,c.y,A.y,o.y,t,n,r),cs.initNonuniformCatmullRom(a.z,c.z,A.z,o.z,t,n,r)}else"catmullrom"===this.curveType&&(ls.initCatmullRom(a.x,c.x,A.x,o.x,this.tension),us.initCatmullRom(a.y,c.y,A.y,o.y,this.tension),cs.initCatmullRom(a.z,c.z,A.z,o.z,this.tension));return n.set(ls.calc(u),us.calc(u),cs.calc(u)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push(n.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const n=this.points[t];e.points.push(n.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push((new on).fromArray(n))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}},CubicBezierCurve:ps,CubicBezierCurve3:fs,EllipseCurve:ss,LineCurve:ms,LineCurve3:class extends is{constructor(e=new on,t=new on){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new on){const n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new on){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},QuadraticBezierCurve:gs,QuadraticBezierCurve3:vs,SplineCurve:_s});class xs extends is{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){const n=!0===e.isVector2?"LineCurve":"LineCurve3";this.curves.push(new ys[n](t,e))}return this}getPoint(e,t){const n=e*this.getLength(),r=this.getCurveLengths();let i=0;for(;i<r.length;){if(r[i]>=n){const e=r[i]-n,s=this.curves[i],a=s.getLength(),o=0===a?0:1-e/a;return s.getPointAt(o,t)}i++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let n;for(let r=0,i=this.curves;r<i.length;r++){const s=i[r],a=s.isEllipseCurve?2*e:s.isLineCurve||s.isLineCurve3?1:s.isSplineCurve?e*s.points.length:e,o=s.getPoints(a);for(let e=0;e<o.length;e++){const r=o[e];n&&n.equals(r)||(t.push(r),n=r)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const n=e.curves[t];this.curves.push(n.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const n=this.curves[t];e.curves.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const n=e.curves[t];this.curves.push((new ys[n.type]).fromJSON(n))}return this}}let bs=class extends xs{constructor(e){super(),this.type="Path",this.currentPoint=new Lt,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new ms(this.currentPoint.clone(),new Lt(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,r){const i=new gs(this.currentPoint.clone(),new Lt(e,t),new Lt(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this}bezierCurveTo(e,t,n,r,i,s){const a=new ps(this.currentPoint.clone(),new Lt(e,t),new Lt(n,r),new Lt(i,s));return this.curves.push(a),this.currentPoint.set(i,s),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new _s(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,r,i,s){const a=this.currentPoint.x,o=this.currentPoint.y;return this.absarc(e+a,t+o,n,r,i,s),this}absarc(e,t,n,r,i,s){return this.absellipse(e,t,n,n,r,i,s),this}ellipse(e,t,n,r,i,s,a,o){const l=this.currentPoint.x,u=this.currentPoint.y;return this.absellipse(e+l,t+u,n,r,i,s,a,o),this}absellipse(e,t,n,r,i,s,a,o){const l=new ss(e,t,n,r,i,s,a,o);if(this.curves.length>0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const u=l.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}};class Ss extends Zr{constructor(e=1,t=32,n=0,r=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},t=Math.max(3,t);const i=[],s=[],a=[],o=[],l=new on,u=new Lt;s.push(0,0,0),a.push(0,0,1),o.push(.5,.5);for(let i=0,c=3;i<=t;i++,c+=3){const A=n+i/t*r;l.x=e*Math.cos(A),l.y=e*Math.sin(A),s.push(l.x,l.y,l.z),a.push(0,0,1),u.x=(s[c]/e+1)/2,u.y=(s[c+1]/e+1)/2,o.push(u.x,u.y)}for(let e=1;e<=t;e++)i.push(e,e+1,0);this.setIndex(i),this.setAttribute("position",new Hr(s,3)),this.setAttribute("normal",new Hr(a,3)),this.setAttribute("uv",new Hr(o,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ss(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Ts extends Zr{constructor(e=1,t=1,n=1,r=32,i=1,s=!1,a=0,o=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:s,thetaStart:a,thetaLength:o};const l=this;r=Math.floor(r),i=Math.floor(i);const u=[],c=[],A=[],h=[];let d=0;const p=[],f=n/2;let m=0;function g(n){const i=d,s=new Lt,p=new on;let g=0;const v=!0===n?e:t,_=!0===n?1:-1;for(let e=1;e<=r;e++)c.push(0,f*_,0),A.push(0,_,0),h.push(.5,.5),d++;const y=d;for(let e=0;e<=r;e++){const t=e/r*o+a,n=Math.cos(t),i=Math.sin(t);p.x=v*i,p.y=f*_,p.z=v*n,c.push(p.x,p.y,p.z),A.push(0,_,0),s.x=.5*n+.5,s.y=.5*i*_+.5,h.push(s.x,s.y),d++}for(let e=0;e<r;e++){const t=i+e,r=y+e;!0===n?u.push(r,r+1,t):u.push(r+1,r,t),g+=3}l.addGroup(m,g,!0===n?1:2),m+=g}!function(){const s=new on,g=new on;let v=0;const _=(t-e)/n;for(let l=0;l<=i;l++){const u=[],m=l/i,v=m*(t-e)+e;for(let e=0;e<=r;e++){const t=e/r,i=t*o+a,l=Math.sin(i),p=Math.cos(i);g.x=v*l,g.y=-m*n+f,g.z=v*p,c.push(g.x,g.y,g.z),s.set(l,_,p).normalize(),A.push(s.x,s.y,s.z),h.push(t,1-m),u.push(d++)}p.push(u)}for(let n=0;n<r;n++)for(let r=0;r<i;r++){const s=p[r][n],a=p[r+1][n],o=p[r+1][n+1],l=p[r][n+1];(e>0||0!==r)&&(u.push(s,a,l),v+=3),(t>0||r!==i-1)&&(u.push(a,o,l),v+=3)}l.addGroup(m,v,0),m+=v}(),!1===s&&(e>0&&g(!0),t>0&&g(!1)),this.setIndex(u),this.setAttribute("position",new Hr(c,3)),this.setAttribute("normal",new Hr(A,3)),this.setAttribute("uv",new Hr(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ts(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class ws extends bs{constructor(e){super(e),this.uuid=Mt(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const n=e.holes[t];this.holes.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const n=this.holes[t];e.holes.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const n=e.holes[t];this.holes.push((new bs).fromJSON(n))}return this}}const Ms=function(e,t,n=2){const r=t&&t.length,i=r?t[0]*n:e.length;let s=Es(e,0,i,n,!0);const a=[];if(!s||s.next===s.prev)return a;let o,l,u,c,A,h,d;if(r&&(s=function(e,t,n,r){const i=[];let s,a,o,l,u;for(s=0,a=t.length;s<a;s++)o=t[s]*r,l=s<a-1?t[s+1]*r:e.length,u=Es(e,o,l,r,!1),u===u.next&&(u.steiner=!0),i.push(Fs(u));for(i.sort(Is),s=0;s<i.length;s++)n=Us(i[s],n);return n}(e,t,s,n)),e.length>80*n){o=u=e[0],l=c=e[1];for(let t=n;t<i;t+=n)A=e[t],h=e[t+1],A<o&&(o=A),h<l&&(l=h),A>u&&(u=A),h>c&&(c=h);d=Math.max(u-o,c-l),d=0!==d?32767/d:0}return Rs(s,a,n,o,l,d,0),a};function Es(e,t,n,r,i){let s,a;if(i===function(e,t,n,r){let i=0;for(let s=t,a=n-r;s<n;s+=r)i+=(e[a]-e[s])*(e[s+1]+e[a+1]),a=s;return i}(e,t,n,r)>0)for(s=t;s<n;s+=r)a=Qs(s,e[s],e[s+1],a);else for(s=n-r;s>=t;s-=r)a=Qs(s,e[s],e[s+1],a);return a&&zs(a,a.next)&&(Ys(a),a=a.next),a}function Cs(e,t){if(!e)return e;t||(t=e);let n,r=e;do{if(n=!1,r.steiner||!zs(r,r.next)&&0!==Gs(r.prev,r,r.next))r=r.next;else{if(Ys(r),r=t=r.prev,r===r.next)break;n=!0}}while(n||r!==t);return t}function Rs(e,t,n,r,i,s,a){if(!e)return;!a&&s&&function(e,t,n,r){let i=e;do{0===i.z&&(i.z=Os(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,n,r,i,s,a,o,l,u=1;do{for(n=e,e=null,s=null,a=0;n;){for(a++,r=n,o=0,t=0;t<u&&(o++,r=r.nextZ,r);t++);for(l=u;o>0||l>0&&r;)0!==o&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,o--):(i=r,r=r.nextZ,l--),s?s.nextZ=i:e=i,i.prevZ=s,s=i;n=r}s.nextZ=null,u*=2}while(a>1)}(i)}(e,r,i,s);let o,l,u=e;for(;e.prev!==e.next;)if(o=e.prev,l=e.next,s?Ps(e,r,i,s):Ns(e))t.push(o.i/n|0),t.push(e.i/n|0),t.push(l.i/n|0),Ys(e),e=l.next,u=l.next;else if((e=l)===u){a?1===a?Rs(e=Ds(Cs(e),t,n),t,n,r,i,s,2):2===a&&Ls(e,t,n,r,i,s):Rs(Cs(e),t,n,r,i,s,1);break}}function Ns(e){const t=e.prev,n=e,r=e.next;if(Gs(t,n,r)>=0)return!1;const i=t.x,s=n.x,a=r.x,o=t.y,l=n.y,u=r.y,c=i<s?i<a?i:a:s<a?s:a,A=o<l?o<u?o:u:l<u?l:u,h=i>s?i>a?i:a:s>a?s:a,d=o>l?o>u?o:u:l>u?l:u;let p=r.next;for(;p!==t;){if(p.x>=c&&p.x<=h&&p.y>=A&&p.y<=d&&ks(i,o,s,l,a,u,p.x,p.y)&&Gs(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Ps(e,t,n,r){const i=e.prev,s=e,a=e.next;if(Gs(i,s,a)>=0)return!1;const o=i.x,l=s.x,u=a.x,c=i.y,A=s.y,h=a.y,d=o<l?o<u?o:u:l<u?l:u,p=c<A?c<h?c:h:A<h?A:h,f=o>l?o>u?o:u:l>u?l:u,m=c>A?c>h?c:h:A>h?A:h,g=Os(d,p,t,n,r),v=Os(f,m,t,n,r);let _=e.prevZ,y=e.nextZ;for(;_&&_.z>=g&&y&&y.z<=v;){if(_.x>=d&&_.x<=f&&_.y>=p&&_.y<=m&&_!==i&&_!==a&&ks(o,c,l,A,u,h,_.x,_.y)&&Gs(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,y.x>=d&&y.x<=f&&y.y>=p&&y.y<=m&&y!==i&&y!==a&&ks(o,c,l,A,u,h,y.x,y.y)&&Gs(y.prev,y,y.next)>=0)return!1;y=y.nextZ}for(;_&&_.z>=g;){if(_.x>=d&&_.x<=f&&_.y>=p&&_.y<=m&&_!==i&&_!==a&&ks(o,c,l,A,u,h,_.x,_.y)&&Gs(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;y&&y.z<=v;){if(y.x>=d&&y.x<=f&&y.y>=p&&y.y<=m&&y!==i&&y!==a&&ks(o,c,l,A,u,h,y.x,y.y)&&Gs(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function Ds(e,t,n){let r=e;do{const i=r.prev,s=r.next.next;!zs(i,s)&&Vs(i,r,r.next,s)&&Ws(i,s)&&Ws(s,i)&&(t.push(i.i/n|0),t.push(r.i/n|0),t.push(s.i/n|0),Ys(r),Ys(r.next),r=e=s),r=r.next}while(r!==e);return Cs(r)}function Ls(e,t,n,r,i,s){let a=e;do{let e=a.next.next;for(;e!==a.prev;){if(a.i!==e.i&&qs(a,e)){let o=Xs(a,e);return a=Cs(a,a.next),o=Cs(o,o.next),Rs(a,t,n,r,i,s,0),void Rs(o,t,n,r,i,s,0)}e=e.next}a=a.next}while(a!==e)}function Is(e,t){return e.x-t.x}function Us(e,t){const n=function(e,t){let n,r=t,i=-1/0;const s=e.x,a=e.y;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){const e=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(e<=s&&e>i&&(i=e,n=r.x<r.next.x?r:r.next,e===s))return n}r=r.next}while(r!==t);if(!n)return null;const o=n,l=n.x,u=n.y;let c,A=1/0;r=n;do{s>=r.x&&r.x>=l&&s!==r.x&&ks(a<u?s:i,a,l,u,a<u?i:s,a,r.x,r.y)&&(c=Math.abs(a-r.y)/(s-r.x),Ws(r,e)&&(c<A||c===A&&(r.x>n.x||r.x===n.x&&Bs(n,r)))&&(n=r,A=c)),r=r.next}while(r!==o);return n}(e,t);if(!n)return t;const r=Xs(n,e);return Cs(r,r.next),Cs(n,n.next)}function Bs(e,t){return Gs(e.prev,e,t.prev)<0&&Gs(t.next,e,e.next)<0}function Os(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Fs(e){let t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function ks(e,t,n,r,i,s,a,o){return(i-a)*(t-o)>=(e-a)*(s-o)&&(e-a)*(r-o)>=(n-a)*(t-o)&&(n-a)*(s-o)>=(i-a)*(r-o)}function qs(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Vs(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(Ws(e,t)&&Ws(t,e)&&function(e,t){let n=e,r=!1;const i=(e.x+t.x)/2,s=(e.y+t.y)/2;do{n.y>s!=n.next.y>s&&n.next.y!==n.y&&i<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(Gs(e.prev,e,t.prev)||Gs(e,t.prev,t))||zs(e,t)&&Gs(e.prev,e,e.next)>0&&Gs(t.prev,t,t.next)>0)}function Gs(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function zs(e,t){return e.x===t.x&&e.y===t.y}function Vs(e,t,n,r){const i=js(Gs(e,t,n)),s=js(Gs(e,t,r)),a=js(Gs(n,r,e)),o=js(Gs(n,r,t));return i!==s&&a!==o||(!(0!==i||!Hs(e,n,t))||(!(0!==s||!Hs(e,r,t))||(!(0!==a||!Hs(n,e,r))||!(0!==o||!Hs(n,t,r)))))}function Hs(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function js(e){return e>0?1:e<0?-1:0}function Ws(e,t){return Gs(e.prev,e,e.next)<0?Gs(e,t,e.next)>=0&&Gs(e,e.prev,t)>=0:Gs(e,t,e.prev)<0||Gs(e,e.next,t)<0}function Xs(e,t){const n=new $s(e.i,e.x,e.y),r=new $s(t.i,t.x,t.y),i=e.next,s=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,s.next=r,r.prev=s,r}function Qs(e,t,n,r){const i=new $s(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Ys(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function $s(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class Ks{static area(e){const t=e.length;let n=0;for(let r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return.5*n}static isClockWise(e){return Ks.area(e)<0}static triangulateShape(e,t){const n=[],r=[],i=[];Zs(e),Js(n,e);let s=e.length;t.forEach(Zs);for(let e=0;e<t.length;e++)r.push(s),s+=t[e].length,Js(n,t[e]);const a=Ms(n,r);for(let e=0;e<a.length;e+=3)i.push(a.slice(e,e+3));return i}}function Zs(e){const t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function Js(e,t){for(let n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}class ea extends Zr{constructor(e=new ws([new Lt(.5,.5),new Lt(-.5,.5),new Lt(-.5,-.5),new Lt(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,r=[],i=[];for(let t=0,n=e.length;t<n;t++){s(e[t])}function s(e){const s=[],a=void 0!==t.curveSegments?t.curveSegments:12,o=void 0!==t.steps?t.steps:1,l=void 0!==t.depth?t.depth:1;let u=void 0===t.bevelEnabled||t.bevelEnabled,c=void 0!==t.bevelThickness?t.bevelThickness:.2,A=void 0!==t.bevelSize?t.bevelSize:c-.1,h=void 0!==t.bevelOffset?t.bevelOffset:0,d=void 0!==t.bevelSegments?t.bevelSegments:3;const p=t.extrudePath,f=void 0!==t.UVGenerator?t.UVGenerator:ta;let m,g,v,_,y,x=!1;p&&(m=p.getSpacedPoints(o),x=!0,u=!1,g=p.computeFrenetFrames(o,!1),v=new on,_=new on,y=new on),u||(d=0,c=0,A=0,h=0);const b=e.extractPoints(a);let S=b.shape;const T=b.holes;if(!Ks.isClockWise(S)){S=S.reverse();for(let e=0,t=T.length;e<t;e++){const t=T[e];Ks.isClockWise(t)&&(T[e]=t.reverse())}}const w=Ks.triangulateShape(S,T),M=S;for(let e=0,t=T.length;e<t;e++){const t=T[e];S=S.concat(t)}function E(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().addScaledVector(t,n)}const C=S.length,R=w.length;function N(e,t,n){let r,i,s;const a=e.x-t.x,o=e.y-t.y,l=n.x-e.x,u=n.y-e.y,c=a*a+o*o,A=a*u-o*l;if(Math.abs(A)>Number.EPSILON){const A=Math.sqrt(c),h=Math.sqrt(l*l+u*u),d=t.x-o/A,p=t.y+a/A,f=((n.x-u/h-d)*u-(n.y+l/h-p)*l)/(a*u-o*l);r=d+a*f-e.x,i=p+o*f-e.y;const m=r*r+i*i;if(m<=2)return new Lt(r,i);s=Math.sqrt(m/2)}else{let e=!1;a>Number.EPSILON?l>Number.EPSILON&&(e=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(o)===Math.sign(u)&&(e=!0),e?(r=-o,i=a,s=Math.sqrt(c)):(r=a,i=o,s=Math.sqrt(c/2))}return new Lt(r/s,i/s)}const P=[];for(let e=0,t=M.length,n=t-1,r=e+1;e<t;e++,n++,r++)n===t&&(n=0),r===t&&(r=0),P[e]=N(M[e],M[n],M[r]);const D=[];let L,I=P.concat();for(let e=0,t=T.length;e<t;e++){const t=T[e];L=[];for(let e=0,n=t.length,r=n-1,i=e+1;e<n;e++,r++,i++)r===n&&(r=0),i===n&&(i=0),L[e]=N(t[e],t[r],t[i]);D.push(L),I=I.concat(L)}for(let e=0;e<d;e++){const t=e/d,n=c*Math.cos(t*Math.PI/2),r=A*Math.sin(t*Math.PI/2)+h;for(let e=0,t=M.length;e<t;e++){const t=E(M[e],P[e],r);O(t.x,t.y,-n)}for(let e=0,t=T.length;e<t;e++){const t=T[e];L=D[e];for(let e=0,i=t.length;e<i;e++){const i=E(t[e],L[e],r);O(i.x,i.y,-n)}}}const U=A+h;for(let e=0;e<C;e++){const t=u?E(S[e],I[e],U):S[e];x?(_.copy(g.normals[0]).multiplyScalar(t.x),v.copy(g.binormals[0]).multiplyScalar(t.y),y.copy(m[0]).add(_).add(v),O(y.x,y.y,y.z)):O(t.x,t.y,0)}for(let e=1;e<=o;e++)for(let t=0;t<C;t++){const n=u?E(S[t],I[t],U):S[t];x?(_.copy(g.normals[e]).multiplyScalar(n.x),v.copy(g.binormals[e]).multiplyScalar(n.y),y.copy(m[e]).add(_).add(v),O(y.x,y.y,y.z)):O(n.x,n.y,l/o*e)}for(let e=d-1;e>=0;e--){const t=e/d,n=c*Math.cos(t*Math.PI/2),r=A*Math.sin(t*Math.PI/2)+h;for(let e=0,t=M.length;e<t;e++){const t=E(M[e],P[e],r);O(t.x,t.y,l+n)}for(let e=0,t=T.length;e<t;e++){const t=T[e];L=D[e];for(let e=0,i=t.length;e<i;e++){const i=E(t[e],L[e],r);x?O(i.x,i.y+m[o-1].y,m[o-1].x+n):O(i.x,i.y,l+n)}}}function B(e,t){let n=e.length;for(;--n>=0;){const r=n;let i=n-1;i<0&&(i=e.length-1);for(let e=0,n=o+2*d;e<n;e++){const n=C*e,s=C*(e+1);k(t+r+n,t+i+n,t+i+s,t+r+s)}}}function O(e,t,n){s.push(e),s.push(t),s.push(n)}function F(e,t,i){q(e),q(t),q(i);const s=r.length/3,a=f.generateTopUV(n,r,s-3,s-2,s-1);G(a[0]),G(a[1]),G(a[2])}function k(e,t,i,s){q(e),q(t),q(s),q(t),q(i),q(s);const a=r.length/3,o=f.generateSideWallUV(n,r,a-6,a-3,a-2,a-1);G(o[0]),G(o[1]),G(o[3]),G(o[1]),G(o[2]),G(o[3])}function q(e){r.push(s[3*e+0]),r.push(s[3*e+1]),r.push(s[3*e+2])}function G(e){i.push(e.x),i.push(e.y)}!function(){const e=r.length/3;if(u){let e=0,t=C*e;for(let e=0;e<R;e++){const n=w[e];F(n[2]+t,n[1]+t,n[0]+t)}e=o+2*d,t=C*e;for(let e=0;e<R;e++){const n=w[e];F(n[0]+t,n[1]+t,n[2]+t)}}else{for(let e=0;e<R;e++){const t=w[e];F(t[2],t[1],t[0])}for(let e=0;e<R;e++){const t=w[e];F(t[0]+C*o,t[1]+C*o,t[2]+C*o)}}n.addGroup(e,r.length/3-e,0)}(),function(){const e=r.length/3;let t=0;B(M,t),t+=M.length;for(let e=0,n=T.length;e<n;e++){const n=T[e];B(n,t),t+=n.length}n.addGroup(e,r.length/3-e,1)}()}this.setAttribute("position",new Hr(r,3)),this.setAttribute("uv",new Hr(i,2)),this.computeVertexNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return function(e,t,n){if(n.shapes=[],Array.isArray(e))for(let t=0,r=e.length;t<r;t++){const r=e[t];n.shapes.push(r.uuid)}else n.shapes.push(e.uuid);n.options=Object.assign({},t),void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON());return n}(this.parameters.shapes,this.parameters.options,e)}static fromJSON(e,t){const n=[];for(let r=0,i=e.shapes.length;r<i;r++){const i=t[e.shapes[r]];n.push(i)}const r=e.options.extrudePath;return void 0!==r&&(e.options.extrudePath=(new ys[r.type]).fromJSON(r)),new ea(n,e.options)}}const ta={generateTopUV:function(e,t,n,r,i){const s=t[3*n],a=t[3*n+1],o=t[3*r],l=t[3*r+1],u=t[3*i],c=t[3*i+1];return[new Lt(s,a),new Lt(o,l),new Lt(u,c)]},generateSideWallUV:function(e,t,n,r,i,s){const a=t[3*n],o=t[3*n+1],l=t[3*n+2],u=t[3*r],c=t[3*r+1],A=t[3*r+2],h=t[3*i],d=t[3*i+1],p=t[3*i+2],f=t[3*s],m=t[3*s+1],g=t[3*s+2];return Math.abs(o-c)<Math.abs(a-u)?[new Lt(a,1-l),new Lt(u,1-A),new Lt(h,1-p),new Lt(f,1-g)]:[new Lt(o,1-l),new Lt(c,1-A),new Lt(d,1-p),new Lt(m,1-g)]}};class na extends Zr{constructor(e=1,t=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};const i=e/2,s=t/2,a=Math.floor(n),o=Math.floor(r),l=a+1,u=o+1,c=e/a,A=t/o,h=[],d=[],p=[],f=[];for(let e=0;e<u;e++){const t=e*A-s;for(let n=0;n<l;n++){const r=n*c-i;d.push(r,-t,0),p.push(0,0,1),f.push(n/a),f.push(1-e/o)}}for(let e=0;e<o;e++)for(let t=0;t<a;t++){const n=t+l*e,r=t+l*(e+1),i=t+1+l*(e+1),s=t+1+l*e;h.push(n,r,s),h.push(r,i,s)}this.setIndex(h),this.setAttribute("position",new Hr(d,3)),this.setAttribute("normal",new Hr(p,3)),this.setAttribute("uv",new Hr(f,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new na(e.width,e.height,e.widthSegments,e.heightSegments)}}class ra extends Zr{constructor(e=1,t=32,n=16,r=0,i=2*Math.PI,s=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:s,thetaLength:a},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const o=Math.min(s+a,Math.PI);let l=0;const u=[],c=new on,A=new on,h=[],d=[],p=[],f=[];for(let h=0;h<=n;h++){const m=[],g=h/n;let v=0;0===h&&0===s?v=.5/t:h===n&&o===Math.PI&&(v=-.5/t);for(let n=0;n<=t;n++){const o=n/t;c.x=-e*Math.cos(r+o*i)*Math.sin(s+g*a),c.y=e*Math.cos(s+g*a),c.z=e*Math.sin(r+o*i)*Math.sin(s+g*a),d.push(c.x,c.y,c.z),A.copy(c).normalize(),p.push(A.x,A.y,A.z),f.push(o+v,1-g),m.push(l++)}u.push(m)}for(let e=0;e<n;e++)for(let r=0;r<t;r++){const t=u[e][r+1],i=u[e][r],a=u[e+1][r],l=u[e+1][r+1];(0!==e||s>0)&&h.push(t,i,l),(e!==n-1||o<Math.PI)&&h.push(i,a,l)}this.setIndex(h),this.setAttribute("position",new Hr(d,3)),this.setAttribute("normal",new Hr(p,3)),this.setAttribute("uv",new Hr(f,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ra(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class ia extends Zr{constructor(e=new vs(new on(-1,-1,0),new on(-1,1,0),new on(1,1,0)),t=64,n=1,r=8,i=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i};const s=e.computeFrenetFrames(t,i);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;const a=new on,o=new on,l=new Lt;let u=new on;const c=[],A=[],h=[],d=[];function p(i){u=e.getPointAt(i/t,u);const l=s.normals[i],h=s.binormals[i];for(let e=0;e<=r;e++){const t=e/r*Math.PI*2,i=Math.sin(t),s=-Math.cos(t);o.x=s*l.x+i*h.x,o.y=s*l.y+i*h.y,o.z=s*l.z+i*h.z,o.normalize(),A.push(o.x,o.y,o.z),a.x=u.x+n*o.x,a.y=u.y+n*o.y,a.z=u.z+n*o.z,c.push(a.x,a.y,a.z)}}!function(){for(let e=0;e<t;e++)p(e);p(!1===i?t:0),function(){for(let e=0;e<=t;e++)for(let n=0;n<=r;n++)l.x=e/t,l.y=n/r,h.push(l.x,l.y)}(),function(){for(let e=1;e<=t;e++)for(let t=1;t<=r;t++){const n=(r+1)*(e-1)+(t-1),i=(r+1)*e+(t-1),s=(r+1)*e+t,a=(r+1)*(e-1)+t;d.push(n,i,a),d.push(i,s,a)}}()}(),this.setIndex(d),this.setAttribute("position",new Hr(c,3)),this.setAttribute("normal",new Hr(A,3)),this.setAttribute("uv",new Hr(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new ia((new ys[e.path.type]).fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class sa extends Zr{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},null!==e){const t=[],n=new Set,r=new on,i=new on;if(null!==e.index){const s=e.attributes.position,a=e.index;let o=e.groups;0===o.length&&(o=[{start:0,count:a.count,materialIndex:0}]);for(let e=0,l=o.length;e<l;++e){const l=o[e],u=l.start;for(let e=u,o=u+l.count;e<o;e+=3)for(let o=0;o<3;o++){const l=a.getX(e+o),u=a.getX(e+(o+1)%3);r.fromBufferAttribute(s,l),i.fromBufferAttribute(s,u),!0===aa(r,i,n)&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}}else{const s=e.attributes.position;for(let e=0,a=s.count/3;e<a;e++)for(let a=0;a<3;a++){const o=3*e+a,l=3*e+(a+1)%3;r.fromBufferAttribute(s,o),i.fromBufferAttribute(s,l),!0===aa(r,i,n)&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}this.setAttribute("position",new Hr(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function aa(e,t,n){const r=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`,i=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`;return!0!==n.has(r)&&!0!==n.has(i)&&(n.add(r),n.add(i),!0)}class oa extends Dr{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Rr(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class la extends Dr{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new Rr(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Rr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Lt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Xn,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class ua extends la{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Lt(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Et(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Rr(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Rr(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Rr(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class ca extends Dr{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Rr(16777215),this.specular=new Rr(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Rr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Lt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Xn,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Aa extends Dr{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Rr(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Rr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Lt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class ha extends Dr{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Lt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class da extends Dr{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Rr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Rr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Lt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Xn,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class pa extends Dr{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class fa extends Dr{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class ma extends Dr{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Rr(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Lt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class ga extends Gi{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}const va={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};class _a{constructor(e,t,n){const r=this;let i,s=!1,a=0,o=0;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++,!1===s&&void 0!==r.onStart&&r.onStart(e,a,o),s=!0},this.itemEnd=function(e){a++,void 0!==r.onProgress&&r.onProgress(e,a,o),a===o&&(s=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return i?i(e):e},this.setURLModifier=function(e){return i=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){const t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,n=l.length;t<n;t+=2){const n=l[t],r=l[t+1];if(n.global&&(n.lastIndex=0),n.test(e))return r}return null}}}const ya=new _a;class xa{constructor(e){this.manager=void 0!==e?e:ya,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise((function(r,i){n.load(e,r,t,i)}))}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}xa.DEFAULT_MATERIAL_NAME="__DEFAULT";class ba extends xa{constructor(e){super(e)}load(e,t,n,r){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,s=va.get(e);if(void 0!==s)return i.manager.itemStart(e),setTimeout((function(){t&&t(s),i.manager.itemEnd(e)}),0),s;const a=Ot("img");function o(){u(),va.add(e,this),t&&t(this),i.manager.itemEnd(e)}function l(t){u(),r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}function u(){a.removeEventListener("load",o,!1),a.removeEventListener("error",l,!1)}return a.addEventListener("load",o,!1),a.addEventListener("error",l,!1),"data:"!==e.slice(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),i.manager.itemStart(e),a.src=e,a}}class Sa extends xa{constructor(e){super(e)}load(e,t,n,r){const i=new Jt,s=new ba(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(e,(function(e){i.image=e,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i}}class Ta extends cr{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Rr(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),void 0!==this.target&&(t.object.target=this.target.uuid),t}}class wa extends Ta{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(cr.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Rr(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const Ma=new On,Ea=new on,Ca=new on;class Ra{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Lt(512,512),this.map=null,this.mapPass=null,this.matrix=new On,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new qi,this._frameExtents=new Lt(1,1),this._viewportCount=1,this._viewports=[new en(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;Ea.setFromMatrixPosition(e.matrixWorld),t.position.copy(Ea),Ca.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Ca),t.updateMatrixWorld(),Ma.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Ma),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(Ma)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const e={};return 1!==this.intensity&&(e.intensity=this.intensity),0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class Na extends Ra{constructor(){super(new bi(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=2*wt*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;n===t.fov&&r===t.aspect&&i===t.far||(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class Pa extends Ta{constructor(e,t,n=0,r=Math.PI/3,i=0,s=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(cr.DEFAULT_UP),this.updateMatrix(),this.target=new cr,this.distance=n,this.angle=r,this.penumbra=i,this.decay=s,this.map=null,this.shadow=new Na}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const Da=new On,La=new on,Ia=new on;class Ua extends Ra{constructor(){super(new bi(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Lt(4,2),this._viewportCount=6,this._viewports=[new en(2,1,1,1),new en(0,1,1,1),new en(3,1,1,1),new en(1,1,1,1),new en(3,0,1,1),new en(1,0,1,1)],this._cubeDirections=[new on(1,0,0),new on(-1,0,0),new on(0,0,1),new on(0,0,-1),new on(0,1,0),new on(0,-1,0)],this._cubeUps=[new on(0,1,0),new on(0,1,0),new on(0,1,0),new on(0,1,0),new on(0,0,1),new on(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,r=this.matrix,i=e.distance||n.far;i!==n.far&&(n.far=i,n.updateProjectionMatrix()),La.setFromMatrixPosition(e.matrixWorld),n.position.copy(La),Ia.copy(n.position),Ia.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(Ia),n.updateMatrixWorld(),r.makeTranslation(-La.x,-La.y,-La.z),Da.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Da)}}class Ba extends Ta{constructor(e,t,n=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=r,this.shadow=new Ua}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class Oa extends vi{constructor(e=-1,t=1,n=1,r=-1,i=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=i,this.far=s,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,i,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let i=n-e,s=n+e,a=r+t,o=r-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=e*this.view.offsetX,s=i+e*this.view.width,a-=t*this.view.offsetY,o=a-t*this.view.height}this.projectionMatrix.makeOrthographic(i,s,a,o,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}class Fa extends Ra{constructor(){super(new Oa(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class ka extends Ta{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(cr.DEFAULT_UP),this.updateMatrix(),this.target=new cr,this.shadow=new Fa}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class qa extends Ta{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class Ga extends Ta{constructor(e,t,n=10,r=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}class za{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new on)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const n=e.x,r=e.y,i=e.z,s=this.coefficients;return t.copy(s[0]).multiplyScalar(.282095),t.addScaledVector(s[1],.488603*r),t.addScaledVector(s[2],.488603*i),t.addScaledVector(s[3],.488603*n),t.addScaledVector(s[4],n*r*1.092548),t.addScaledVector(s[5],r*i*1.092548),t.addScaledVector(s[6],.315392*(3*i*i-1)),t.addScaledVector(s[7],n*i*1.092548),t.addScaledVector(s[8],.546274*(n*n-r*r)),t}getIrradianceAt(e,t){const n=e.x,r=e.y,i=e.z,s=this.coefficients;return t.copy(s[0]).multiplyScalar(.886227),t.addScaledVector(s[1],1.023328*r),t.addScaledVector(s[2],1.023328*i),t.addScaledVector(s[3],1.023328*n),t.addScaledVector(s[4],.858086*n*r),t.addScaledVector(s[5],.858086*r*i),t.addScaledVector(s[6],.743125*i*i-.247708),t.addScaledVector(s[7],.858086*n*i),t.addScaledVector(s[8],.429043*(n*n-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(e,t=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this}toArray(e=[],t=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].toArray(e,t+3*r);return e}static getBasisAt(e,t){const n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}}class Va extends Ta{constructor(e=new za,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class Ha extends Zr{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class ja extends bi{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Wa{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Xa(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=Xa();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Xa(){return performance.now()}class Qa extends Ci{constructor(e,t,n=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}const Ya=new On;function $a(e,t){return e.distance-t.distance}function Ka(e,t,n,r){let i=!0;if(e.layers.test(t.layers)){!1===e.raycast(t,n)&&(i=!1)}if(!0===i&&!0===r){const r=e.children;for(let e=0,i=r.length;e<i;e++)Ka(r[e],t,n,!0)}}class Za{constructor(e=1,t=0,n=0){return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){const e=1e-6;return this.phi=Et(this.phi,e,Math.PI-e),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Et(t/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}const Ja=new on,eo=new on;class to{constructor(){this.type="ShapePath",this.color=new Rr,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new bs,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this}bezierCurveTo(e,t,n,r,i,s){return this.currentPath.bezierCurveTo(e,t,n,r,i,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(e,t){const n=t.length;let r=!1;for(let i=n-1,s=0;s<n;i=s++){let n=t[i],a=t[s],o=a.x-n.x,l=a.y-n.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(n=t[s],o=-o,a=t[i],l=-l),e.y<n.y||e.y>a.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{const t=l*(e.x-n.x)-o*(e.y-n.y);if(0===t)return!0;if(t<0)continue;r=!r}}else{if(e.y!==n.y)continue;if(a.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=a.x)return!0}}return r}const n=Ks.isClockWise,r=this.subPaths;if(0===r.length)return[];let i,s,a;const o=[];if(1===r.length)return s=r[0],a=new ws,a.curves=s.curves,o.push(a),o;let l=!n(r[0].getPoints());l=e?!l:l;const u=[],c=[];let A,h,d=[],p=0;c[p]=void 0,d[p]=[];for(let t=0,a=r.length;t<a;t++)s=r[t],A=s.getPoints(),i=n(A),i=e?!i:i,i?(!l&&c[p]&&p++,c[p]={s:new ws,p:A},c[p].s.curves=s.curves,l&&p++,d[p]=[]):d[p].push({h:s,p:A[0]});if(!c[0])return function(e){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n],i=new ws;i.curves=r.curves,t.push(i)}return t}(r);if(c.length>1){let e=!1,n=0;for(let e=0,t=c.length;e<t;e++)u[e]=[];for(let r=0,i=c.length;r<i;r++){const i=d[r];for(let s=0;s<i.length;s++){const a=i[s];let o=!0;for(let i=0;i<c.length;i++)t(a.p,c[i].p)&&(r!==i&&n++,o?(o=!1,u[i].push(a)):e=!0);o&&u[r].push(a)}}n>0&&!1===e&&(d=u)}for(let e=0,t=c.length;e<t;e++){a=c[e].s,o.push(a),h=d[e];for(let e=0,t=h.length;e<t;e++)a.holes.push(h[e].h)}return o}}class no extends xt{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(){}disconnect(){}dispose(){}update(){}}function ro(e,t,n,r){const i=function(e){switch(e){case ee:case te:return{byteLength:1,components:1};case re:case ne:case oe:return{byteLength:2,components:1};case le:case ue:return{byteLength:2,components:4};case se:case ie:case ae:return{byteLength:4,components:1};case Ae:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${e}.`)}(r);switch(n){case he:case fe:return e*t;case me:return e*t*2;case _e:case ye:return e*t/i.components*i.byteLength;case xe:case be:return e*t*2/i.components*i.byteLength;case de:return e*t*3/i.components*i.byteLength;case pe:case Se:return e*t*4/i.components*i.byteLength;case Te:case we:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case Me:case Ee:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case Re:case Pe:return Math.max(e,16)*Math.max(t,8)/4;case Ce:case Ne:return Math.max(e,8)*Math.max(t,8)/2;case De:case Le:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case Ie:case Ue:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case Be:return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16;case Oe:return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16;case Fe:return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16;case ke:return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16;case qe:return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16;case Ge:return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16;case ze:return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16;case Ve:return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16;case He:return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16;case je:return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16;case We:return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16;case Xe:return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16;case Qe:return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16;case Ye:case $e:case Ke:return Math.ceil(e/4)*Math.ceil(t/4)*16;case Ze:case Je:return Math.ceil(e/4)*Math.ceil(t/4)*8;case et:case tt:return Math.ceil(e/4)*Math.ceil(t/4)*16}throw new Error(`Unable to determine texture byte length for ${n} format.`)}function io(){let e=null,t=!1,n=null,r=null;function i(t,s){n(t,s),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function so(e){const t=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);const r=t.get(n);r&&(e.deleteBuffer(r.buffer),t.delete(n))},update:function(n,r){if(n.isInterleavedBufferAttribute&&(n=n.data),n.isGLBufferAttribute){const e=t.get(n);return void((!e||e.version<n.version)&&t.set(n,{buffer:n.buffer,type:n.type,bytesPerElement:n.elementSize,version:n.version}))}const i=t.get(n);if(void 0===i)t.set(n,function(t,n){const r=t.array,i=t.usage,s=r.byteLength,a=e.createBuffer();let o;if(e.bindBuffer(n,a),e.bufferData(n,r,i),t.onUploadCallback(),r instanceof Float32Array)o=e.FLOAT;else if(r instanceof Uint16Array)o=t.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(r instanceof Int16Array)o=e.SHORT;else if(r instanceof Uint32Array)o=e.UNSIGNED_INT;else if(r instanceof Int32Array)o=e.INT;else if(r instanceof Int8Array)o=e.BYTE;else if(r instanceof Uint8Array)o=e.UNSIGNED_BYTE;else{if(!(r instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+r);o=e.UNSIGNED_BYTE}return{buffer:a,type:o,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version,size:s}}(n,r));else if(i.version<n.version){if(i.size!==n.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");!function(t,n,r){const i=n.array,s=n.updateRanges;if(e.bindBuffer(r,t),0===s.length)e.bufferSubData(r,0,i);else{s.sort(((e,t)=>e.start-t.start));let t=0;for(let e=1;e<s.length;e++){const n=s[t],r=s[e];r.start<=n.start+n.count+1?n.count=Math.max(n.count,r.start+r.count-n.start):(++t,s[t]=r)}s.length=t+1;for(let t=0,n=s.length;t<n;t++){const n=s[t];e.bufferSubData(r,n.start*i.BYTES_PER_ELEMENT,i,n.start,n.count)}n.clearUpdateRanges()}n.onUploadCallback()}(i.buffer,n,r),i.version=n.version}}}}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:s}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=s);const ao={alphahash_fragment:"#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n\t#if ! defined( GL_ANGLE_multi_draw )\n\t#define gl_DrawID _gl_DrawID\n\tuniform int _gl_DrawID;\n\t#endif\n\tuniform highp sampler2D batchingTexture;\n\tuniform highp usampler2D batchingIdTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n\tfloat getIndirectIndex( const in int i ) {\n\t\tint size = textureSize( batchingIdTexture, 0 ).x;\n\t\tint x = i % size;\n\t\tint y = i / size;\n\t\treturn float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n\t}\n#endif\n#ifdef USE_BATCHING_COLOR\n\tuniform sampler2D batchingColorTexture;\n\tvec3 getBatchingColor( const in float i ) {\n\t\tint size = textureSize( batchingColorTexture, 0 ).x;\n\t\tint j = int( i );\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\treturn texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n\t}\n#endif",batching_vertex:"#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n\tvec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n\tvColor.xyz *= batchingColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\n\t\temissiveColor = sRGBTransferEOTF( emissiveColor );\n\t#endif\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"vec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferEOTF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif ( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n\tmaterial.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\tfloat dispersion;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t#endif\n\tuniform sampler2DArray morphTargetsTexture;\n\tuniform ivec2 morphTargetsTextureSize;\n\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t}\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec4( 0., 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec4( 1., 1., 1., 1. );\n\tfloat vuf;\n\tfloat af = modf( v * PackFactors.a, vuf );\n\tfloat bf = modf( vuf * ShiftRight8, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec3( 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec3( 1., 1., 1. );\n\tfloat vuf;\n\tfloat bf = modf( v * PackFactors.b, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec2( 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec2( 1., 1. );\n\tfloat vuf;\n\tfloat gf = modf( v * 256., vuf );\n\treturn vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n\treturn dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n\treturn v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tconst float StartCompression = 0.8 - 0.04;\n\tconst float Desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min( color.r, min( color.g, color.b ) );\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max( color.r, max( color.g, color.b ) );\n\tif ( peak < StartCompression ) return color;\n\tfloat d = 1. - StartCompression;\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n\treturn mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec4 transmittedLight;\n\t\tvec3 transmittance;\n\t\t#ifdef USE_DISPERSION\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\t\t\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n\t\t\t}\n\t\t\ttransmittedLight.a /= 3.0;\n\t\t\n\t\t#else\n\t\t\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\trefractionCoords += 1.0;\n\t\t\trefractionCoords /= 2.0;\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\t\n\t\t#endif\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",depth_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#elif DEPTH_PACKING == 3202\n\t\tgl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n\t#elif DEPTH_PACKING == 3203\n\t\tgl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n\tuniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix[ 3 ];\n\tvec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}"},oo={common:{diffuse:{value:new Rr(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new It},alphaMap:{value:null},alphaMapTransform:{value:new It},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new It}},envmap:{envMap:{value:null},envMapRotation:{value:new It},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new It}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new It}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new It},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new It},normalScale:{value:new Lt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new It},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new It}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new It}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new It}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Rr(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Rr(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new It},alphaTest:{value:0},uvTransform:{value:new It}},sprite:{diffuse:{value:new Rr(16777215)},opacity:{value:1},center:{value:new Lt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new It},alphaMap:{value:null},alphaMapTransform:{value:new It},alphaTest:{value:0}}},lo={basic:{uniforms:pi([oo.common,oo.specularmap,oo.envmap,oo.aomap,oo.lightmap,oo.fog]),vertexShader:ao.meshbasic_vert,fragmentShader:ao.meshbasic_frag},lambert:{uniforms:pi([oo.common,oo.specularmap,oo.envmap,oo.aomap,oo.lightmap,oo.emissivemap,oo.bumpmap,oo.normalmap,oo.displacementmap,oo.fog,oo.lights,{emissive:{value:new Rr(0)}}]),vertexShader:ao.meshlambert_vert,fragmentShader:ao.meshlambert_frag},phong:{uniforms:pi([oo.common,oo.specularmap,oo.envmap,oo.aomap,oo.lightmap,oo.emissivemap,oo.bumpmap,oo.normalmap,oo.displacementmap,oo.fog,oo.lights,{emissive:{value:new Rr(0)},specular:{value:new Rr(1118481)},shininess:{value:30}}]),vertexShader:ao.meshphong_vert,fragmentShader:ao.meshphong_frag},standard:{uniforms:pi([oo.common,oo.envmap,oo.aomap,oo.lightmap,oo.emissivemap,oo.bumpmap,oo.normalmap,oo.displacementmap,oo.roughnessmap,oo.metalnessmap,oo.fog,oo.lights,{emissive:{value:new Rr(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ao.meshphysical_vert,fragmentShader:ao.meshphysical_frag},toon:{uniforms:pi([oo.common,oo.aomap,oo.lightmap,oo.emissivemap,oo.bumpmap,oo.normalmap,oo.displacementmap,oo.gradientmap,oo.fog,oo.lights,{emissive:{value:new Rr(0)}}]),vertexShader:ao.meshtoon_vert,fragmentShader:ao.meshtoon_frag},matcap:{uniforms:pi([oo.common,oo.bumpmap,oo.normalmap,oo.displacementmap,oo.fog,{matcap:{value:null}}]),vertexShader:ao.meshmatcap_vert,fragmentShader:ao.meshmatcap_frag},points:{uniforms:pi([oo.points,oo.fog]),vertexShader:ao.points_vert,fragmentShader:ao.points_frag},dashed:{uniforms:pi([oo.common,oo.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ao.linedashed_vert,fragmentShader:ao.linedashed_frag},depth:{uniforms:pi([oo.common,oo.displacementmap]),vertexShader:ao.depth_vert,fragmentShader:ao.depth_frag},normal:{uniforms:pi([oo.common,oo.bumpmap,oo.normalmap,oo.displacementmap,{opacity:{value:1}}]),vertexShader:ao.meshnormal_vert,fragmentShader:ao.meshnormal_frag},sprite:{uniforms:pi([oo.sprite,oo.fog]),vertexShader:ao.sprite_vert,fragmentShader:ao.sprite_frag},background:{uniforms:{uvTransform:{value:new It},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ao.background_vert,fragmentShader:ao.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new It}},vertexShader:ao.backgroundCube_vert,fragmentShader:ao.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ao.cube_vert,fragmentShader:ao.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ao.equirect_vert,fragmentShader:ao.equirect_frag},distanceRGBA:{uniforms:pi([oo.common,oo.displacementmap,{referencePosition:{value:new on},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ao.distanceRGBA_vert,fragmentShader:ao.distanceRGBA_frag},shadow:{uniforms:pi([oo.lights,oo.fog,{color:{value:new Rr(0)},opacity:{value:1}}]),vertexShader:ao.shadow_vert,fragmentShader:ao.shadow_frag}};lo.physical={uniforms:pi([lo.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new It},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new It},clearcoatNormalScale:{value:new Lt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new It},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new It},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new It},sheen:{value:0},sheenColor:{value:new Rr(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new It},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new It},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new It},transmissionSamplerSize:{value:new Lt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new It},attenuationDistance:{value:0},attenuationColor:{value:new Rr(0)},specularColor:{value:new Rr(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new It},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new It},anisotropyVector:{value:new Lt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new It}}]),vertexShader:ao.meshphysical_vert,fragmentShader:ao.meshphysical_frag};const uo={r:0,b:0,g:0},co=new Xn,Ao=new On;function ho(e,t,n,r,i,s,a){const o=new Rr(0);let l,u,c=!0===s?0:1,A=null,h=0,d=null;function p(e){let r=!0===e.isScene?e.background:null;if(r&&r.isTexture){r=(e.backgroundBlurriness>0?n:t).get(r)}return r}function f(t,n){t.getRGB(uo,fi(e)),r.buffers.color.setClear(uo.r,uo.g,uo.b,n,a)}return{getClearColor:function(){return o},setClearColor:function(e,t=1){o.set(e),c=t,f(o,c)},getClearAlpha:function(){return c},setClearAlpha:function(e){c=e,f(o,c)},render:function(t){let n=!1;const i=p(t);null===i?f(o,c):i&&i.isColor&&(f(i,1),n=!0);const s=e.xr.getEnvironmentBlendMode();"additive"===s?r.buffers.color.setClear(0,0,0,1,a):"alpha-blend"===s&&r.buffers.color.setClear(0,0,0,0,a),(e.autoClear||n)&&(r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))},addToRenderList:function(t,n){const r=p(n);r&&(r.isCubeTexture||r.mapping===H)?(void 0===u&&(u=new ci(new hi(1,1,1),new gi({name:"BackgroundCubeMaterial",uniforms:di(lo.backgroundCube.uniforms),vertexShader:lo.backgroundCube.vertexShader,fragmentShader:lo.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),co.copy(n.backgroundRotation),co.x*=-1,co.y*=-1,co.z*=-1,r.isCubeTexture&&!1===r.isRenderTargetTexture&&(co.y*=-1,co.z*=-1),u.material.uniforms.envMap.value=r,u.material.uniforms.flipEnvMap.value=r.isCubeTexture&&!1===r.isRenderTargetTexture?-1:1,u.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(Ao.makeRotationFromEuler(co)),u.material.toneMapped=Ht.getTransfer(r.colorSpace)!==at,A===r&&h===r.version&&d===e.toneMapping||(u.material.needsUpdate=!0,A=r,h=r.version,d=e.toneMapping),u.layers.enableAll(),t.unshift(u,u.geometry,u.material,0,0,null)):r&&r.isTexture&&(void 0===l&&(l=new ci(new na(2,2),new gi({name:"BackgroundMaterial",uniforms:di(lo.background.uniforms),vertexShader:lo.background.vertexShader,fragmentShader:lo.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=r,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.toneMapped=Ht.getTransfer(r.colorSpace)!==at,!0===r.matrixAutoUpdate&&r.updateMatrix(),l.material.uniforms.uvTransform.value.copy(r.matrix),A===r&&h===r.version&&d===e.toneMapping||(l.material.needsUpdate=!0,A=r,h=r.version,d=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null))},dispose:function(){void 0!==u&&(u.geometry.dispose(),u.material.dispose()),void 0!==l&&(l.geometry.dispose(),l.material.dispose())}}}function po(e,t){const n=e.getParameter(e.MAX_VERTEX_ATTRIBS),r={},i=u(null);let s=i,a=!1;function o(t){return e.bindVertexArray(t)}function l(t){return e.deleteVertexArray(t)}function u(e){const t=[],r=[],i=[];for(let e=0;e<n;e++)t[e]=0,r[e]=0,i[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:r,attributeDivisors:i,object:e,attributes:{},index:null}}function c(){const e=s.newAttributes;for(let t=0,n=e.length;t<n;t++)e[t]=0}function A(e){h(e,0)}function h(t,n){const r=s.newAttributes,i=s.enabledAttributes,a=s.attributeDivisors;r[t]=1,0===i[t]&&(e.enableVertexAttribArray(t),i[t]=1),a[t]!==n&&(e.vertexAttribDivisor(t,n),a[t]=n)}function d(){const t=s.newAttributes,n=s.enabledAttributes;for(let r=0,i=n.length;r<i;r++)n[r]!==t[r]&&(e.disableVertexAttribArray(r),n[r]=0)}function p(t,n,r,i,s,a,o){!0===o?e.vertexAttribIPointer(t,n,r,s,a):e.vertexAttribPointer(t,n,r,i,s,a)}function f(){m(),a=!0,s!==i&&(s=i,o(s.object))}function m(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:function(n,i,l,f,m){let g=!1;const v=function(t,n,i){const s=!0===i.wireframe;let a=r[t.id];void 0===a&&(a={},r[t.id]=a);let o=a[n.id];void 0===o&&(o={},a[n.id]=o);let l=o[s];void 0===l&&(l=u(e.createVertexArray()),o[s]=l);return l}(f,l,i);s!==v&&(s=v,o(s.object)),g=function(e,t,n,r){const i=s.attributes,a=t.attributes;let o=0;const l=n.getAttributes();for(const t in l){if(l[t].location>=0){const n=i[t];let r=a[t];if(void 0===r&&("instanceMatrix"===t&&e.instanceMatrix&&(r=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(r=e.instanceColor)),void 0===n)return!0;if(n.attribute!==r)return!0;if(r&&n.data!==r.data)return!0;o++}}return s.attributesNum!==o||s.index!==r}(n,f,l,m),g&&function(e,t,n,r){const i={},a=t.attributes;let o=0;const l=n.getAttributes();for(const t in l){if(l[t].location>=0){let n=a[t];void 0===n&&("instanceMatrix"===t&&e.instanceMatrix&&(n=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(n=e.instanceColor));const r={};r.attribute=n,n&&n.data&&(r.data=n.data),i[t]=r,o++}}s.attributes=i,s.attributesNum=o,s.index=r}(n,f,l,m),null!==m&&t.update(m,e.ELEMENT_ARRAY_BUFFER),(g||a)&&(a=!1,function(n,r,i,s){c();const a=s.attributes,o=i.getAttributes(),l=r.defaultAttributeValues;for(const r in o){const i=o[r];if(i.location>=0){let o=a[r];if(void 0===o&&("instanceMatrix"===r&&n.instanceMatrix&&(o=n.instanceMatrix),"instanceColor"===r&&n.instanceColor&&(o=n.instanceColor)),void 0!==o){const r=o.normalized,a=o.itemSize,l=t.get(o);if(void 0===l)continue;const u=l.buffer,c=l.type,d=l.bytesPerElement,f=c===e.INT||c===e.UNSIGNED_INT||o.gpuType===ie;if(o.isInterleavedBufferAttribute){const t=o.data,l=t.stride,m=o.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e<i.locationSize;e++)h(i.location+e,t.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===s._maxInstanceCount&&(s._maxInstanceCount=t.meshPerAttribute*t.count)}else for(let e=0;e<i.locationSize;e++)A(i.location+e);e.bindBuffer(e.ARRAY_BUFFER,u);for(let e=0;e<i.locationSize;e++)p(i.location+e,a/i.locationSize,c,r,l*d,(m+a/i.locationSize*e)*d,f)}else{if(o.isInstancedBufferAttribute){for(let e=0;e<i.locationSize;e++)h(i.location+e,o.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===s._maxInstanceCount&&(s._maxInstanceCount=o.meshPerAttribute*o.count)}else for(let e=0;e<i.locationSize;e++)A(i.location+e);e.bindBuffer(e.ARRAY_BUFFER,u);for(let e=0;e<i.locationSize;e++)p(i.location+e,a/i.locationSize,c,r,a*d,a/i.locationSize*e*d,f)}}else if(void 0!==l){const t=l[r];if(void 0!==t)switch(t.length){case 2:e.vertexAttrib2fv(i.location,t);break;case 3:e.vertexAttrib3fv(i.location,t);break;case 4:e.vertexAttrib4fv(i.location,t);break;default:e.vertexAttrib1fv(i.location,t)}}}}d()}(n,i,l,f),null!==m&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(m).buffer))},reset:f,resetDefaultState:m,dispose:function(){f();for(const e in r){const t=r[e];for(const e in t){const n=t[e];for(const e in n)l(n[e].object),delete n[e];delete t[e]}delete r[e]}},releaseStatesOfGeometry:function(e){if(void 0===r[e.id])return;const t=r[e.id];for(const e in t){const n=t[e];for(const e in n)l(n[e].object),delete n[e];delete t[e]}delete r[e.id]},releaseStatesOfProgram:function(e){for(const t in r){const n=r[t];if(void 0===n[e.id])continue;const i=n[e.id];for(const e in i)l(i[e].object),delete i[e];delete n[e.id]}},initAttributes:c,enableAttribute:A,disableUnusedAttributes:d}}function fo(e,t,n){let r;function i(t,i,s){0!==s&&(e.drawArraysInstanced(r,t,i,s),n.update(i,r,s))}this.setMode=function(e){r=e},this.render=function(t,i){e.drawArrays(r,t,i),n.update(i,r,1)},this.renderInstances=i,this.renderMultiDraw=function(e,i,s){if(0===s)return;t.get("WEBGL_multi_draw").multiDrawArraysWEBGL(r,e,0,i,0,s);let a=0;for(let e=0;e<s;e++)a+=i[e];n.update(a,r,1)},this.renderMultiDrawInstances=function(e,s,a,o){if(0===a)return;const l=t.get("WEBGL_multi_draw");if(null===l)for(let t=0;t<e.length;t++)i(e[t],s[t],o[t]);else{l.multiDrawArraysInstancedWEBGL(r,e,0,s,0,o,0,a);let t=0;for(let e=0;e<a;e++)t+=s[e]*o[e];n.update(t,r,1)}}}function mo(e,t,n,r){let i;function s(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let a=void 0!==n.precision?n.precision:"highp";const o=s(a);o!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",o,"instead."),a=o);const l=!0===n.logarithmicDepthBuffer,u=!0===n.reverseDepthBuffer&&t.has("EXT_clip_control"),c=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),A=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS);return{isWebGL2:!0,getMaxAnisotropy:function(){if(void 0!==i)return i;if(!0===t.has("EXT_texture_filter_anisotropic")){const n=t.get("EXT_texture_filter_anisotropic");i=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:s,textureFormatReadable:function(t){return t===pe||r.convert(t)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(n){const i=n===oe&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(n!==ee&&r.convert(n)!==e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)&&n!==ae&&!i)},precision:a,logarithmicDepthBuffer:l,reverseDepthBuffer:u,maxTextures:c,maxVertexTextures:A,maxTextureSize:e.getParameter(e.MAX_TEXTURE_SIZE),maxCubemapSize:e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes:e.getParameter(e.MAX_VERTEX_ATTRIBS),maxVertexUniforms:e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings:e.getParameter(e.MAX_VARYING_VECTORS),maxFragmentUniforms:e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),vertexTextures:A>0,maxSamples:e.getParameter(e.MAX_SAMPLES)}}function go(e){const t=this;let n=null,r=0,i=!1,s=!1;const a=new Oi,o=new It,l={value:null,needsUpdate:!1};function u(e,n,r,i){const s=null!==e?e.length:0;let u=null;if(0!==s){if(u=l.value,!0!==i||null===u){const t=r+4*s,i=n.matrixWorldInverse;o.getNormalMatrix(i),(null===u||u.length<t)&&(u=new Float32Array(t));for(let t=0,n=r;t!==s;++t,n+=4)a.copy(e[t]).applyMatrix4(i,o),a.normal.toArray(u,n),u[n+3]=a.constant}l.value=u,l.needsUpdate=!0}return t.numPlanes=s,t.numIntersection=0,u}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){const n=0!==e.length||t||0!==r||i;return i=t,r=e.length,n},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(e,t){n=u(e,t,0)},this.setState=function(a,o,c){const A=a.clippingPlanes,h=a.clipIntersection,d=a.clipShadows,p=e.get(a);if(!i||null===A||0===A.length||s&&!d)s?u(null):function(){l.value!==n&&(l.value=n,l.needsUpdate=r>0);t.numPlanes=r,t.numIntersection=0}();else{const e=s?0:r,t=4*e;let i=p.clippingState||null;l.value=i,i=u(A,o,t,c);for(let e=0;e!==t;++e)i[e]=n[e];p.clippingState=i,this.numIntersection=h?this.numPlanes:0,this.numPlanes+=e}}}function vo(e){let t=new WeakMap;function n(e,t){return t===z?e.mapping=q:t===V&&(e.mapping=G),e}function r(e){const n=e.target;n.removeEventListener("dispose",r);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){const s=i.mapping;if(s===z||s===V){if(t.has(i)){return n(t.get(i).texture,i.mapping)}{const s=i.image;if(s&&s.height>0){const a=new Mi(s.height);return a.fromEquirectangularTexture(e,i),t.set(i,a),i.addEventListener("dispose",r),n(a.texture,i.mapping)}return null}}}return i},dispose:function(){t=new WeakMap}}}const _o=[.125,.215,.35,.446,.526,.582],yo=20,xo=new Oa,bo=new Rr;let So=null,To=0,wo=0,Mo=!1;const Eo=(1+Math.sqrt(5))/2,Co=1/Eo,Ro=[new on(-Eo,Co,0),new on(Eo,Co,0),new on(-Co,0,Eo),new on(Co,0,Eo),new on(0,Eo,-Co),new on(0,Eo,Co),new on(-1,1,-1),new on(1,1,-1),new on(-1,1,1),new on(1,1,1)];let No=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,r=100){So=this._renderer.getRenderTarget(),To=this._renderer.getActiveCubeFace(),wo=this._renderer.getActiveMipmapLevel(),Mo=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const i=this._allocateTargets();return i.depthBuffer=!0,this._sceneToCubeUV(e,n,r,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=Io(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=Lo(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(So,To,wo),this._renderer.xr.enabled=Mo,e.scissorTest=!1,Do(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===q||e.mapping===G?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),So=this._renderer.getRenderTarget(),To=this._renderer.getActiveCubeFace(),wo=this._renderer.getActiveMipmapLevel(),Mo=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:K,minFilter:K,generateMipmaps:!1,type:oe,format:pe,colorSpace:it,depthBuffer:!1},r=Po(e,t,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=Po(e,t,n);const{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(e){const t=[],n=[],r=[];let i=e;const s=e-4+1+_o.length;for(let a=0;a<s;a++){const s=Math.pow(2,i);n.push(s);let o=1/s;a>e-4?o=_o[a-e+4-1]:0===a&&(o=0),r.push(o);const l=1/(s-2),u=-l,c=1+l,A=[u,u,c,u,c,c,u,u,c,c,u,c],h=6,d=6,p=3,f=2,m=1,g=new Float32Array(p*d*h),v=new Float32Array(f*d*h),_=new Float32Array(m*d*h);for(let e=0;e<h;e++){const t=e%3*2/3-1,n=e>2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];g.set(r,p*d*e),v.set(A,f*d*e);const i=[e,e,e,e,e,e];_.set(i,m*d*e)}const y=new Zr;y.setAttribute("position",new qr(g,p)),y.setAttribute("uv",new qr(v,f)),y.setAttribute("faceIndex",new qr(_,m)),t.push(y),i>4&&i--}return{lodPlanes:t,sizeLods:n,sigmas:r}}(r)),this._blurMaterial=function(e,t,n){const r=new Float32Array(yo),i=new on(0,1,0),s=new gi({name:"SphericalGaussianBlur",defines:{n:yo,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Uo(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1});return s}(r,e,t)}return r}_compileMaterial(e){const t=new ci(this._lodPlanes[0],e);this._renderer.compile(t,xo)}_sceneToCubeUV(e,t,n,r){const i=new bi(90,1,t,n),s=[1,-1,1,1,1,1],a=[1,1,1,-1,-1,-1],o=this._renderer,l=o.autoClear,u=o.toneMapping;o.getClearColor(bo),o.toneMapping=0,o.autoClear=!1;const c=new Lr({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1}),A=new ci(new hi,c);let h=!1;const d=e.background;d?d.isColor&&(c.color.copy(d),e.background=null,h=!0):(c.color.copy(bo),h=!0);for(let t=0;t<6;t++){const n=t%3;0===n?(i.up.set(0,s[t],0),i.lookAt(a[t],0,0)):1===n?(i.up.set(0,0,s[t]),i.lookAt(0,a[t],0)):(i.up.set(0,s[t],0),i.lookAt(0,0,a[t]));const l=this._cubeSize;Do(r,n*l,t>2?l:0,l,l),o.setRenderTarget(r),h&&o.render(A,i),o.render(e,i)}A.geometry.dispose(),A.material.dispose(),o.toneMapping=u,o.autoClear=l,e.background=d}_textureToCubeUV(e,t){const n=this._renderer,r=e.mapping===q||e.mapping===G;r?(null===this._cubemapMaterial&&(this._cubemapMaterial=Io()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=Lo());const i=r?this._cubemapMaterial:this._equirectMaterial,s=new ci(this._lodPlanes[0],i);i.uniforms.envMap.value=e;const a=this._cubeSize;Do(t,0,0,3*a,2*a),n.setRenderTarget(t),n.render(s,xo)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const r=this._lodPlanes.length;for(let t=1;t<r;t++){const n=Math.sqrt(this._sigmas[t]*this._sigmas[t]-this._sigmas[t-1]*this._sigmas[t-1]),i=Ro[(r-t-1)%Ro.length];this._blur(e,t-1,t,n,i)}t.autoClear=n}_blur(e,t,n,r,i){const s=this._pingPongRenderTarget;this._halfBlur(e,s,t,n,r,"latitudinal",i),this._halfBlur(s,e,n,n,r,"longitudinal",i)}_halfBlur(e,t,n,r,i,s,a){const o=this._renderer,l=this._blurMaterial;"latitudinal"!==s&&"longitudinal"!==s&&console.error("blur direction must be either latitudinal or longitudinal!");const u=new ci(this._lodPlanes[r],l),c=l.uniforms,A=this._sizeLods[n]-1,h=isFinite(i)?Math.PI/(2*A):2*Math.PI/39,d=i/h,p=isFinite(i)?1+Math.floor(3*d):yo;p>yo&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${p} samples when the maximum is set to 20`);const f=[];let m=0;for(let e=0;e<yo;++e){const t=e/d,n=Math.exp(-t*t/2);f.push(n),0===e?m+=n:e<p&&(m+=2*n)}for(let e=0;e<f.length;e++)f[e]=f[e]/m;c.envMap.value=e.texture,c.samples.value=p,c.weights.value=f,c.latitudinal.value="latitudinal"===s,a&&(c.poleAxis.value=a);const{_lodMax:g}=this;c.dTheta.value=h,c.mipInt.value=g-n;const v=this._sizeLods[r];Do(t,3*v*(r>g-4?r-g+4:0),4*(this._cubeSize-v),3*v,2*v),o.setRenderTarget(t),o.render(u,xo)}};function Po(e,t,n){const r=new nn(e,t,n);return r.texture.mapping=H,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function Do(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function Lo(){return new gi({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Uo(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function Io(){return new gi({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Uo(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function Uo(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function Bo(e){let t=new WeakMap,n=null;function r(e){const n=e.target;n.removeEventListener("dispose",r);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){const s=i.mapping,a=s===z||s===V,o=s===q||s===G;if(a||o){let s=t.get(i);const l=void 0!==s?s.texture.pmremVersion:0;if(i.isRenderTargetTexture&&i.pmremVersion!==l)return null===n&&(n=new No(e)),s=a?n.fromEquirectangular(i,s):n.fromCubemap(i,s),s.texture.pmremVersion=i.pmremVersion,t.set(i,s),s.texture;if(void 0!==s)return s.texture;{const l=i.image;return a&&l&&l.height>0||o&&l&&function(e){let t=0;const n=6;for(let r=0;r<n;r++)void 0!==e[r]&&t++;return t===n}(l)?(null===n&&(n=new No(e)),s=a?n.fromEquirectangular(i):n.fromCubemap(i),s.texture.pmremVersion=i.pmremVersion,t.set(i,s),i.addEventListener("dispose",r),s.texture):null}}}return i},dispose:function(){t=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function Oo(e){const t={};function n(n){if(void 0!==t[n])return t[n];let r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return t[n]=r,r}return{has:function(e){return null!==n(e)},init:function(){n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance"),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture"),n("WEBGL_render_shared_exponent")},get:function(e){const t=n(e);return null===t&&qt("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function Fo(e,t,n,r){const i={},s=new WeakMap;function a(e){const o=e.target;null!==o.index&&t.remove(o.index);for(const e in o.attributes)t.remove(o.attributes[e]);o.removeEventListener("dispose",a),delete i[o.id];const l=s.get(o);l&&(t.remove(l),s.delete(o)),r.releaseStatesOfGeometry(o),!0===o.isInstancedBufferGeometry&&delete o._maxInstanceCount,n.memory.geometries--}function o(e){const n=[],r=e.index,i=e.attributes.position;let a=0;if(null!==r){const e=r.array;a=r.version;for(let t=0,r=e.length;t<r;t+=3){const r=e[t+0],i=e[t+1],s=e[t+2];n.push(r,i,i,s,s,r)}}else{if(void 0===i)return;{const e=i.array;a=i.version;for(let t=0,r=e.length/3-1;t<r;t+=3){const e=t+0,r=t+1,i=t+2;n.push(e,r,r,i,i,e)}}}const o=new(Bt(n)?zr:Gr)(n,1);o.version=a;const l=s.get(e);l&&t.remove(l),s.set(e,o)}return{get:function(e,t){return!0===i[t.id]||(t.addEventListener("dispose",a),i[t.id]=!0,n.memory.geometries++),t},update:function(n){const r=n.attributes;for(const n in r)t.update(r[n],e.ARRAY_BUFFER)},getWireframeAttribute:function(e){const t=s.get(e);if(t){const n=e.index;null!==n&&t.version<n.version&&o(e)}else o(e);return s.get(e)}}}function ko(e,t,n){let r,i,s;function a(t,a,o){0!==o&&(e.drawElementsInstanced(r,a,i,t*s,o),n.update(a,r,o))}this.setMode=function(e){r=e},this.setIndex=function(e){i=e.type,s=e.bytesPerElement},this.render=function(t,a){e.drawElements(r,a,i,t*s),n.update(a,r,1)},this.renderInstances=a,this.renderMultiDraw=function(e,s,a){if(0===a)return;t.get("WEBGL_multi_draw").multiDrawElementsWEBGL(r,s,0,i,e,0,a);let o=0;for(let e=0;e<a;e++)o+=s[e];n.update(o,r,1)},this.renderMultiDrawInstances=function(e,o,l,u){if(0===l)return;const c=t.get("WEBGL_multi_draw");if(null===c)for(let t=0;t<e.length;t++)a(e[t]/s,o[t],u[t]);else{c.multiDrawElementsInstancedWEBGL(r,o,0,i,e,0,u,0,l);let t=0;for(let e=0;e<l;e++)t+=o[e]*u[e];n.update(t,r,1)}}}function qo(e){const t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(n,r,i){switch(t.calls++,r){case e.TRIANGLES:t.triangles+=i*(n/3);break;case e.LINES:t.lines+=i*(n/2);break;case e.LINE_STRIP:t.lines+=i*(n-1);break;case e.LINE_LOOP:t.lines+=i*n;break;case e.POINTS:t.points+=i*n;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",r)}}}}function Go(e,t,n){const r=new WeakMap,i=new en;return{update:function(s,a,o){const l=s.morphTargetInfluences,u=a.morphAttributes.position||a.morphAttributes.normal||a.morphAttributes.color,c=void 0!==u?u.length:0;let A=r.get(a);if(void 0===A||A.count!==c){void 0!==A&&A.texture.dispose();const h=void 0!==a.morphAttributes.position,d=void 0!==a.morphAttributes.normal,p=void 0!==a.morphAttributes.color,f=a.morphAttributes.position||[],m=a.morphAttributes.normal||[],g=a.morphAttributes.color||[];let v=0;!0===h&&(v=1),!0===d&&(v=2),!0===p&&(v=3);let _=a.attributes.position.count*v,y=1;_>t.maxTextureSize&&(y=Math.ceil(_/t.maxTextureSize),_=t.maxTextureSize);const x=new Float32Array(_*y*4*c),b=new rn(x,_,y,c);b.type=ae,b.needsUpdate=!0;const S=4*v;for(let w=0;w<c;w++){const M=f[w],E=m[w],C=g[w],R=_*y*4*w;for(let N=0;N<M.count;N++){const P=N*S;!0===h&&(i.fromBufferAttribute(M,N),x[R+P+0]=i.x,x[R+P+1]=i.y,x[R+P+2]=i.z,x[R+P+3]=0),!0===d&&(i.fromBufferAttribute(E,N),x[R+P+4]=i.x,x[R+P+5]=i.y,x[R+P+6]=i.z,x[R+P+7]=0),!0===p&&(i.fromBufferAttribute(C,N),x[R+P+8]=i.x,x[R+P+9]=i.y,x[R+P+10]=i.z,x[R+P+11]=4===C.itemSize?i.w:1)}}function T(){b.dispose(),r.delete(a),a.removeEventListener("dispose",T)}A={count:c,texture:b,size:new Lt(_,y)},r.set(a,A),a.addEventListener("dispose",T)}if(!0===s.isInstancedMesh&&null!==s.morphTexture)o.getUniforms().setValue(e,"morphTexture",s.morphTexture,n);else{let D=0;for(let I=0;I<l.length;I++)D+=l[I];const L=a.morphTargetsRelative?1:1-D;o.getUniforms().setValue(e,"morphTargetBaseInfluence",L),o.getUniforms().setValue(e,"morphTargetInfluences",l)}o.getUniforms().setValue(e,"morphTargetsTexture",A.texture,n),o.getUniforms().setValue(e,"morphTargetsTextureSize",A.size)}}}function zo(e,t,n,r){let i=new WeakMap;function s(e){const t=e.target;t.removeEventListener("dispose",s),n.remove(t.instanceMatrix),null!==t.instanceColor&&n.remove(t.instanceColor)}return{update:function(a){const o=r.render.frame,l=a.geometry,u=t.get(a,l);if(i.get(u)!==o&&(t.update(u),i.set(u,o)),a.isInstancedMesh&&(!1===a.hasEventListener("dispose",s)&&a.addEventListener("dispose",s),i.get(a)!==o&&(n.update(a.instanceMatrix,e.ARRAY_BUFFER),null!==a.instanceColor&&n.update(a.instanceColor,e.ARRAY_BUFFER),i.set(a,o))),a.isSkinnedMesh){const e=a.skeleton;i.get(e)!==o&&(e.update(),i.set(e,o))}return u},dispose:function(){i=new WeakMap}}}const Vo=new Jt,Ho=new rs(1,1),jo=new rn,Wo=new sn,Xo=new wi,Qo=[],Yo=[],$o=new Float32Array(16),Ko=new Float32Array(9),Zo=new Float32Array(4);function Jo(e,t,n){const r=e[0];if(r<=0||r>0)return e;const i=t*n;let s=Qo[i];if(void 0===s&&(s=new Float32Array(i),Qo[i]=s),0!==t){r.toArray(s,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(s,i)}return s}function el(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function tl(e,t){for(let n=0,r=t.length;n<r;n++)e[n]=t[n]}function nl(e,t){let n=Yo[t];void 0===n&&(n=new Int32Array(t),Yo[t]=n);for(let r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function rl(e,t){const n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function il(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(el(n,t))return;e.uniform2fv(this.addr,t),tl(n,t)}}function sl(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(el(n,t))return;e.uniform3fv(this.addr,t),tl(n,t)}}function al(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(el(n,t))return;e.uniform4fv(this.addr,t),tl(n,t)}}function ol(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(el(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),tl(n,t)}else{if(el(n,r))return;Zo.set(r),e.uniformMatrix2fv(this.addr,!1,Zo),tl(n,r)}}function ll(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(el(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),tl(n,t)}else{if(el(n,r))return;Ko.set(r),e.uniformMatrix3fv(this.addr,!1,Ko),tl(n,r)}}function ul(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(el(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),tl(n,t)}else{if(el(n,r))return;$o.set(r),e.uniformMatrix4fv(this.addr,!1,$o),tl(n,r)}}function cl(e,t){const n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function Al(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2i(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(el(n,t))return;e.uniform2iv(this.addr,t),tl(n,t)}}function hl(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3i(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(el(n,t))return;e.uniform3iv(this.addr,t),tl(n,t)}}function dl(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(el(n,t))return;e.uniform4iv(this.addr,t),tl(n,t)}}function pl(e,t){const n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function fl(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2ui(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(el(n,t))return;e.uniform2uiv(this.addr,t),tl(n,t)}}function ml(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3ui(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(el(n,t))return;e.uniform3uiv(this.addr,t),tl(n,t)}}function gl(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(el(n,t))return;e.uniform4uiv(this.addr,t),tl(n,t)}}function vl(e,t,n){const r=this.cache,i=n.allocateTextureUnit();let s;r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),this.type===e.SAMPLER_2D_SHADOW?(Ho.compareFunction=At,s=Ho):s=Vo,n.setTexture2D(t||s,i)}function _l(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||Wo,i)}function yl(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(t||Xo,i)}function xl(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||jo,i)}function bl(e,t){e.uniform1fv(this.addr,t)}function Sl(e,t){const n=Jo(t,this.size,2);e.uniform2fv(this.addr,n)}function Tl(e,t){const n=Jo(t,this.size,3);e.uniform3fv(this.addr,n)}function wl(e,t){const n=Jo(t,this.size,4);e.uniform4fv(this.addr,n)}function Ml(e,t){const n=Jo(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function El(e,t){const n=Jo(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function Cl(e,t){const n=Jo(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function Rl(e,t){e.uniform1iv(this.addr,t)}function Nl(e,t){e.uniform2iv(this.addr,t)}function Pl(e,t){e.uniform3iv(this.addr,t)}function Dl(e,t){e.uniform4iv(this.addr,t)}function Ll(e,t){e.uniform1uiv(this.addr,t)}function Il(e,t){e.uniform2uiv(this.addr,t)}function Ul(e,t){e.uniform3uiv(this.addr,t)}function Bl(e,t){e.uniform4uiv(this.addr,t)}function Ol(e,t,n){const r=this.cache,i=t.length,s=nl(n,i);el(r,s)||(e.uniform1iv(this.addr,s),tl(r,s));for(let e=0;e!==i;++e)n.setTexture2D(t[e]||Vo,s[e])}function Fl(e,t,n){const r=this.cache,i=t.length,s=nl(n,i);el(r,s)||(e.uniform1iv(this.addr,s),tl(r,s));for(let e=0;e!==i;++e)n.setTexture3D(t[e]||Wo,s[e])}function kl(e,t,n){const r=this.cache,i=t.length,s=nl(n,i);el(r,s)||(e.uniform1iv(this.addr,s),tl(r,s));for(let e=0;e!==i;++e)n.setTextureCube(t[e]||Xo,s[e])}function ql(e,t,n){const r=this.cache,i=t.length,s=nl(n,i);el(r,s)||(e.uniform1iv(this.addr,s),tl(r,s));for(let e=0;e!==i;++e)n.setTexture2DArray(t[e]||jo,s[e])}class Gl{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=function(e){switch(e){case 5126:return rl;case 35664:return il;case 35665:return sl;case 35666:return al;case 35674:return ol;case 35675:return ll;case 35676:return ul;case 5124:case 35670:return cl;case 35667:case 35671:return Al;case 35668:case 35672:return hl;case 35669:case 35673:return dl;case 5125:return pl;case 36294:return fl;case 36295:return ml;case 36296:return gl;case 35678:case 36198:case 36298:case 36306:case 35682:return vl;case 35679:case 36299:case 36307:return _l;case 35680:case 36300:case 36308:case 36293:return yl;case 36289:case 36303:case 36311:case 36292:return xl}}(t.type)}}class zl{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=function(e){switch(e){case 5126:return bl;case 35664:return Sl;case 35665:return Tl;case 35666:return wl;case 35674:return Ml;case 35675:return El;case 35676:return Cl;case 5124:case 35670:return Rl;case 35667:case 35671:return Nl;case 35668:case 35672:return Pl;case 35669:case 35673:return Dl;case 5125:return Ll;case 36294:return Il;case 36295:return Ul;case 36296:return Bl;case 35678:case 36198:case 36298:case 36306:case 35682:return Ol;case 35679:case 36299:case 36307:return Fl;case 35680:case 36300:case 36308:case 36293:return kl;case 36289:case 36303:case 36311:case 36292:return ql}}(t.type)}}class Vl{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const r=this.seq;for(let i=0,s=r.length;i!==s;++i){const s=r[i];s.setValue(e,t[s.id],n)}}}const Hl=/(\w+)(\])?(\[|\.)?/g;function jl(e,t){e.seq.push(t),e.map[t.id]=t}function Wl(e,t,n){const r=e.name,i=r.length;for(Hl.lastIndex=0;;){const s=Hl.exec(r),a=Hl.lastIndex;let o=s[1];const l="]"===s[2],u=s[3];if(l&&(o|=0),void 0===u||"["===u&&a+2===i){jl(n,void 0===u?new Gl(o,e,t):new zl(o,e,t));break}{let e=n.map[o];void 0===e&&(e=new Vl(o),jl(n,e)),n=e}}}class Xl{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<n;++r){const n=e.getActiveUniform(t,r);Wl(n,e.getUniformLocation(t,n.name),this)}}setValue(e,t,n,r){const i=this.map[t];void 0!==i&&i.setValue(e,n,r)}setOptional(e,t,n){const r=t[n];void 0!==r&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let i=0,s=t.length;i!==s;++i){const s=t[i],a=n[s.id];!1!==a.needsUpdate&&s.setValue(e,a.value,r)}}static seqWithValue(e,t){const n=[];for(let r=0,i=e.length;r!==i;++r){const i=e[r];i.id in t&&n.push(i)}return n}}function Ql(e,t,n){const r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}let Yl=0;const $l=new It;function Kl(e,t,n){const r=e.getShaderParameter(t,e.COMPILE_STATUS),i=e.getShaderInfoLog(t).trim();if(r&&""===i)return"";const s=/ERROR: 0:(\d+)/.exec(i);if(s){const r=parseInt(s[1]);return n.toUpperCase()+"\n\n"+i+"\n\n"+function(e,t){const n=e.split("\n"),r=[],i=Math.max(t-6,0),s=Math.min(t+6,n.length);for(let e=i;e<s;e++){const i=e+1;r.push(`${i===t?">":" "} ${i}: ${n[e]}`)}return r.join("\n")}(e.getShaderSource(t),r)}return i}function Zl(e,t){const n=function(e){Ht._getMatrix($l,Ht.workingColorSpace,e);const t=`mat3( ${$l.elements.map((e=>e.toFixed(4)))} )`;switch(Ht.getTransfer(e)){case st:return[t,"LinearTransferOETF"];case at:return[t,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",e),[t,"LinearTransferOETF"]}}(t);return[`vec4 ${e}( vec4 value ) {`,`\treturn ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,"}"].join("\n")}function Jl(e,t){let n;switch(t){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="Cineon";break;case 4:n="ACESFilmic";break;case 6:n="AgX";break;case 7:n="Neutral";break;case 5:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}const eu=new on;function tu(){Ht.getLuminanceCoefficients(eu);return["float luminance( const in vec3 rgb ) {",`\tconst vec3 weights = vec3( ${eu.x.toFixed(4)}, ${eu.y.toFixed(4)}, ${eu.z.toFixed(4)} );`,"\treturn dot( weights, rgb );","}"].join("\n")}function nu(e){return""!==e}function ru(e,t){const n=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function iu(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const su=/^[ \t]*#include +<([\w\d./]+)>/gm;function au(e){return e.replace(su,lu)}const ou=new Map;function lu(e,t){let n=ao[t];if(void 0===n){const e=ou.get(t);if(void 0===e)throw new Error("Can not resolve #include <"+t+">");n=ao[e],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,e)}return au(n)}const uu=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function cu(e){return e.replace(uu,Au)}function Au(e,t,n,r){let i="";for(let e=parseInt(t);e<parseInt(n);e++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+e+" ]").replace(/UNROLLED_LOOP_INDEX/g,e);return i}function hu(e){let t=`precision ${e.precision} float;\n\tprecision ${e.precision} int;\n\tprecision ${e.precision} sampler2D;\n\tprecision ${e.precision} samplerCube;\n\tprecision ${e.precision} sampler3D;\n\tprecision ${e.precision} sampler2DArray;\n\tprecision ${e.precision} sampler2DShadow;\n\tprecision ${e.precision} samplerCubeShadow;\n\tprecision ${e.precision} sampler2DArrayShadow;\n\tprecision ${e.precision} isampler2D;\n\tprecision ${e.precision} isampler3D;\n\tprecision ${e.precision} isamplerCube;\n\tprecision ${e.precision} isampler2DArray;\n\tprecision ${e.precision} usampler2D;\n\tprecision ${e.precision} usampler3D;\n\tprecision ${e.precision} usamplerCube;\n\tprecision ${e.precision} usampler2DArray;\n\t`;return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function du(e,t,n,r){const i=e.getContext(),s=n.defines;let a=n.vertexShader,o=n.fragmentShader;const l=function(e){let t="SHADOWMAP_TYPE_BASIC";return 1===e.shadowMapType?t="SHADOWMAP_TYPE_PCF":2===e.shadowMapType?t="SHADOWMAP_TYPE_PCF_SOFT":3===e.shadowMapType&&(t="SHADOWMAP_TYPE_VSM"),t}(n),u=function(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case q:case G:t="ENVMAP_TYPE_CUBE";break;case H:t="ENVMAP_TYPE_CUBE_UV"}return t}(n),c=function(e){let t="ENVMAP_MODE_REFLECTION";e.envMap&&e.envMapMode===G&&(t="ENVMAP_MODE_REFRACTION");return t}(n),A=function(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case 0:t="ENVMAP_BLENDING_MULTIPLY";break;case 1:t="ENVMAP_BLENDING_MIX";break;case 2:t="ENVMAP_BLENDING_ADD"}return t}(n),h=function(e){const t=e.envMapCubeUVHeight;if(null===t)return null;const n=Math.log2(t)-2,r=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:r,maxMip:n}}(n),d=function(e){return[e.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",e.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(nu).join("\n")}(n),p=function(e){const t=[];for(const n in e){const r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(s),f=i.createProgram();let m,g,v=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(m=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p].filter(nu).join("\n"),m.length>0&&(m+="\n"),g=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p].filter(nu).join("\n"),g.length>0&&(g+="\n")):(m=[hu(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH","\tuniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(nu).join("\n"),g=[hu(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.envMap?"#define "+c:"",n.envMap?"#define "+A:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?ao.tonemapping_pars_fragment:"",0!==n.toneMapping?Jl("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",ao.colorspace_pars_fragment,Zl("linearToOutputTexel",n.outputColorSpace),tu(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(nu).join("\n")),a=au(a),a=ru(a,n),a=iu(a,n),o=au(o),o=ru(o,n),o=iu(o,n),a=cu(a),o=cu(o),!0!==n.isRawShaderMaterial&&(v="#version 300 es\n",m=[d,"#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+m,g=["#define varying in",n.glslVersion===vt?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===vt?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+g);const _=v+m+a,y=v+g+o,x=Ql(i,i.VERTEX_SHADER,_),b=Ql(i,i.FRAGMENT_SHADER,y);function S(t){if(e.debug.checkShaderErrors){const n=i.getProgramInfoLog(f).trim(),r=i.getShaderInfoLog(x).trim(),s=i.getShaderInfoLog(b).trim();let a=!0,o=!0;if(!1===i.getProgramParameter(f,i.LINK_STATUS))if(a=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(i,f,x,b);else{const e=Kl(i,x,"vertex"),r=Kl(i,b,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(f,i.VALIDATE_STATUS)+"\n\nMaterial Name: "+t.name+"\nMaterial Type: "+t.type+"\n\nProgram Info Log: "+n+"\n"+e+"\n"+r)}else""!==n?console.warn("THREE.WebGLProgram: Program Info Log:",n):""!==r&&""!==s||(o=!1);o&&(t.diagnostics={runnable:a,programLog:n,vertexShader:{log:r,prefix:m},fragmentShader:{log:s,prefix:g}})}i.deleteShader(x),i.deleteShader(b),T=new Xl(i,f),w=function(e,t){const n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){const r=e.getActiveAttrib(t,i),s=r.name;let a=1;r.type===e.FLOAT_MAT2&&(a=2),r.type===e.FLOAT_MAT3&&(a=3),r.type===e.FLOAT_MAT4&&(a=4),n[s]={type:r.type,location:e.getAttribLocation(t,s),locationSize:a}}return n}(i,f)}let T,w;i.attachShader(f,x),i.attachShader(f,b),void 0!==n.index0AttributeName?i.bindAttribLocation(f,0,n.index0AttributeName):!0===n.morphTargets&&i.bindAttribLocation(f,0,"position"),i.linkProgram(f),this.getUniforms=function(){return void 0===T&&S(this),T},this.getAttributes=function(){return void 0===w&&S(this),w};let M=!1===n.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===M&&(M=i.getProgramParameter(f,37297)),M},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(f),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=Yl++,this.cacheKey=t,this.usedTimes=1,this.program=f,this.vertexShader=x,this.fragmentShader=b,this}let pu=0;class fu{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),i=this._getShaderStage(n),s=this._getShaderCacheForMaterial(e);return!1===s.has(r)&&(s.add(r),r.usedTimes++),!1===s.has(i)&&(s.add(i),i.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const e of t)e.usedTimes--,0===e.usedTimes&&this.shaderCache.delete(e.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return void 0===n&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return void 0===n&&(n=new mu(e),t.set(e,n)),n}}class mu{constructor(e){this.id=pu++,this.code=e,this.usedTimes=0}}function gu(e,t,n,r,i,s,a){const o=new Qn,l=new fu,u=new Set,c=[],A=i.logarithmicDepthBuffer,h=i.vertexTextures;let d=i.precision;const p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function f(e){return u.add(e),0===e?"uv":`uv${e}`}return{getParameters:function(s,o,c,m,g){const v=m.fog,_=g.geometry,y=s.isMeshStandardMaterial?m.environment:null,x=(s.isMeshStandardMaterial?n:t).get(s.envMap||y),b=x&&x.mapping===H?x.image.height:null,S=p[s.type];null!==s.precision&&(d=i.getMaxPrecision(s.precision),d!==s.precision&&console.warn("THREE.WebGLProgram.getParameters:",s.precision,"not supported, using",d,"instead."));const T=_.morphAttributes.position||_.morphAttributes.normal||_.morphAttributes.color,w=void 0!==T?T.length:0;let M,E,C,R,N=0;if(void 0!==_.morphAttributes.position&&(N=1),void 0!==_.morphAttributes.normal&&(N=2),void 0!==_.morphAttributes.color&&(N=3),S){const e=lo[S];M=e.vertexShader,E=e.fragmentShader}else M=s.vertexShader,E=s.fragmentShader,l.update(s),C=l.getVertexShaderID(s),R=l.getFragmentShaderID(s);const P=e.getRenderTarget(),D=e.state.buffers.depth.getReversed(),L=!0===g.isInstancedMesh,I=!0===g.isBatchedMesh,U=!!s.map,B=!!s.matcap,O=!!x,F=!!s.aoMap,k=!!s.lightMap,q=!!s.bumpMap,G=!!s.normalMap,z=!!s.displacementMap,V=!!s.emissiveMap,j=!!s.metalnessMap,W=!!s.roughnessMap,X=s.anisotropy>0,Q=s.clearcoat>0,Y=s.dispersion>0,$=s.iridescence>0,K=s.sheen>0,Z=s.transmission>0,J=X&&!!s.anisotropyMap,ee=Q&&!!s.clearcoatMap,te=Q&&!!s.clearcoatNormalMap,ne=Q&&!!s.clearcoatRoughnessMap,re=$&&!!s.iridescenceMap,ie=$&&!!s.iridescenceThicknessMap,se=K&&!!s.sheenColorMap,ae=K&&!!s.sheenRoughnessMap,oe=!!s.specularMap,le=!!s.specularColorMap,ue=!!s.specularIntensityMap,ce=Z&&!!s.transmissionMap,Ae=Z&&!!s.thicknessMap,he=!!s.gradientMap,de=!!s.alphaMap,pe=s.alphaTest>0,fe=!!s.alphaHash,me=!!s.extensions;let ge=0;s.toneMapped&&(null!==P&&!0!==P.isXRRenderTarget||(ge=e.toneMapping));const ve={shaderID:S,shaderType:s.type,shaderName:s.name,vertexShader:M,fragmentShader:E,defines:s.defines,customVertexShaderID:C,customFragmentShaderID:R,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:d,batching:I,batchingColor:I&&null!==g._colorsTexture,instancing:L,instancingColor:L&&null!==g.instanceColor,instancingMorph:L&&null!==g.morphTexture,supportsVertexTextures:h,outputColorSpace:null===P?e.outputColorSpace:!0===P.isXRRenderTarget?P.texture.colorSpace:it,alphaToCoverage:!!s.alphaToCoverage,map:U,matcap:B,envMap:O,envMapMode:O&&x.mapping,envMapCubeUVHeight:b,aoMap:F,lightMap:k,bumpMap:q,normalMap:G,displacementMap:h&&z,emissiveMap:V,normalMapObjectSpace:G&&1===s.normalMapType,normalMapTangentSpace:G&&0===s.normalMapType,metalnessMap:j,roughnessMap:W,anisotropy:X,anisotropyMap:J,clearcoat:Q,clearcoatMap:ee,clearcoatNormalMap:te,clearcoatRoughnessMap:ne,dispersion:Y,iridescence:$,iridescenceMap:re,iridescenceThicknessMap:ie,sheen:K,sheenColorMap:se,sheenRoughnessMap:ae,specularMap:oe,specularColorMap:le,specularIntensityMap:ue,transmission:Z,transmissionMap:ce,thicknessMap:Ae,gradientMap:he,opaque:!1===s.transparent&&1===s.blending&&!1===s.alphaToCoverage,alphaMap:de,alphaTest:pe,alphaHash:fe,combine:s.combine,mapUv:U&&f(s.map.channel),aoMapUv:F&&f(s.aoMap.channel),lightMapUv:k&&f(s.lightMap.channel),bumpMapUv:q&&f(s.bumpMap.channel),normalMapUv:G&&f(s.normalMap.channel),displacementMapUv:z&&f(s.displacementMap.channel),emissiveMapUv:V&&f(s.emissiveMap.channel),metalnessMapUv:j&&f(s.metalnessMap.channel),roughnessMapUv:W&&f(s.roughnessMap.channel),anisotropyMapUv:J&&f(s.anisotropyMap.channel),clearcoatMapUv:ee&&f(s.clearcoatMap.channel),clearcoatNormalMapUv:te&&f(s.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ne&&f(s.clearcoatRoughnessMap.channel),iridescenceMapUv:re&&f(s.iridescenceMap.channel),iridescenceThicknessMapUv:ie&&f(s.iridescenceThicknessMap.channel),sheenColorMapUv:se&&f(s.sheenColorMap.channel),sheenRoughnessMapUv:ae&&f(s.sheenRoughnessMap.channel),specularMapUv:oe&&f(s.specularMap.channel),specularColorMapUv:le&&f(s.specularColorMap.channel),specularIntensityMapUv:ue&&f(s.specularIntensityMap.channel),transmissionMapUv:ce&&f(s.transmissionMap.channel),thicknessMapUv:Ae&&f(s.thicknessMap.channel),alphaMapUv:de&&f(s.alphaMap.channel),vertexTangents:!!_.attributes.tangent&&(G||X),vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!_.attributes.color&&4===_.attributes.color.itemSize,pointsUvs:!0===g.isPoints&&!!_.attributes.uv&&(U||de),fog:!!v,useFog:!0===s.fog,fogExp2:!!v&&v.isFogExp2,flatShading:!0===s.flatShading,sizeAttenuation:!0===s.sizeAttenuation,logarithmicDepthBuffer:A,reverseDepthBuffer:D,skinning:!0===g.isSkinnedMesh,morphTargets:void 0!==_.morphAttributes.position,morphNormals:void 0!==_.morphAttributes.normal,morphColors:void 0!==_.morphAttributes.color,morphTargetsCount:w,morphTextureStride:N,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numLightProbes:o.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:s.dithering,shadowMapEnabled:e.shadowMap.enabled&&c.length>0,shadowMapType:e.shadowMap.type,toneMapping:ge,decodeVideoTexture:U&&!0===s.map.isVideoTexture&&Ht.getTransfer(s.map.colorSpace)===at,decodeVideoTextureEmissive:V&&!0===s.emissiveMap.isVideoTexture&&Ht.getTransfer(s.emissiveMap.colorSpace)===at,premultipliedAlpha:s.premultipliedAlpha,doubleSided:2===s.side,flipSided:1===s.side,useDepthPacking:s.depthPacking>=0,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionClipCullDistance:me&&!0===s.extensions.clipCullDistance&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(me&&!0===s.extensions.multiDraw||I)&&r.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:s.customProgramCacheKey()};return ve.vertexUv1s=u.has(1),ve.vertexUv2s=u.has(2),ve.vertexUv3s=u.has(3),u.clear(),ve},getProgramCacheKey:function(t){const n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),void 0!==t.defines)for(const e in t.defines)n.push(e),n.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(!function(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.anisotropyMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.numLightProbes),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}(n,t),function(e,t){o.disableAll(),t.supportsVertexTextures&&o.enable(0);t.instancing&&o.enable(1);t.instancingColor&&o.enable(2);t.instancingMorph&&o.enable(3);t.matcap&&o.enable(4);t.envMap&&o.enable(5);t.normalMapObjectSpace&&o.enable(6);t.normalMapTangentSpace&&o.enable(7);t.clearcoat&&o.enable(8);t.iridescence&&o.enable(9);t.alphaTest&&o.enable(10);t.vertexColors&&o.enable(11);t.vertexAlphas&&o.enable(12);t.vertexUv1s&&o.enable(13);t.vertexUv2s&&o.enable(14);t.vertexUv3s&&o.enable(15);t.vertexTangents&&o.enable(16);t.anisotropy&&o.enable(17);t.alphaHash&&o.enable(18);t.batching&&o.enable(19);t.dispersion&&o.enable(20);t.batchingColor&&o.enable(21);e.push(o.mask),o.disableAll(),t.fog&&o.enable(0);t.useFog&&o.enable(1);t.flatShading&&o.enable(2);t.logarithmicDepthBuffer&&o.enable(3);t.reverseDepthBuffer&&o.enable(4);t.skinning&&o.enable(5);t.morphTargets&&o.enable(6);t.morphNormals&&o.enable(7);t.morphColors&&o.enable(8);t.premultipliedAlpha&&o.enable(9);t.shadowMapEnabled&&o.enable(10);t.doubleSided&&o.enable(11);t.flipSided&&o.enable(12);t.useDepthPacking&&o.enable(13);t.dithering&&o.enable(14);t.transmission&&o.enable(15);t.sheen&&o.enable(16);t.opaque&&o.enable(17);t.pointsUvs&&o.enable(18);t.decodeVideoTexture&&o.enable(19);t.decodeVideoTextureEmissive&&o.enable(20);t.alphaToCoverage&&o.enable(21);e.push(o.mask)}(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()},getUniforms:function(e){const t=p[e.type];let n;if(t){const e=lo[t];n=mi.clone(e.uniforms)}else n=e.uniforms;return n},acquireProgram:function(t,n){let r;for(let e=0,t=c.length;e<t;e++){const t=c[e];if(t.cacheKey===n){r=t,++r.usedTimes;break}}return void 0===r&&(r=new du(e,n,t,s),c.push(r)),r},releaseProgram:function(e){if(0==--e.usedTimes){const t=c.indexOf(e);c[t]=c[c.length-1],c.pop(),e.destroy()}},releaseShaderCache:function(e){l.remove(e)},programs:c,dispose:function(){l.dispose()}}}function vu(){let e=new WeakMap;return{has:function(t){return e.has(t)},get:function(t){let n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,r){e.get(t)[n]=r},dispose:function(){e=new WeakMap}}}function _u(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function yu(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function xu(){const e=[];let t=0;const n=[],r=[],i=[];function s(n,r,i,s,a,o){let l=e[t];return void 0===l?(l={id:n.id,object:n,geometry:r,material:i,groupOrder:s,renderOrder:n.renderOrder,z:a,group:o},e[t]=l):(l.id=n.id,l.object=n,l.geometry=r,l.material=i,l.groupOrder=s,l.renderOrder=n.renderOrder,l.z=a,l.group=o),t++,l}return{opaque:n,transmissive:r,transparent:i,init:function(){t=0,n.length=0,r.length=0,i.length=0},push:function(e,t,a,o,l,u){const c=s(e,t,a,o,l,u);a.transmission>0?r.push(c):!0===a.transparent?i.push(c):n.push(c)},unshift:function(e,t,a,o,l,u){const c=s(e,t,a,o,l,u);a.transmission>0?r.unshift(c):!0===a.transparent?i.unshift(c):n.unshift(c)},finish:function(){for(let n=t,r=e.length;n<r;n++){const t=e[n];if(null===t.id)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}},sort:function(e,t){n.length>1&&n.sort(e||_u),r.length>1&&r.sort(t||yu),i.length>1&&i.sort(t||yu)}}}function bu(){let e=new WeakMap;return{get:function(t,n){const r=e.get(t);let i;return void 0===r?(i=new xu,e.set(t,[i])):n>=r.length?(i=new xu,r.push(i)):i=r[n],i},dispose:function(){e=new WeakMap}}}function Su(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new on,color:new Rr};break;case"SpotLight":n={position:new on,direction:new on,color:new Rr,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new on,color:new Rr,distance:0,decay:0};break;case"HemisphereLight":n={direction:new on,skyColor:new Rr,groundColor:new Rr};break;case"RectAreaLight":n={color:new Rr,position:new on,halfWidth:new on,halfHeight:new on}}return e[t.id]=n,n}}}let Tu=0;function wu(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function Mu(e){const t=new Su,n=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Lt};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Lt,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let e=0;e<9;e++)r.probe.push(new on);const i=new on,s=new On,a=new On;return{setup:function(i){let s=0,a=0,o=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let l=0,u=0,c=0,A=0,h=0,d=0,p=0,f=0,m=0,g=0,v=0;i.sort(wu);for(let e=0,_=i.length;e<_;e++){const _=i[e],y=_.color,x=_.intensity,b=_.distance,S=_.shadow&&_.shadow.map?_.shadow.map.texture:null;if(_.isAmbientLight)s+=y.r*x,a+=y.g*x,o+=y.b*x;else if(_.isLightProbe){for(let e=0;e<9;e++)r.probe[e].addScaledVector(_.sh.coefficients[e],x);v++}else if(_.isDirectionalLight){const e=t.get(_);if(e.color.copy(_.color).multiplyScalar(_.intensity),_.castShadow){const e=_.shadow,t=n.get(_);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,r.directionalShadow[l]=t,r.directionalShadowMap[l]=S,r.directionalShadowMatrix[l]=_.shadow.matrix,d++}r.directional[l]=e,l++}else if(_.isSpotLight){const e=t.get(_);e.position.setFromMatrixPosition(_.matrixWorld),e.color.copy(y).multiplyScalar(x),e.distance=b,e.coneCos=Math.cos(_.angle),e.penumbraCos=Math.cos(_.angle*(1-_.penumbra)),e.decay=_.decay,r.spot[c]=e;const i=_.shadow;if(_.map&&(r.spotLightMap[m]=_.map,m++,i.updateMatrices(_),_.castShadow&&g++),r.spotLightMatrix[c]=i.matrix,_.castShadow){const e=n.get(_);e.shadowIntensity=i.intensity,e.shadowBias=i.bias,e.shadowNormalBias=i.normalBias,e.shadowRadius=i.radius,e.shadowMapSize=i.mapSize,r.spotShadow[c]=e,r.spotShadowMap[c]=S,f++}c++}else if(_.isRectAreaLight){const e=t.get(_);e.color.copy(y).multiplyScalar(x),e.halfWidth.set(.5*_.width,0,0),e.halfHeight.set(0,.5*_.height,0),r.rectArea[A]=e,A++}else if(_.isPointLight){const e=t.get(_);if(e.color.copy(_.color).multiplyScalar(_.intensity),e.distance=_.distance,e.decay=_.decay,_.castShadow){const e=_.shadow,t=n.get(_);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,t.shadowCameraNear=e.camera.near,t.shadowCameraFar=e.camera.far,r.pointShadow[u]=t,r.pointShadowMap[u]=S,r.pointShadowMatrix[u]=_.shadow.matrix,p++}r.point[u]=e,u++}else if(_.isHemisphereLight){const e=t.get(_);e.skyColor.copy(_.color).multiplyScalar(x),e.groundColor.copy(_.groundColor).multiplyScalar(x),r.hemi[h]=e,h++}}A>0&&(!0===e.has("OES_texture_float_linear")?(r.rectAreaLTC1=oo.LTC_FLOAT_1,r.rectAreaLTC2=oo.LTC_FLOAT_2):(r.rectAreaLTC1=oo.LTC_HALF_1,r.rectAreaLTC2=oo.LTC_HALF_2)),r.ambient[0]=s,r.ambient[1]=a,r.ambient[2]=o;const _=r.hash;_.directionalLength===l&&_.pointLength===u&&_.spotLength===c&&_.rectAreaLength===A&&_.hemiLength===h&&_.numDirectionalShadows===d&&_.numPointShadows===p&&_.numSpotShadows===f&&_.numSpotMaps===m&&_.numLightProbes===v||(r.directional.length=l,r.spot.length=c,r.rectArea.length=A,r.point.length=u,r.hemi.length=h,r.directionalShadow.length=d,r.directionalShadowMap.length=d,r.pointShadow.length=p,r.pointShadowMap.length=p,r.spotShadow.length=f,r.spotShadowMap.length=f,r.directionalShadowMatrix.length=d,r.pointShadowMatrix.length=p,r.spotLightMatrix.length=f+m-g,r.spotLightMap.length=m,r.numSpotLightShadowsWithMaps=g,r.numLightProbes=v,_.directionalLength=l,_.pointLength=u,_.spotLength=c,_.rectAreaLength=A,_.hemiLength=h,_.numDirectionalShadows=d,_.numPointShadows=p,_.numSpotShadows=f,_.numSpotMaps=m,_.numLightProbes=v,r.version=Tu++)},setupView:function(e,t){let n=0,o=0,l=0,u=0,c=0;const A=t.matrixWorldInverse;for(let t=0,h=e.length;t<h;t++){const h=e[t];if(h.isDirectionalLight){const e=r.directional[n];e.direction.setFromMatrixPosition(h.matrixWorld),i.setFromMatrixPosition(h.target.matrixWorld),e.direction.sub(i),e.direction.transformDirection(A),n++}else if(h.isSpotLight){const e=r.spot[l];e.position.setFromMatrixPosition(h.matrixWorld),e.position.applyMatrix4(A),e.direction.setFromMatrixPosition(h.matrixWorld),i.setFromMatrixPosition(h.target.matrixWorld),e.direction.sub(i),e.direction.transformDirection(A),l++}else if(h.isRectAreaLight){const e=r.rectArea[u];e.position.setFromMatrixPosition(h.matrixWorld),e.position.applyMatrix4(A),a.identity(),s.copy(h.matrixWorld),s.premultiply(A),a.extractRotation(s),e.halfWidth.set(.5*h.width,0,0),e.halfHeight.set(0,.5*h.height,0),e.halfWidth.applyMatrix4(a),e.halfHeight.applyMatrix4(a),u++}else if(h.isPointLight){const e=r.point[o];e.position.setFromMatrixPosition(h.matrixWorld),e.position.applyMatrix4(A),o++}else if(h.isHemisphereLight){const e=r.hemi[c];e.direction.setFromMatrixPosition(h.matrixWorld),e.direction.transformDirection(A),c++}}},state:r}}function Eu(e){const t=new Mu(e),n=[],r=[];const i={lightsArray:n,shadowsArray:r,camera:null,lights:t,transmissionRenderTarget:{}};return{init:function(e){i.camera=e,n.length=0,r.length=0},state:i,setupLights:function(){t.setup(n)},setupLightsView:function(e){t.setupView(n,e)},pushLight:function(e){n.push(e)},pushShadow:function(e){r.push(e)}}}function Cu(e){let t=new WeakMap;return{get:function(n,r=0){const i=t.get(n);let s;return void 0===i?(s=new Eu(e),t.set(n,[s])):r>=i.length?(s=new Eu(e),i.push(s)):s=i[r],s},dispose:function(){t=new WeakMap}}}function Ru(e,t,n){let r=new qi;const i=new Lt,s=new Lt,a=new en,o=new pa({depthPacking:3201}),l=new fa,u={},c=n.maxTextureSize,p={[A]:1,[h]:0,[d]:2},f=new gi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Lt},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),m=f.clone();m.defines.HORIZONTAL_PASS=1;const g=new Zr;g.setAttribute("position",new qr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const v=new ci(g,f),_=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let y=this.type;function x(n,r){const s=t.update(v);f.defines.VSM_SAMPLES!==n.blurSamples&&(f.defines.VSM_SAMPLES=n.blurSamples,m.defines.VSM_SAMPLES=n.blurSamples,f.needsUpdate=!0,m.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new nn(i.x,i.y)),f.uniforms.shadow_pass.value=n.map.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,s,f,v,null),m.uniforms.shadow_pass.value=n.mapPass.texture,m.uniforms.resolution.value=n.mapSize,m.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,s,m,v,null)}function b(t,n,r,i){let s=null;const a=!0===r.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==a)s=a;else if(s=!0===r.isPointLight?l:o,e.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0){const e=s.uuid,t=n.uuid;let r=u[e];void 0===r&&(r={},u[e]=r);let i=r[t];void 0===i&&(i=s.clone(),r[t]=i,n.addEventListener("dispose",T)),s=i}if(s.visible=n.visible,s.wireframe=n.wireframe,s.side=3===i?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:p[n.side],s.alphaMap=n.alphaMap,s.alphaTest=n.alphaTest,s.map=n.map,s.clipShadows=n.clipShadows,s.clippingPlanes=n.clippingPlanes,s.clipIntersection=n.clipIntersection,s.displacementMap=n.displacementMap,s.displacementScale=n.displacementScale,s.displacementBias=n.displacementBias,s.wireframeLinewidth=n.wireframeLinewidth,s.linewidth=n.linewidth,!0===r.isPointLight&&!0===s.isMeshDistanceMaterial){e.properties.get(s).light=r}return s}function S(n,i,s,a,o){if(!1===n.visible)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===o)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,n.matrixWorld);const r=t.update(n),l=n.material;if(Array.isArray(l)){const t=r.groups;for(let u=0,c=t.length;u<c;u++){const c=t[u],A=l[c.materialIndex];if(A&&A.visible){const t=b(n,A,a,o);n.onBeforeShadow(e,n,i,s,r,t,c),e.renderBufferDirect(s,null,r,t,n,c),n.onAfterShadow(e,n,i,s,r,t,c)}}}else if(l.visible){const t=b(n,l,a,o);n.onBeforeShadow(e,n,i,s,r,t,null),e.renderBufferDirect(s,null,r,t,n,null),n.onAfterShadow(e,n,i,s,r,t,null)}}const l=n.children;for(let e=0,t=l.length;e<t;e++)S(l[e],i,s,a,o)}function T(e){e.target.removeEventListener("dispose",T);for(const t in u){const n=u[t],r=e.target.uuid;if(r in n){n[r].dispose(),delete n[r]}}}this.render=function(t,n,o){if(!1===_.enabled)return;if(!1===_.autoUpdate&&!1===_.needsUpdate)return;if(0===t.length)return;const l=e.getRenderTarget(),u=e.getActiveCubeFace(),A=e.getActiveMipmapLevel(),h=e.state;h.setBlending(0),h.buffers.color.setClear(1,1,1,1),h.buffers.depth.setTest(!0),h.setScissorTest(!1);const d=3!==y&&3===this.type,p=3===y&&3!==this.type;for(let l=0,u=t.length;l<u;l++){const u=t[l],A=u.shadow;if(void 0===A){console.warn("THREE.WebGLShadowMap:",u,"has no shadow.");continue}if(!1===A.autoUpdate&&!1===A.needsUpdate)continue;i.copy(A.mapSize);const f=A.getFrameExtents();if(i.multiply(f),s.copy(A.mapSize),(i.x>c||i.y>c)&&(i.x>c&&(s.x=Math.floor(c/f.x),i.x=s.x*f.x,A.mapSize.x=s.x),i.y>c&&(s.y=Math.floor(c/f.y),i.y=s.y*f.y,A.mapSize.y=s.y)),null===A.map||!0===d||!0===p){const e=3!==this.type?{minFilter:Q,magFilter:Q}:{};null!==A.map&&A.map.dispose(),A.map=new nn(i.x,i.y,e),A.map.texture.name=u.name+".shadowMap",A.camera.updateProjectionMatrix()}e.setRenderTarget(A.map),e.clear();const m=A.getViewportCount();for(let e=0;e<m;e++){const t=A.getViewport(e);a.set(s.x*t.x,s.y*t.y,s.x*t.z,s.y*t.w),h.viewport(a),A.updateMatrices(u,e),r=A.getFrustum(),S(n,o,A.camera,u,this.type)}!0!==A.isPointLightShadow&&3===this.type&&x(A,o),A.needsUpdate=!1}y=this.type,_.needsUpdate=!1,e.setRenderTarget(l,u,A)}}const Nu={[D]:1,[I]:6,[B]:7,[U]:5,[L]:0,[F]:2,[k]:4,[O]:3};function Pu(e,t){const n=new function(){let t=!1;const n=new en;let r=null;const i=new en(0,0,0,0);return{setMask:function(n){r===n||t||(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,s,a,o){!0===o&&(t*=a,r*=a,s*=a),n.set(t,r,s,a),!1===i.equals(n)&&(e.clearColor(t,r,s,a),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}},r=new function(){let n=!1,r=!1,i=null,s=null,a=null;return{setReversed:function(e){if(r!==e){const e=t.get("EXT_clip_control");r?e.clipControlEXT(e.LOWER_LEFT_EXT,e.ZERO_TO_ONE_EXT):e.clipControlEXT(e.LOWER_LEFT_EXT,e.NEGATIVE_ONE_TO_ONE_EXT);const n=a;a=null,this.setClear(n)}r=e},getReversed:function(){return r},setTest:function(t){t?ie(e.DEPTH_TEST):se(e.DEPTH_TEST)},setMask:function(t){i===t||n||(e.depthMask(t),i=t)},setFunc:function(t){if(r&&(t=Nu[t]),s!==t){switch(t){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:default:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL)}s=t}},setLocked:function(e){n=e},setClear:function(t){a!==t&&(r&&(t=1-t),e.clearDepth(t),a=t)},reset:function(){n=!1,i=null,s=null,a=null,r=!1}}},i=new function(){let t=!1,n=null,r=null,i=null,s=null,a=null,o=null,l=null,u=null;return{setTest:function(n){t||(n?ie(e.STENCIL_TEST):se(e.STENCIL_TEST))},setMask:function(r){n===r||t||(e.stencilMask(r),n=r)},setFunc:function(t,n,a){r===t&&i===n&&s===a||(e.stencilFunc(t,n,a),r=t,i=n,s=a)},setOp:function(t,n,r){a===t&&o===n&&l===r||(e.stencilOp(t,n,r),a=t,o=n,l=r)},setLocked:function(e){t=e},setClear:function(t){u!==t&&(e.clearStencil(t),u=t)},reset:function(){t=!1,n=null,r=null,i=null,s=null,a=null,o=null,l=null,u=null}}},s=new WeakMap,a=new WeakMap;let o={},l={},u=new WeakMap,c=[],A=null,h=!1,d=null,D=null,L=null,I=null,U=null,B=null,O=null,F=new Rr(0,0,0),k=0,q=!1,G=null,z=null,V=null,H=null,j=null;const W=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let X=!1,Q=0;const Y=e.getParameter(e.VERSION);-1!==Y.indexOf("WebGL")?(Q=parseFloat(/^WebGL (\d)/.exec(Y)[1]),X=Q>=1):-1!==Y.indexOf("OpenGL ES")&&(Q=parseFloat(/^OpenGL ES (\d)/.exec(Y)[1]),X=Q>=2);let $=null,K={};const Z=e.getParameter(e.SCISSOR_BOX),J=e.getParameter(e.VIEWPORT),ee=(new en).fromArray(Z),te=(new en).fromArray(J);function ne(t,n,r,i){const s=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let a=0;a<r;a++)t===e.TEXTURE_3D||t===e.TEXTURE_2D_ARRAY?e.texImage3D(n,0,e.RGBA,1,1,i,0,e.RGBA,e.UNSIGNED_BYTE,s):e.texImage2D(n+a,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,s);return a}const re={};function ie(t){!0!==o[t]&&(e.enable(t),o[t]=!0)}function se(t){!1!==o[t]&&(e.disable(t),o[t]=!1)}re[e.TEXTURE_2D]=ne(e.TEXTURE_2D,e.TEXTURE_2D,1),re[e.TEXTURE_CUBE_MAP]=ne(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),re[e.TEXTURE_2D_ARRAY]=ne(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),re[e.TEXTURE_3D]=ne(e.TEXTURE_3D,e.TEXTURE_3D,1,1),n.setClear(0,0,0,1),r.setClear(1),i.setClear(0),ie(e.DEPTH_TEST),r.setFunc(3),ue(!1),ce(1),ie(e.CULL_FACE),le(0);const ae={[p]:e.FUNC_ADD,[f]:e.FUNC_SUBTRACT,[m]:e.FUNC_REVERSE_SUBTRACT};ae[103]=e.MIN,ae[104]=e.MAX;const oe={[g]:e.ZERO,[v]:e.ONE,[_]:e.SRC_COLOR,[x]:e.SRC_ALPHA,[E]:e.SRC_ALPHA_SATURATE,[w]:e.DST_COLOR,[S]:e.DST_ALPHA,[y]:e.ONE_MINUS_SRC_COLOR,[b]:e.ONE_MINUS_SRC_ALPHA,[M]:e.ONE_MINUS_DST_COLOR,[T]:e.ONE_MINUS_DST_ALPHA,[C]:e.CONSTANT_COLOR,[R]:e.ONE_MINUS_CONSTANT_COLOR,[N]:e.CONSTANT_ALPHA,[P]:e.ONE_MINUS_CONSTANT_ALPHA};function le(t,n,r,i,s,a,o,l,u,c){if(0!==t){if(!1===h&&(ie(e.BLEND),h=!0),5===t)s=s||n,a=a||r,o=o||i,n===D&&s===U||(e.blendEquationSeparate(ae[n],ae[s]),D=n,U=s),r===L&&i===I&&a===B&&o===O||(e.blendFuncSeparate(oe[r],oe[i],oe[a],oe[o]),L=r,I=i,B=a,O=o),!1!==l.equals(F)&&u===k||(e.blendColor(l.r,l.g,l.b,u),F.copy(l),k=u),d=t,q=!1;else if(t!==d||c!==q){if(D===p&&U===p||(e.blendEquation(e.FUNC_ADD),D=p,U=p),c)switch(t){case 1:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.ONE,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFuncSeparate(e.ZERO,e.SRC_COLOR,e.ZERO,e.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case 1:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.SRC_ALPHA,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFunc(e.ZERO,e.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}L=null,I=null,B=null,O=null,F.set(0,0,0),k=0,d=t,q=c}}else!0===h&&(se(e.BLEND),h=!1)}function ue(t){G!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),G=t)}function ce(t){0!==t?(ie(e.CULL_FACE),t!==z&&(1===t?e.cullFace(e.BACK):2===t?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):se(e.CULL_FACE),z=t}function Ae(t,n,r){t?(ie(e.POLYGON_OFFSET_FILL),H===n&&j===r||(e.polygonOffset(n,r),H=n,j=r)):se(e.POLYGON_OFFSET_FILL)}return{buffers:{color:n,depth:r,stencil:i},enable:ie,disable:se,bindFramebuffer:function(t,n){return l[t]!==n&&(e.bindFramebuffer(t,n),l[t]=n,t===e.DRAW_FRAMEBUFFER&&(l[e.FRAMEBUFFER]=n),t===e.FRAMEBUFFER&&(l[e.DRAW_FRAMEBUFFER]=n),!0)},drawBuffers:function(t,n){let r=c,i=!1;if(t){r=u.get(n),void 0===r&&(r=[],u.set(n,r));const s=t.textures;if(r.length!==s.length||r[0]!==e.COLOR_ATTACHMENT0){for(let t=0,n=s.length;t<n;t++)r[t]=e.COLOR_ATTACHMENT0+t;r.length=s.length,i=!0}}else r[0]!==e.BACK&&(r[0]=e.BACK,i=!0);i&&e.drawBuffers(r)},useProgram:function(t){return A!==t&&(e.useProgram(t),A=t,!0)},setBlending:le,setMaterial:function(t,s){2===t.side?se(e.CULL_FACE):ie(e.CULL_FACE);let a=1===t.side;s&&(a=!a),ue(a),1===t.blending&&!1===t.transparent?le(0):le(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.blendColor,t.blendAlpha,t.premultipliedAlpha),r.setFunc(t.depthFunc),r.setTest(t.depthTest),r.setMask(t.depthWrite),n.setMask(t.colorWrite);const o=t.stencilWrite;i.setTest(o),o&&(i.setMask(t.stencilWriteMask),i.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),i.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),Ae(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),!0===t.alphaToCoverage?ie(e.SAMPLE_ALPHA_TO_COVERAGE):se(e.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:ue,setCullFace:ce,setLineWidth:function(t){t!==V&&(X&&e.lineWidth(t),V=t)},setPolygonOffset:Ae,setScissorTest:function(t){t?ie(e.SCISSOR_TEST):se(e.SCISSOR_TEST)},activeTexture:function(t){void 0===t&&(t=e.TEXTURE0+W-1),$!==t&&(e.activeTexture(t),$=t)},bindTexture:function(t,n,r){void 0===r&&(r=null===$?e.TEXTURE0+W-1:$);let i=K[r];void 0===i&&(i={type:void 0,texture:void 0},K[r]=i),i.type===t&&i.texture===n||($!==r&&(e.activeTexture(r),$=r),e.bindTexture(t,n||re[t]),i.type=t,i.texture=n)},unbindTexture:function(){const t=K[$];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},compressedTexImage3D:function(){try{e.compressedTexImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},updateUBOMapping:function(t,n){let r=a.get(n);void 0===r&&(r=new WeakMap,a.set(n,r));let i=r.get(t);void 0===i&&(i=e.getUniformBlockIndex(n,t.name),r.set(t,i))},uniformBlockBinding:function(t,n){const r=a.get(n).get(t);s.get(n)!==r&&(e.uniformBlockBinding(n,r,t.__bindingPointIndex),s.set(n,r))},texStorage2D:function(){try{e.texStorage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texStorage3D:function(){try{e.texStorage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texSubImage2D:function(){try{e.texSubImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texSubImage3D:function(){try{e.texSubImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},compressedTexSubImage2D:function(){try{e.compressedTexSubImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},compressedTexSubImage3D:function(){try{e.compressedTexSubImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){!1===ee.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),ee.copy(t))},viewport:function(t){!1===te.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),te.copy(t))},reset:function(){e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.blendFuncSeparate(e.ONE,e.ZERO,e.ONE,e.ZERO),e.blendColor(0,0,0,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(e.LESS),r.setReversed(!1),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(e.ALWAYS,0,4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.clearStencil(0),e.cullFace(e.BACK),e.frontFace(e.CCW),e.polygonOffset(0,0),e.activeTexture(e.TEXTURE0),e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.bindFramebuffer(e.READ_FRAMEBUFFER,null),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),o={},$=null,K={},l={},u=new WeakMap,c=[],A=null,h=!1,d=null,D=null,L=null,I=null,U=null,B=null,O=null,F=new Rr(0,0,0),k=0,q=!1,G=null,z=null,V=null,H=null,j=null,ee.set(0,0,e.canvas.width,e.canvas.height),te.set(0,0,e.canvas.width,e.canvas.height),n.reset(),r.reset(),i.reset()}}}function Du(e,t,n,r,i,s,a){const o=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,l="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),u=new Lt,c=new WeakMap;let A;const h=new WeakMap;let d=!1;try{d="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function p(e,t){return d?new OffscreenCanvas(e,t):Ot("canvas")}function f(e,t,n){let r=1;const i=G(e);if((i.width>n||i.height>n)&&(r=n/Math.max(i.width,i.height)),r<1){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof VideoFrame&&e instanceof VideoFrame){const n=Math.floor(r*i.width),s=Math.floor(r*i.height);void 0===A&&(A=p(n,s));const a=t?p(n,s):A;a.width=n,a.height=s;return a.getContext("2d").drawImage(e,0,0,n,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+i.width+"x"+i.height+") to ("+n+"x"+s+")."),a}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+i.width+"x"+i.height+")."),e}return e}function m(e){return e.generateMipmaps}function g(t){e.generateMipmap(t)}function v(t){return t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:t.isWebGL3DRenderTarget?e.TEXTURE_3D:t.isWebGLArrayRenderTarget||t.isCompressedArrayTexture?e.TEXTURE_2D_ARRAY:e.TEXTURE_2D}function _(n,r,i,s,a=!1){if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let o=r;if(r===e.RED&&(i===e.FLOAT&&(o=e.R32F),i===e.HALF_FLOAT&&(o=e.R16F),i===e.UNSIGNED_BYTE&&(o=e.R8)),r===e.RED_INTEGER&&(i===e.UNSIGNED_BYTE&&(o=e.R8UI),i===e.UNSIGNED_SHORT&&(o=e.R16UI),i===e.UNSIGNED_INT&&(o=e.R32UI),i===e.BYTE&&(o=e.R8I),i===e.SHORT&&(o=e.R16I),i===e.INT&&(o=e.R32I)),r===e.RG&&(i===e.FLOAT&&(o=e.RG32F),i===e.HALF_FLOAT&&(o=e.RG16F),i===e.UNSIGNED_BYTE&&(o=e.RG8)),r===e.RG_INTEGER&&(i===e.UNSIGNED_BYTE&&(o=e.RG8UI),i===e.UNSIGNED_SHORT&&(o=e.RG16UI),i===e.UNSIGNED_INT&&(o=e.RG32UI),i===e.BYTE&&(o=e.RG8I),i===e.SHORT&&(o=e.RG16I),i===e.INT&&(o=e.RG32I)),r===e.RGB_INTEGER&&(i===e.UNSIGNED_BYTE&&(o=e.RGB8UI),i===e.UNSIGNED_SHORT&&(o=e.RGB16UI),i===e.UNSIGNED_INT&&(o=e.RGB32UI),i===e.BYTE&&(o=e.RGB8I),i===e.SHORT&&(o=e.RGB16I),i===e.INT&&(o=e.RGB32I)),r===e.RGBA_INTEGER&&(i===e.UNSIGNED_BYTE&&(o=e.RGBA8UI),i===e.UNSIGNED_SHORT&&(o=e.RGBA16UI),i===e.UNSIGNED_INT&&(o=e.RGBA32UI),i===e.BYTE&&(o=e.RGBA8I),i===e.SHORT&&(o=e.RGBA16I),i===e.INT&&(o=e.RGBA32I)),r===e.RGB&&i===e.UNSIGNED_INT_5_9_9_9_REV&&(o=e.RGB9_E5),r===e.RGBA){const t=a?st:Ht.getTransfer(s);i===e.FLOAT&&(o=e.RGBA32F),i===e.HALF_FLOAT&&(o=e.RGBA16F),i===e.UNSIGNED_BYTE&&(o=t===at?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT_4_4_4_4&&(o=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(o=e.RGB5_A1)}return o!==e.R16F&&o!==e.R32F&&o!==e.RG16F&&o!==e.RG32F&&o!==e.RGBA16F&&o!==e.RGBA32F||t.get("EXT_color_buffer_float"),o}function y(t,n){let r;return t?null===n||n===se||n===ce?r=e.DEPTH24_STENCIL8:n===ae?r=e.DEPTH32F_STENCIL8:n===re&&(r=e.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):null===n||n===se||n===ce?r=e.DEPTH_COMPONENT24:n===ae?r=e.DEPTH_COMPONENT32F:n===re&&(r=e.DEPTH_COMPONENT16),r}function x(e,t){return!0===m(e)||e.isFramebufferTexture&&e.minFilter!==Q&&e.minFilter!==K?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function b(e){const t=e.target;t.removeEventListener("dispose",b),function(e){const t=r.get(e);if(void 0===t.__webglInit)return;const n=e.source,i=h.get(n);if(i){const r=i[t.__cacheKey];r.usedTimes--,0===r.usedTimes&&T(e),0===Object.keys(i).length&&h.delete(n)}r.remove(e)}(t),t.isVideoTexture&&c.delete(t)}function S(t){const n=t.target;n.removeEventListener("dispose",S),function(t){const n=r.get(t);t.depthTexture&&(t.depthTexture.dispose(),r.remove(t.depthTexture));if(t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(n.__webglFramebuffer[t]))for(let r=0;r<n.__webglFramebuffer[t].length;r++)e.deleteFramebuffer(n.__webglFramebuffer[t][r]);else e.deleteFramebuffer(n.__webglFramebuffer[t]);n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[t])}else{if(Array.isArray(n.__webglFramebuffer))for(let t=0;t<n.__webglFramebuffer.length;t++)e.deleteFramebuffer(n.__webglFramebuffer[t]);else e.deleteFramebuffer(n.__webglFramebuffer);if(n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer)for(let t=0;t<n.__webglColorRenderbuffer.length;t++)n.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(n.__webglColorRenderbuffer[t]);n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer)}const i=t.textures;for(let t=0,n=i.length;t<n;t++){const n=r.get(i[t]);n.__webglTexture&&(e.deleteTexture(n.__webglTexture),a.memory.textures--),r.remove(i[t])}r.remove(t)}(n)}function T(t){const n=r.get(t);e.deleteTexture(n.__webglTexture);const i=t.source;delete h.get(i)[n.__cacheKey],a.memory.textures--}let w=0;function M(t,i){const s=r.get(t);if(t.isVideoTexture&&function(e){const t=a.render.frame;c.get(e)!==t&&(c.set(e,t),e.update())}(t),!1===t.isRenderTargetTexture&&t.version>0&&s.__version!==t.version){const e=t.image;if(null===e)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==e.complete)return void D(s,t,i);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.bindTexture(e.TEXTURE_2D,s.__webglTexture,e.TEXTURE0+i)}const E={[j]:e.REPEAT,[W]:e.CLAMP_TO_EDGE,[X]:e.MIRRORED_REPEAT},C={[Q]:e.NEAREST,[Y]:e.NEAREST_MIPMAP_NEAREST,[$]:e.NEAREST_MIPMAP_LINEAR,[K]:e.LINEAR,[Z]:e.LINEAR_MIPMAP_NEAREST,[J]:e.LINEAR_MIPMAP_LINEAR},R={[lt]:e.NEVER,[ft]:e.ALWAYS,[ut]:e.LESS,[At]:e.LEQUAL,[ct]:e.EQUAL,[pt]:e.GEQUAL,[ht]:e.GREATER,[dt]:e.NOTEQUAL};function N(n,s){if(s.type!==ae||!1!==t.has("OES_texture_float_linear")||s.magFilter!==K&&s.magFilter!==Z&&s.magFilter!==$&&s.magFilter!==J&&s.minFilter!==K&&s.minFilter!==Z&&s.minFilter!==$&&s.minFilter!==J||console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),e.texParameteri(n,e.TEXTURE_WRAP_S,E[s.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,E[s.wrapT]),n!==e.TEXTURE_3D&&n!==e.TEXTURE_2D_ARRAY||e.texParameteri(n,e.TEXTURE_WRAP_R,E[s.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,C[s.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,C[s.minFilter]),s.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,R[s.compareFunction])),!0===t.has("EXT_texture_filter_anisotropic")){if(s.magFilter===Q)return;if(s.minFilter!==$&&s.minFilter!==J)return;if(s.type===ae&&!1===t.has("OES_texture_float_linear"))return;if(s.anisotropy>1||r.get(s).__currentAnisotropy){const a=t.get("EXT_texture_filter_anisotropic");e.texParameterf(n,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,i.getMaxAnisotropy())),r.get(s).__currentAnisotropy=s.anisotropy}}}function P(t,n){let r=!1;void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",b));const i=n.source;let s=h.get(i);void 0===s&&(s={},h.set(i,s));const o=function(e){const t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}(n);if(o!==t.__cacheKey){void 0===s[o]&&(s[o]={texture:e.createTexture(),usedTimes:0},a.memory.textures++,r=!0),s[o].usedTimes++;const i=s[t.__cacheKey];void 0!==i&&(s[t.__cacheKey].usedTimes--,0===i.usedTimes&&T(n)),t.__cacheKey=o,t.__webglTexture=s[o].texture}return r}function D(t,a,o){let l=e.TEXTURE_2D;(a.isDataArrayTexture||a.isCompressedArrayTexture)&&(l=e.TEXTURE_2D_ARRAY),a.isData3DTexture&&(l=e.TEXTURE_3D);const u=P(t,a),c=a.source;n.bindTexture(l,t.__webglTexture,e.TEXTURE0+o);const A=r.get(c);if(c.version!==A.__version||!0===u){n.activeTexture(e.TEXTURE0+o);const t=Ht.getPrimaries(Ht.workingColorSpace),r=a.colorSpace===nt?null:Ht.getPrimaries(a.colorSpace),h=a.colorSpace===nt||t===r?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,a.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,a.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,h);let d=f(a.image,!1,i.maxTextureSize);d=q(a,d);const p=s.convert(a.format,a.colorSpace),v=s.convert(a.type);let b,S=_(a.internalFormat,p,v,a.colorSpace,a.isVideoTexture);N(l,a);const T=a.mipmaps,w=!0!==a.isVideoTexture,M=void 0===A.__version||!0===u,E=c.dataReady,C=x(a,d);if(a.isDepthTexture)S=y(a.format===ve,a.type),M&&(w?n.texStorage2D(e.TEXTURE_2D,1,S,d.width,d.height):n.texImage2D(e.TEXTURE_2D,0,S,d.width,d.height,0,p,v,null));else if(a.isDataTexture)if(T.length>0){w&&M&&n.texStorage2D(e.TEXTURE_2D,C,S,T[0].width,T[0].height);for(let t=0,r=T.length;t<r;t++)b=T[t],w?E&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,b.width,b.height,p,v,b.data):n.texImage2D(e.TEXTURE_2D,t,S,b.width,b.height,0,p,v,b.data);a.generateMipmaps=!1}else w?(M&&n.texStorage2D(e.TEXTURE_2D,C,S,d.width,d.height),E&&n.texSubImage2D(e.TEXTURE_2D,0,0,0,d.width,d.height,p,v,d.data)):n.texImage2D(e.TEXTURE_2D,0,S,d.width,d.height,0,p,v,d.data);else if(a.isCompressedTexture)if(a.isCompressedArrayTexture){w&&M&&n.texStorage3D(e.TEXTURE_2D_ARRAY,C,S,T[0].width,T[0].height,d.depth);for(let t=0,r=T.length;t<r;t++)if(b=T[t],a.format!==pe)if(null!==p)if(w){if(E)if(a.layerUpdates.size>0){const r=ro(b.width,b.height,a.format,a.type);for(const i of a.layerUpdates){const s=b.data.subarray(i*r/b.data.BYTES_PER_ELEMENT,(i+1)*r/b.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,i,b.width,b.height,1,p,s)}a.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,b.width,b.height,d.depth,p,b.data)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,t,S,b.width,b.height,d.depth,0,b.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else w?E&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,b.width,b.height,d.depth,p,v,b.data):n.texImage3D(e.TEXTURE_2D_ARRAY,t,S,b.width,b.height,d.depth,0,p,v,b.data)}else{w&&M&&n.texStorage2D(e.TEXTURE_2D,C,S,T[0].width,T[0].height);for(let t=0,r=T.length;t<r;t++)b=T[t],a.format!==pe?null!==p?w?E&&n.compressedTexSubImage2D(e.TEXTURE_2D,t,0,0,b.width,b.height,p,b.data):n.compressedTexImage2D(e.TEXTURE_2D,t,S,b.width,b.height,0,b.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):w?E&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,b.width,b.height,p,v,b.data):n.texImage2D(e.TEXTURE_2D,t,S,b.width,b.height,0,p,v,b.data)}else if(a.isDataArrayTexture)if(w){if(M&&n.texStorage3D(e.TEXTURE_2D_ARRAY,C,S,d.width,d.height,d.depth),E)if(a.layerUpdates.size>0){const t=ro(d.width,d.height,a.format,a.type);for(const r of a.layerUpdates){const i=d.data.subarray(r*t/d.data.BYTES_PER_ELEMENT,(r+1)*t/d.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,r,d.width,d.height,1,p,v,i)}a.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,d.width,d.height,d.depth,p,v,d.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,S,d.width,d.height,d.depth,0,p,v,d.data);else if(a.isData3DTexture)w?(M&&n.texStorage3D(e.TEXTURE_3D,C,S,d.width,d.height,d.depth),E&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,d.width,d.height,d.depth,p,v,d.data)):n.texImage3D(e.TEXTURE_3D,0,S,d.width,d.height,d.depth,0,p,v,d.data);else if(a.isFramebufferTexture){if(M)if(w)n.texStorage2D(e.TEXTURE_2D,C,S,d.width,d.height);else{let t=d.width,r=d.height;for(let i=0;i<C;i++)n.texImage2D(e.TEXTURE_2D,i,S,t,r,0,p,v,null),t>>=1,r>>=1}}else if(T.length>0){if(w&&M){const t=G(T[0]);n.texStorage2D(e.TEXTURE_2D,C,S,t.width,t.height)}for(let t=0,r=T.length;t<r;t++)b=T[t],w?E&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,p,v,b):n.texImage2D(e.TEXTURE_2D,t,S,p,v,b);a.generateMipmaps=!1}else if(w){if(M){const t=G(d);n.texStorage2D(e.TEXTURE_2D,C,S,t.width,t.height)}E&&n.texSubImage2D(e.TEXTURE_2D,0,0,0,p,v,d)}else n.texImage2D(e.TEXTURE_2D,0,S,p,v,d);m(a)&&g(l),A.__version=c.version,a.onUpdate&&a.onUpdate(a)}t.__version=a.version}function L(t,i,a,l,u,c){const A=s.convert(a.format,a.colorSpace),h=s.convert(a.type),d=_(a.internalFormat,A,h,a.colorSpace),p=r.get(i),f=r.get(a);if(f.__renderTarget=i,!p.__hasExternalTextures){const t=Math.max(1,i.width>>c),r=Math.max(1,i.height>>c);u===e.TEXTURE_3D||u===e.TEXTURE_2D_ARRAY?n.texImage3D(u,c,d,t,r,i.depth,0,A,h,null):n.texImage2D(u,c,d,t,r,0,A,h,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),k(i)?o.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,l,u,f.__webglTexture,0,F(i)):(u===e.TEXTURE_2D||u>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&u<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,l,u,f.__webglTexture,c),n.bindFramebuffer(e.FRAMEBUFFER,null)}function I(t,n,r){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){const i=n.depthTexture,s=i&&i.isDepthTexture?i.type:null,a=y(n.stencilBuffer,s),l=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=F(n);k(n)?o.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,u,a,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,u,a,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,a,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,l,e.RENDERBUFFER,t)}else{const t=n.textures;for(let i=0;i<t.length;i++){const a=t[i],l=s.convert(a.format,a.colorSpace),u=s.convert(a.type),c=_(a.internalFormat,l,u,a.colorSpace),A=F(n);r&&!1===k(n)?e.renderbufferStorageMultisample(e.RENDERBUFFER,A,c,n.width,n.height):k(n)?o.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,A,c,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,c,n.width,n.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function U(t){const i=r.get(t),s=!0===t.isWebGLCubeRenderTarget;if(i.__boundDepthTexture!==t.depthTexture){const e=t.depthTexture;if(i.__depthDisposeCallback&&i.__depthDisposeCallback(),e){const t=()=>{delete i.__boundDepthTexture,delete i.__depthDisposeCallback,e.removeEventListener("dispose",t)};e.addEventListener("dispose",t),i.__depthDisposeCallback=t}i.__boundDepthTexture=e}if(t.depthTexture&&!i.__autoAllocateDepthBuffer){if(s)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,i){if(i&&i.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(e.FRAMEBUFFER,t),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const s=r.get(i.depthTexture);s.__renderTarget=i,s.__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),M(i.depthTexture,0);const a=s.__webglTexture,l=F(i);if(i.depthTexture.format===ge)k(i)?o.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a,0,l):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a,0);else{if(i.depthTexture.format!==ve)throw new Error("Unknown depthTexture format");k(i)?o.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,a,0,l):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,a,0)}}(i.__webglFramebuffer,t)}else if(s){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)if(n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[r]),void 0===i.__webglDepthbuffer[r])i.__webglDepthbuffer[r]=e.createRenderbuffer(),I(i.__webglDepthbuffer[r],t,!1);else{const n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,s=i.__webglDepthbuffer[r];e.bindRenderbuffer(e.RENDERBUFFER,s),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,s)}}else if(n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),void 0===i.__webglDepthbuffer)i.__webglDepthbuffer=e.createRenderbuffer(),I(i.__webglDepthbuffer,t,!1);else{const n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,r=i.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,r)}n.bindFramebuffer(e.FRAMEBUFFER,null)}const B=[],O=[];function F(e){return Math.min(i.maxSamples,e.samples)}function k(e){const n=r.get(e);return e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function q(e,t){const n=e.colorSpace,r=e.format,i=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||n!==it&&n!==nt&&(Ht.getTransfer(n)===at?r===pe&&i===ee||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",n)),t}function G(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?(u.width=e.naturalWidth||e.width,u.height=e.naturalHeight||e.height):"undefined"!=typeof VideoFrame&&e instanceof VideoFrame?(u.width=e.displayWidth,u.height=e.displayHeight):(u.width=e.width,u.height=e.height),u}this.allocateTextureUnit=function(){const e=w;return e>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+i.maxTextures),w+=1,e},this.resetTextureUnits=function(){w=0},this.setTexture2D=M,this.setTexture2DArray=function(t,i){const s=r.get(t);t.version>0&&s.__version!==t.version?D(s,t,i):n.bindTexture(e.TEXTURE_2D_ARRAY,s.__webglTexture,e.TEXTURE0+i)},this.setTexture3D=function(t,i){const s=r.get(t);t.version>0&&s.__version!==t.version?D(s,t,i):n.bindTexture(e.TEXTURE_3D,s.__webglTexture,e.TEXTURE0+i)},this.setTextureCube=function(t,a){const o=r.get(t);t.version>0&&o.__version!==t.version?function(t,a,o){if(6!==a.image.length)return;const l=P(t,a),u=a.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+o);const c=r.get(u);if(u.version!==c.__version||!0===l){n.activeTexture(e.TEXTURE0+o);const t=Ht.getPrimaries(Ht.workingColorSpace),r=a.colorSpace===nt?null:Ht.getPrimaries(a.colorSpace),A=a.colorSpace===nt||t===r?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,a.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,a.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,A);const h=a.isCompressedTexture||a.image[0].isCompressedTexture,d=a.image[0]&&a.image[0].isDataTexture,p=[];for(let e=0;e<6;e++)p[e]=h||d?d?a.image[e].image:a.image[e]:f(a.image[e],!0,i.maxCubemapSize),p[e]=q(a,p[e]);const v=p[0],y=s.convert(a.format,a.colorSpace),b=s.convert(a.type),S=_(a.internalFormat,y,b,a.colorSpace),T=!0!==a.isVideoTexture,w=void 0===c.__version||!0===l,M=u.dataReady;let E,C=x(a,v);if(N(e.TEXTURE_CUBE_MAP,a),h){T&&w&&n.texStorage2D(e.TEXTURE_CUBE_MAP,C,S,v.width,v.height);for(let t=0;t<6;t++){E=p[t].mipmaps;for(let r=0;r<E.length;r++){const i=E[r];a.format!==pe?null!==y?T?M&&n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,i.width,i.height,y,i.data):n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,S,i.width,i.height,0,i.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):T?M&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,i.width,i.height,y,b,i.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,S,i.width,i.height,0,y,b,i.data)}}}else{if(E=a.mipmaps,T&&w){E.length>0&&C++;const t=G(p[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,C,S,t.width,t.height)}for(let t=0;t<6;t++)if(d){T?M&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,p[t].width,p[t].height,y,b,p[t].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,S,p[t].width,p[t].height,0,y,b,p[t].data);for(let r=0;r<E.length;r++){const i=E[r].image[t].image;T?M&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,0,0,i.width,i.height,y,b,i.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,S,i.width,i.height,0,y,b,i.data)}}else{T?M&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,y,b,p[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,S,y,b,p[t]);for(let r=0;r<E.length;r++){const i=E[r];T?M&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,0,0,y,b,i.image[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,S,y,b,i.image[t])}}}m(a)&&g(e.TEXTURE_CUBE_MAP),c.__version=u.version,a.onUpdate&&a.onUpdate(a)}t.__version=a.version}(o,t,a):n.bindTexture(e.TEXTURE_CUBE_MAP,o.__webglTexture,e.TEXTURE0+a)},this.rebindTextures=function(t,n,i){const s=r.get(t);void 0!==n&&L(s.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),void 0!==i&&U(t)},this.setupRenderTarget=function(t){const i=t.texture,o=r.get(t),l=r.get(i);t.addEventListener("dispose",S);const u=t.textures,c=!0===t.isWebGLCubeRenderTarget,A=u.length>1;if(A||(void 0===l.__webglTexture&&(l.__webglTexture=e.createTexture()),l.__version=i.version,a.memory.textures++),c){o.__webglFramebuffer=[];for(let t=0;t<6;t++)if(i.mipmaps&&i.mipmaps.length>0){o.__webglFramebuffer[t]=[];for(let n=0;n<i.mipmaps.length;n++)o.__webglFramebuffer[t][n]=e.createFramebuffer()}else o.__webglFramebuffer[t]=e.createFramebuffer()}else{if(i.mipmaps&&i.mipmaps.length>0){o.__webglFramebuffer=[];for(let t=0;t<i.mipmaps.length;t++)o.__webglFramebuffer[t]=e.createFramebuffer()}else o.__webglFramebuffer=e.createFramebuffer();if(A)for(let t=0,n=u.length;t<n;t++){const n=r.get(u[t]);void 0===n.__webglTexture&&(n.__webglTexture=e.createTexture(),a.memory.textures++)}if(t.samples>0&&!1===k(t)){o.__webglMultisampledFramebuffer=e.createFramebuffer(),o.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,o.__webglMultisampledFramebuffer);for(let n=0;n<u.length;n++){const r=u[n];o.__webglColorRenderbuffer[n]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,o.__webglColorRenderbuffer[n]);const i=s.convert(r.format,r.colorSpace),a=s.convert(r.type),l=_(r.internalFormat,i,a,r.colorSpace,!0===t.isXRRenderTarget),c=F(t);e.renderbufferStorageMultisample(e.RENDERBUFFER,c,l,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+n,e.RENDERBUFFER,o.__webglColorRenderbuffer[n])}e.bindRenderbuffer(e.RENDERBUFFER,null),t.depthBuffer&&(o.__webglDepthRenderbuffer=e.createRenderbuffer(),I(o.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(e.FRAMEBUFFER,null)}}if(c){n.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture),N(e.TEXTURE_CUBE_MAP,i);for(let n=0;n<6;n++)if(i.mipmaps&&i.mipmaps.length>0)for(let r=0;r<i.mipmaps.length;r++)L(o.__webglFramebuffer[n][r],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,r);else L(o.__webglFramebuffer[n],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0);m(i)&&g(e.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(A){for(let i=0,s=u.length;i<s;i++){const s=u[i],a=r.get(s);n.bindTexture(e.TEXTURE_2D,a.__webglTexture),N(e.TEXTURE_2D,s),L(o.__webglFramebuffer,t,s,e.COLOR_ATTACHMENT0+i,e.TEXTURE_2D,0),m(s)&&g(e.TEXTURE_2D)}n.unbindTexture()}else{let r=e.TEXTURE_2D;if((t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(r=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(r,l.__webglTexture),N(r,i),i.mipmaps&&i.mipmaps.length>0)for(let n=0;n<i.mipmaps.length;n++)L(o.__webglFramebuffer[n],t,i,e.COLOR_ATTACHMENT0,r,n);else L(o.__webglFramebuffer,t,i,e.COLOR_ATTACHMENT0,r,0);m(i)&&g(r),n.unbindTexture()}t.depthBuffer&&U(t)},this.updateRenderTargetMipmap=function(e){const t=e.textures;for(let i=0,s=t.length;i<s;i++){const s=t[i];if(m(s)){const t=v(e),i=r.get(s).__webglTexture;n.bindTexture(t,i),g(t),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(t.samples>0)if(!1===k(t)){const i=t.textures,s=t.width,a=t.height;let o=e.COLOR_BUFFER_BIT;const u=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,c=r.get(t),A=i.length>1;if(A)for(let t=0;t<i.length;t++)n.bindFramebuffer(e.FRAMEBUFFER,c.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,null),n.bindFramebuffer(e.FRAMEBUFFER,c.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,null,0);n.bindFramebuffer(e.READ_FRAMEBUFFER,c.__webglMultisampledFramebuffer),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglFramebuffer);for(let n=0;n<i.length;n++){if(t.resolveDepthBuffer&&(t.depthBuffer&&(o|=e.DEPTH_BUFFER_BIT),t.stencilBuffer&&t.resolveStencilBuffer&&(o|=e.STENCIL_BUFFER_BIT)),A){e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,c.__webglColorRenderbuffer[n]);const t=r.get(i[n]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)}e.blitFramebuffer(0,0,s,a,0,0,s,a,o,e.NEAREST),!0===l&&(B.length=0,O.length=0,B.push(e.COLOR_ATTACHMENT0+n),t.depthBuffer&&!1===t.resolveDepthBuffer&&(B.push(u),O.push(u),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,O)),e.invalidateFramebuffer(e.READ_FRAMEBUFFER,B))}if(n.bindFramebuffer(e.READ_FRAMEBUFFER,null),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),A)for(let t=0;t<i.length;t++){n.bindFramebuffer(e.FRAMEBUFFER,c.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,c.__webglColorRenderbuffer[t]);const s=r.get(i[t]).__webglTexture;n.bindFramebuffer(e.FRAMEBUFFER,c.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,s,0)}n.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglMultisampledFramebuffer)}else if(t.depthBuffer&&!1===t.resolveDepthBuffer&&l){const n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[n])}},this.setupDepthRenderbuffer=U,this.setupFrameBufferTexture=L,this.useMultisampledRTT=k}function Lu(e,t){return{convert:function(n,r=""){let i;const s=Ht.getTransfer(r);if(n===ee)return e.UNSIGNED_BYTE;if(n===le)return e.UNSIGNED_SHORT_4_4_4_4;if(n===ue)return e.UNSIGNED_SHORT_5_5_5_1;if(n===Ae)return e.UNSIGNED_INT_5_9_9_9_REV;if(n===te)return e.BYTE;if(n===ne)return e.SHORT;if(n===re)return e.UNSIGNED_SHORT;if(n===ie)return e.INT;if(n===se)return e.UNSIGNED_INT;if(n===ae)return e.FLOAT;if(n===oe)return e.HALF_FLOAT;if(n===he)return e.ALPHA;if(n===de)return e.RGB;if(n===pe)return e.RGBA;if(n===fe)return e.LUMINANCE;if(n===me)return e.LUMINANCE_ALPHA;if(n===ge)return e.DEPTH_COMPONENT;if(n===ve)return e.DEPTH_STENCIL;if(n===_e)return e.RED;if(n===ye)return e.RED_INTEGER;if(n===xe)return e.RG;if(n===be)return e.RG_INTEGER;if(n===Se)return e.RGBA_INTEGER;if(n===Te||n===we||n===Me||n===Ee)if(s===at){if(i=t.get("WEBGL_compressed_texture_s3tc_srgb"),null===i)return null;if(n===Te)return i.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===we)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Me)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Ee)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(i=t.get("WEBGL_compressed_texture_s3tc"),null===i)return null;if(n===Te)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===we)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Me)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Ee)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(n===Ce||n===Re||n===Ne||n===Pe){if(i=t.get("WEBGL_compressed_texture_pvrtc"),null===i)return null;if(n===Ce)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Re)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Ne)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Pe)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(n===De||n===Le||n===Ie){if(i=t.get("WEBGL_compressed_texture_etc"),null===i)return null;if(n===De||n===Le)return s===at?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2;if(n===Ie)return s===at?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC}if(n===Ue||n===Be||n===Oe||n===Fe||n===ke||n===qe||n===Ge||n===ze||n===Ve||n===He||n===je||n===We||n===Xe||n===Qe){if(i=t.get("WEBGL_compressed_texture_astc"),null===i)return null;if(n===Ue)return s===at?i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:i.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Be)return s===at?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:i.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Oe)return s===at?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:i.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Fe)return s===at?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:i.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===ke)return s===at?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:i.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===qe)return s===at?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:i.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Ge)return s===at?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:i.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===ze)return s===at?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:i.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Ve)return s===at?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:i.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===He)return s===at?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:i.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===je)return s===at?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:i.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===We)return s===at?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:i.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Xe)return s===at?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:i.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===Qe)return s===at?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:i.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===Ye||n===$e||n===Ke){if(i=t.get("EXT_texture_compression_bptc"),null===i)return null;if(n===Ye)return s===at?i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:i.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===$e)return i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===Ke)return i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(n===Ze||n===Je||n===et||n===tt){if(i=t.get("EXT_texture_compression_rgtc"),null===i)return null;if(n===Ye)return i.COMPRESSED_RED_RGTC1_EXT;if(n===Je)return i.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===et)return i.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===tt)return i.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return n===ce?e.UNSIGNED_INT_24_8:void 0!==e[n]?e[n]:null}}}const Iu={type:"move"};class Uu{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new ts,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new ts,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new on,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new on),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new ts,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new on,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new on),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let r=null,i=null,s=null;const a=this._targetRay,o=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){s=!0;for(const r of e.hand.values()){const e=t.getJointPose(r,n),i=this._getHandJoint(l,r);null!==e&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.matrixWorldNeedsUpdate=!0,i.jointRadius=e.radius),i.visible=null!==e}const r=l.joints["index-finger-tip"],i=l.joints["thumb-tip"],a=r.position.distanceTo(i.position),o=.02,u=.005;l.inputState.pinching&&a>o+u?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&a<=o-u&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),null!==i&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1));null!==a&&(r=t.getPose(e.targetRaySpace,n),null===r&&null!==i&&(r=i),null!==r&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Iu)))}return null!==a&&(a.visible=null!==r),null!==o&&(o.visible=null!==i),null!==l&&(l.visible=null!==s),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){const n=new ts;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class Bu{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(null===this.texture){const r=new Jt;e.properties.get(r).__webglTexture=t.texture,t.depthNear==n.depthNear&&t.depthFar==n.depthFar||(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=r}}getMesh(e){if(null!==this.texture&&null===this.mesh){const t=e.cameras[0].viewport,n=new gi({vertexShader:"\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}",fragmentShader:"\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n\tif ( coord.x >= 1.0 ) {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n\t}\n\n}",uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new ci(new na(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class Ou extends xt{constructor(e,t){super();const n=this;let r=null,i=1,s=null,a="local-floor",o=1,l=null,u=null,c=null,A=null,h=null,d=null;const p=new Bu,f=t.getContextAttributes();let m=null,g=null;const v=[],_=[],y=new Lt;let x=null;const b=new bi;b.viewport=new en;const S=new bi;S.viewport=new en;const T=[b,S],w=new ja;let M=null,E=null;function C(e){const t=_.indexOf(e.inputSource);if(-1===t)return;const n=v[t];void 0!==n&&(n.update(e.inputSource,e.frame,l||s),n.dispatchEvent({type:e.type,data:e.inputSource}))}function R(){r.removeEventListener("select",C),r.removeEventListener("selectstart",C),r.removeEventListener("selectend",C),r.removeEventListener("squeeze",C),r.removeEventListener("squeezestart",C),r.removeEventListener("squeezeend",C),r.removeEventListener("end",R),r.removeEventListener("inputsourceschange",N);for(let e=0;e<v.length;e++){const t=_[e];null!==t&&(_[e]=null,v[e].disconnect(t))}M=null,E=null,p.reset(),e.setRenderTarget(m),h=null,A=null,c=null,r=null,g=null,U.stop(),n.isPresenting=!1,e.setPixelRatio(x),e.setSize(y.width,y.height,!1),n.dispatchEvent({type:"sessionend"})}function N(e){for(let t=0;t<e.removed.length;t++){const n=e.removed[t],r=_.indexOf(n);r>=0&&(_[r]=null,v[r].disconnect(n))}for(let t=0;t<e.added.length;t++){const n=e.added[t];let r=_.indexOf(n);if(-1===r){for(let e=0;e<v.length;e++){if(e>=_.length){_.push(n),r=e;break}if(null===_[e]){_[e]=n,r=e;break}}if(-1===r)break}const i=v[r];i&&i.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=v[e];return void 0===t&&(t=new Uu,v[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=v[e];return void 0===t&&(t=new Uu,v[e]=t),t.getGripSpace()},this.getHand=function(e){let t=v[e];return void 0===t&&(t=new Uu,v[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){i=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){a=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||s},this.setReferenceSpace=function(e){l=e},this.getBaseLayer=function(){return null!==A?A:h},this.getBinding=function(){return c},this.getFrame=function(){return d},this.getSession=function(){return r},this.setSession=async function(u){if(r=u,null!==r){if(m=e.getRenderTarget(),r.addEventListener("select",C),r.addEventListener("selectstart",C),r.addEventListener("selectend",C),r.addEventListener("squeeze",C),r.addEventListener("squeezestart",C),r.addEventListener("squeezeend",C),r.addEventListener("end",R),r.addEventListener("inputsourceschange",N),!0!==f.xrCompatible&&await t.makeXRCompatible(),x=e.getPixelRatio(),e.getSize(y),void 0===r.renderState.layers){const n={antialias:f.antialias,alpha:!0,depth:f.depth,stencil:f.stencil,framebufferScaleFactor:i};h=new XRWebGLLayer(r,t,n),r.updateRenderState({baseLayer:h}),e.setPixelRatio(1),e.setSize(h.framebufferWidth,h.framebufferHeight,!1),g=new nn(h.framebufferWidth,h.framebufferHeight,{format:pe,type:ee,colorSpace:e.outputColorSpace,stencilBuffer:f.stencil})}else{let n=null,s=null,a=null;f.depth&&(a=f.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=f.stencil?ve:ge,s=f.stencil?ce:se);const o={colorFormat:t.RGBA8,depthFormat:a,scaleFactor:i};c=new XRWebGLBinding(r,t),A=c.createProjectionLayer(o),r.updateRenderState({layers:[A]}),e.setPixelRatio(1),e.setSize(A.textureWidth,A.textureHeight,!1),g=new nn(A.textureWidth,A.textureHeight,{format:pe,type:ee,depthTexture:new rs(A.textureWidth,A.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:f.stencil,colorSpace:e.outputColorSpace,samples:f.antialias?4:0,resolveDepthBuffer:!1===A.ignoreDepthValues})}g.isXRRenderTarget=!0,this.setFoveation(o),l=null,s=await r.requestReferenceSpace(a),U.setContext(r),U.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==r)return r.environmentBlendMode},this.getDepthTexture=function(){return p.getDepthTexture()};const P=new on,D=new on;function L(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===r)return;let t=e.near,n=e.far;null!==p.texture&&(p.depthNear>0&&(t=p.depthNear),p.depthFar>0&&(n=p.depthFar)),w.near=S.near=b.near=t,w.far=S.far=b.far=n,M===w.near&&E===w.far||(r.updateRenderState({depthNear:w.near,depthFar:w.far}),M=w.near,E=w.far),b.layers.mask=2|e.layers.mask,S.layers.mask=4|e.layers.mask,w.layers.mask=b.layers.mask|S.layers.mask;const i=e.parent,s=w.cameras;L(w,i);for(let e=0;e<s.length;e++)L(s[e],i);2===s.length?function(e,t,n){P.setFromMatrixPosition(t.matrixWorld),D.setFromMatrixPosition(n.matrixWorld);const r=P.distanceTo(D),i=t.projectionMatrix.elements,s=n.projectionMatrix.elements,a=i[14]/(i[10]-1),o=i[14]/(i[10]+1),l=(i[9]+1)/i[5],u=(i[9]-1)/i[5],c=(i[8]-1)/i[0],A=(s[8]+1)/s[0],h=a*c,d=a*A,p=r/(-c+A),f=p*-c;if(t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(f),e.translateZ(p),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert(),-1===i[10])e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse);else{const t=a+p,n=o+p,i=h-f,s=d+(r-f),c=l*o/n*t,A=u*o/n*t;e.projectionMatrix.makePerspective(i,s,c,A,t,n),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}}(w,b,S):w.projectionMatrix.copy(b.projectionMatrix),function(e,t,n){null===n?e.matrix.copy(t.matrixWorld):(e.matrix.copy(n.matrixWorld),e.matrix.invert(),e.matrix.multiply(t.matrixWorld));e.matrix.decompose(e.position,e.quaternion,e.scale),e.updateMatrixWorld(!0),e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse),e.isPerspectiveCamera&&(e.fov=2*wt*Math.atan(1/e.projectionMatrix.elements[5]),e.zoom=1)}(e,w,i)},this.getCamera=function(){return w},this.getFoveation=function(){if(null!==A||null!==h)return o},this.setFoveation=function(e){o=e,null!==A&&(A.fixedFoveation=e),null!==h&&void 0!==h.fixedFoveation&&(h.fixedFoveation=e)},this.hasDepthSensing=function(){return null!==p.texture},this.getDepthSensingMesh=function(){return p.getMesh(w)};let I=null;const U=new io;U.setAnimationLoop((function(t,i){if(u=i.getViewerPose(l||s),d=i,null!==u){const t=u.views;null!==h&&(e.setRenderTargetFramebuffer(g,h.framebuffer),e.setRenderTarget(g));let n=!1;t.length!==w.cameras.length&&(w.cameras.length=0,n=!0);for(let r=0;r<t.length;r++){const i=t[r];let s=null;if(null!==h)s=h.getViewport(i);else{const t=c.getViewSubImage(A,i);s=t.viewport,0===r&&(e.setRenderTargetTextures(g,t.colorTexture,A.ignoreDepthValues?void 0:t.depthStencilTexture),e.setRenderTarget(g))}let a=T[r];void 0===a&&(a=new bi,a.layers.enable(r),a.viewport=new en,T[r]=a),a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.quaternion,a.scale),a.projectionMatrix.fromArray(i.projectionMatrix),a.projectionMatrixInverse.copy(a.projectionMatrix).invert(),a.viewport.set(s.x,s.y,s.width,s.height),0===r&&(w.matrix.copy(a.matrix),w.matrix.decompose(w.position,w.quaternion,w.scale)),!0===n&&w.cameras.push(a)}const i=r.enabledFeatures;if(i&&i.includes("depth-sensing")){const n=c.getDepthInformation(t[0]);n&&n.isValid&&n.texture&&p.init(e,n,r.renderState)}}for(let e=0;e<v.length;e++){const t=_[e],n=v[e];null!==t&&void 0!==n&&n.update(t,i,l||s)}I&&I(t,i),i.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:i}),d=null})),this.setAnimationLoop=function(e){I=e},this.dispose=function(){}}}const Fu=new Xn,ku=new On;function qu(e,t){function n(e,t){!0===e.matrixAutoUpdate&&e.updateMatrix(),t.value.copy(e.matrix)}function r(e,r){e.opacity.value=r.opacity,r.color&&e.diffuse.value.copy(r.color),r.emissive&&e.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(e.map.value=r.map,n(r.map,e.mapTransform)),r.alphaMap&&(e.alphaMap.value=r.alphaMap,n(r.alphaMap,e.alphaMapTransform)),r.bumpMap&&(e.bumpMap.value=r.bumpMap,n(r.bumpMap,e.bumpMapTransform),e.bumpScale.value=r.bumpScale,1===r.side&&(e.bumpScale.value*=-1)),r.normalMap&&(e.normalMap.value=r.normalMap,n(r.normalMap,e.normalMapTransform),e.normalScale.value.copy(r.normalScale),1===r.side&&e.normalScale.value.negate()),r.displacementMap&&(e.displacementMap.value=r.displacementMap,n(r.displacementMap,e.displacementMapTransform),e.displacementScale.value=r.displacementScale,e.displacementBias.value=r.displacementBias),r.emissiveMap&&(e.emissiveMap.value=r.emissiveMap,n(r.emissiveMap,e.emissiveMapTransform)),r.specularMap&&(e.specularMap.value=r.specularMap,n(r.specularMap,e.specularMapTransform)),r.alphaTest>0&&(e.alphaTest.value=r.alphaTest);const i=t.get(r),s=i.envMap,a=i.envMapRotation;s&&(e.envMap.value=s,Fu.copy(a),Fu.x*=-1,Fu.y*=-1,Fu.z*=-1,s.isCubeTexture&&!1===s.isRenderTargetTexture&&(Fu.y*=-1,Fu.z*=-1),e.envMapRotation.value.setFromMatrix4(ku.makeRotationFromEuler(Fu)),e.flipEnvMap.value=s.isCubeTexture&&!1===s.isRenderTargetTexture?-1:1,e.reflectivity.value=r.reflectivity,e.ior.value=r.ior,e.refractionRatio.value=r.refractionRatio),r.lightMap&&(e.lightMap.value=r.lightMap,e.lightMapIntensity.value=r.lightMapIntensity,n(r.lightMap,e.lightMapTransform)),r.aoMap&&(e.aoMap.value=r.aoMap,e.aoMapIntensity.value=r.aoMapIntensity,n(r.aoMap,e.aoMapTransform))}return{refreshFogUniforms:function(t,n){n.color.getRGB(t.fogColor.value,fi(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)},refreshMaterialUniforms:function(e,i,s,a,o){i.isMeshBasicMaterial||i.isMeshLambertMaterial?r(e,i):i.isMeshToonMaterial?(r(e,i),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,i)):i.isMeshPhongMaterial?(r(e,i),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,i)):i.isMeshStandardMaterial?(r(e,i),function(e,t){e.metalness.value=t.metalness,t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap,n(t.metalnessMap,e.metalnessMapTransform));e.roughness.value=t.roughness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap,n(t.roughnessMap,e.roughnessMapTransform));t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}(e,i),i.isMeshPhysicalMaterial&&function(e,t,r){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,n(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,n(t.sheenRoughnessMap,e.sheenRoughnessMapTransform)));t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,n(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,n(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,n(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),1===t.side&&e.clearcoatNormalScale.value.negate()));t.dispersion>0&&(e.dispersion.value=t.dispersion);t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,n(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,n(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform)));t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=r.texture,e.transmissionSamplerSize.value.set(r.width,r.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,n(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,n(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor));t.anisotropy>0&&(e.anisotropyVector.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation)),t.anisotropyMap&&(e.anisotropyMap.value=t.anisotropyMap,n(t.anisotropyMap,e.anisotropyMapTransform)));e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,n(t.specularColorMap,e.specularColorMapTransform));t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,n(t.specularIntensityMap,e.specularIntensityMapTransform))}(e,i,o)):i.isMeshMatcapMaterial?(r(e,i),function(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,i)):i.isMeshDepthMaterial?r(e,i):i.isMeshDistanceMaterial?(r(e,i),function(e,n){const r=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(r.matrixWorld),e.nearDistance.value=r.shadow.camera.near,e.farDistance.value=r.shadow.camera.far}(e,i)):i.isMeshNormalMaterial?r(e,i):i.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform))}(e,i),i.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,i)):i.isPointsMaterial?function(e,t,r,i){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*r,e.scale.value=.5*i,t.map&&(e.map.value=t.map,n(t.map,e.uvTransform));t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform));t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,i,s,a):i.isSpriteMaterial?function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform));t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform));t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,i):i.isShadowMaterial?(e.color.value.copy(i.color),e.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function Gu(e,t,n,r){let i={},s={},a=[];const o=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function l(e,t,n,r){const i=e.value,s=t+"_"+n;if(void 0===r[s])return r[s]="number"==typeof i||"boolean"==typeof i?i:i.clone(),!0;{const e=r[s];if("number"==typeof i||"boolean"==typeof i){if(e!==i)return r[s]=i,!0}else if(!1===e.equals(i))return e.copy(i),!0}return!1}function u(e){const t={boundary:0,storage:0};return"number"==typeof e||"boolean"==typeof e?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",e),t}function c(t){const n=t.target;n.removeEventListener("dispose",c);const r=a.indexOf(n.__bindingPointIndex);a.splice(r,1),e.deleteBuffer(i[n.id]),delete i[n.id],delete s[n.id]}return{bind:function(e,t){const n=t.program;r.uniformBlockBinding(e,n)},update:function(n,A){let h=i[n.id];void 0===h&&(!function(e){const t=e.uniforms;let n=0;const r=16;for(let e=0,i=t.length;e<i;e++){const i=Array.isArray(t[e])?t[e]:[t[e]];for(let e=0,t=i.length;e<t;e++){const t=i[e],s=Array.isArray(t.value)?t.value:[t.value];for(let e=0,i=s.length;e<i;e++){const i=u(s[e]),a=n%r,o=a%i.boundary,l=a+o;n+=o,0!==l&&r-l<i.storage&&(n+=r-l),t.__data=new Float32Array(i.storage/Float32Array.BYTES_PER_ELEMENT),t.__offset=n,n+=i.storage}}}const i=n%r;i>0&&(n+=r-i);e.__size=n,e.__cache={}}(n),h=function(t){const n=function(){for(let e=0;e<o;e++)if(-1===a.indexOf(e))return a.push(e),e;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();t.__bindingPointIndex=n;const r=e.createBuffer(),i=t.__size,s=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,r),e.bufferData(e.UNIFORM_BUFFER,i,s),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,n,r),r}(n),i[n.id]=h,n.addEventListener("dispose",c));const d=A.program;r.updateUBOMapping(n,d);const p=t.render.frame;s[n.id]!==p&&(!function(t){const n=i[t.id],r=t.uniforms,s=t.__cache;e.bindBuffer(e.UNIFORM_BUFFER,n);for(let t=0,n=r.length;t<n;t++){const n=Array.isArray(r[t])?r[t]:[r[t]];for(let r=0,i=n.length;r<i;r++){const i=n[r];if(!0===l(i,t,r,s)){const t=i.__offset,n=Array.isArray(i.value)?i.value:[i.value];let r=0;for(let s=0;s<n.length;s++){const a=n[s],o=u(a);"number"==typeof a||"boolean"==typeof a?(i.__data[0]=a,e.bufferSubData(e.UNIFORM_BUFFER,t+r,i.__data)):a.isMatrix3?(i.__data[0]=a.elements[0],i.__data[1]=a.elements[1],i.__data[2]=a.elements[2],i.__data[3]=0,i.__data[4]=a.elements[3],i.__data[5]=a.elements[4],i.__data[6]=a.elements[5],i.__data[7]=0,i.__data[8]=a.elements[6],i.__data[9]=a.elements[7],i.__data[10]=a.elements[8],i.__data[11]=0):(a.toArray(i.__data,r),r+=o.storage/Float32Array.BYTES_PER_ELEMENT)}e.bufferSubData(e.UNIFORM_BUFFER,t,i.__data)}}}e.bindBuffer(e.UNIFORM_BUFFER,null)}(n),s[n.id]=p)},dispose:function(){for(const t in i)e.deleteBuffer(i[t]);a=[],i={},s={}}}}const zu=new on,Vu=new On,Hu=new On,ju=new on,Wu=new on;function Xu(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var Qu="object"==typeof global&&global&&global.Object===Object&&global,Yu="object"==typeof self&&self&&self.Object===Object&&self,$u=Qu||Yu||Function("return this")(),Ku=function(){return $u.Date.now()},Zu=/\s/;var Ju=/^\s+/;function ec(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&Zu.test(e.charAt(t)););return t}(e)+1).replace(Ju,""):e}var tc=$u.Symbol,nc=Object.prototype,rc=nc.hasOwnProperty,ic=nc.toString,sc=tc?tc.toStringTag:void 0;var ac=Object.prototype.toString;var oc=tc?tc.toStringTag:void 0;function lc(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":oc&&oc in Object(e)?function(e){var t=rc.call(e,sc),n=e[sc];try{e[sc]=void 0;var r=!0}catch(e){}var i=ic.call(e);return r&&(t?e[sc]=n:delete e[sc]),i}(e):function(e){return ac.call(e)}(e)}var uc=/^[-+]0x[0-9a-f]+$/i,cc=/^0b[01]+$/i,Ac=/^0o[0-7]+$/i,hc=parseInt;function dc(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==lc(e)}(e))return NaN;if(Xu(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Xu(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=ec(e);var n=cc.test(e);return n||Ac.test(e)?hc(e.slice(2),n?2:8):uc.test(e)?NaN:+e}var pc=Math.max,fc=Math.min;function mc(e,t,n){var r,i,s,a,o,l,u=0,c=!1,A=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function d(t){var n=r,s=i;return r=i=void 0,u=t,a=e.apply(s,n)}function p(e){var n=e-l;return void 0===l||n>=t||n<0||A&&e-u>=s}function f(){var e=Ku();if(p(e))return m(e);o=setTimeout(f,function(e){var n=t-(e-l);return A?fc(n,s-(e-u)):n}(e))}function m(e){return o=void 0,h&&r?d(e):(r=i=void 0,a)}function g(){var e=Ku(),n=p(e);if(r=arguments,i=this,l=e,n){if(void 0===o)return function(e){return u=e,o=setTimeout(f,t),c?d(e):a}(l);if(A)return clearTimeout(o),o=setTimeout(f,t),d(l)}return void 0===o&&(o=setTimeout(f,t)),a}return t=dc(t)||0,Xu(n)&&(c=!!n.leading,s=(A="maxWait"in n)?pc(dc(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h),g.cancel=function(){void 0!==o&&clearTimeout(o),u=0,r=l=i=o=void 0},g.flush=function(){return void 0===o?a:m(Ku())},g}function gc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function vc(e,t,n){return Object.defineProperty(e,"prototype",{writable:!1}),e}function _c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,0===t);else for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return gc(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gc(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var yc=vc((function e(t,n){var r=n.default,i=void 0===r?null:r,s=n.triggerUpdate,a=void 0===s||s,o=n.onChange,l=void 0===o?function(e,t){}:o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name=t,this.defaultVal=i,this.triggerUpdate=a,this.onChange=l}));function xc(e){var t=e.stateInit,n=void 0===t?function(){return{}}:t,r=e.props,i=void 0===r?{}:r,s=e.methods,a=void 0===s?{}:s,o=e.aliases,l=void 0===o?{}:o,u=e.init,c=void 0===u?function(){}:u,A=e.update,h=void 0===A?function(){}:A,d=Object.keys(i).map((function(e){return new yc(e,i[e])}));return function e(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var s=!!(this instanceof e?this.constructor:void 0),o=s?r.shift():void 0,u=r[0],A=void 0===u?{}:u,p=Object.assign({},n instanceof Function?n(A):n,{initialised:!1}),f={};function m(e){return g(e,A),v(),m}var g=function(e,t){c.call(m,e,p,t),p.initialised=!0},v=mc((function(){p.initialised&&(h.call(m,p,f),f={})}),1);return d.forEach((function(e){m[e.name]=function(e){var t=e.name,n=e.triggerUpdate,r=void 0!==n&&n,i=e.onChange,s=void 0===i?function(e,t){}:i,a=e.defaultVal,o=void 0===a?null:a;return function(e){var n=p[t];if(!arguments.length)return n;var i=void 0===e?o:e;return p[t]=i,s.call(m,i,p,n),!f.hasOwnProperty(t)&&(f[t]=n),r&&v(),m}}(e)})),Object.keys(a).forEach((function(e){m[e]=function(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=a[e]).call.apply(t,[m,p].concat(r))}})),Object.entries(l).forEach((function(e){var t=_c(e,2),n=t[0],r=t[1];return m[n]=m[r]})),m.resetProps=function(){return d.forEach((function(e){m[e.name](e.defaultVal)})),m},m.resetProps(),p._rerender=v,s&&o&&m(o),m}}var bc,Sc=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return 0===e?0:1===e?1:-Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)},Out:function(e){return 0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin(5*(e-.1)*Math.PI)+1},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?-.5*Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)+1}}),Back:Object.freeze({In:function(e){var t=1.70158;return 1===e?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return 0===e?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-Sc.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?.5*Sc.Bounce.In(2*e):.5*Sc.Bounce.Out(2*e-1)+.5}}),generatePow:function(e){return void 0===e&&(e=4),e=(e=e<Number.EPSILON?Number.EPSILON:e)>1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(2*t,e)/2:(1-Math.pow(2-2*t,e))/2+.5}}}}),Tc=function(){return performance.now()},wc=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,e)}return e.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map((function(t){return e._tweens[t]}))},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=0,i=t;r<i.length;r++){var s=i[r];null===(e=s._group)||void 0===e||e.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},e.prototype.remove=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=0,r=e;n<r.length;n++){var i=r[n];i._group=void 0,delete this._tweens[i.getId()],delete this._tweensAddedDuringUpdate[i.getId()]}},e.prototype.allStopped=function(){return this.getAll().every((function(e){return!e.isPlaying()}))},e.prototype.update=function(e,t){void 0===e&&(e=Tc()),void 0===t&&(t=!0);var n=Object.keys(this._tweens);if(0!==n.length)for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<n.length;r++){var i=this._tweens[n[r]],s=!t;i&&!1===i.update(e,s)&&!t&&this.remove(i)}n=Object.keys(this._tweensAddedDuringUpdate)}},e}(),Mc={Linear:function(e,t){var n=e.length-1,r=n*t,i=Math.floor(r),s=Mc.Utils.Linear;return t<0?s(e[0],e[1],r):t>1?s(e[n],e[n-1],n-r):s(e[i],e[i+1>n?n:i+1],r-i)},Bezier:function(e,t){for(var n=0,r=e.length-1,i=Math.pow,s=Mc.Utils.Bernstein,a=0;a<=r;a++)n+=i(1-t,r-a)*i(t,a)*e[a]*s(r,a);return n},CatmullRom:function(e,t){var n=e.length-1,r=n*t,i=Math.floor(r),s=Mc.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(i=Math.floor(r=n*(1+t))),s(e[(i-1+n)%n],e[i],e[(i+1)%n],e[(i+2)%n],r-i)):t<0?e[0]-(s(e[0],e[0],e[1],e[1],-r)-e[0]):t>1?e[n]-(s(e[n],e[n],e[n-1],e[n-1],r-n)-e[n]):s(e[i?i-1:0],e[i],e[n<i+1?n:i+1],e[n<i+2?n:i+2],r-i)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=Mc.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:(bc=[1],function(e){var t=1;if(bc[e])return bc[e];for(var n=e;n>1;n--)t*=n;return bc[e]=t,t}),CatmullRom:function(e,t,n,r,i){var s=.5*(n-e),a=.5*(r-t),o=i*i;return(2*t-2*n+s+a)*(i*o)+(-3*t+3*n-2*s-a)*o+s*i+t}}},Ec=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),Cc=new wc,Rc=function(){function e(e,t){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Sc.Linear.None,this._interpolationFunction=Mc.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Ec.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=e,"object"==typeof t?(this._group=t,t.add(this)):!0===t&&(this._group=Cc,Cc.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(e,t){if(void 0===t&&(t=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=e,this._propertiesAreSetUp=!1,this._duration=t<0?0:t,this},e.prototype.duration=function(e){return void 0===e&&(e=1e3),this._duration=e<0?0:e,this},e.prototype.dynamic=function(e){return void 0===e&&(e=!1),this._isDynamic=e,this},e.prototype.start=function(e,t){if(void 0===e&&(e=Tc()),void 0===t&&(t=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed)for(var n in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||t){if(this._propertiesAreSetUp=!0,!this._isDynamic){var r={};for(var i in this._valuesEnd)r[i]=this._valuesEnd[i];this._valuesEnd=r}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,t)}return this},e.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},e.prototype._setupProperties=function(e,t,n,r,i){for(var s in n){var a=e[s],o=Array.isArray(a),l=o?"array":typeof a,u=!o&&Array.isArray(n[s]);if("undefined"!==l&&"function"!==l){if(u){if(0===(m=n[s]).length)continue;for(var c=[a],A=0,h=m.length;A<h;A+=1){var d=this._handleRelativeValue(a,m[A]);if(isNaN(d)){u=!1,console.warn("Found invalid interpolation list. Skipping.");break}c.push(d)}u&&(n[s]=c)}if("object"!==l&&!o||!a||u)(void 0===t[s]||i)&&(t[s]=a),o||(t[s]*=1),r[s]=u?n[s].slice().reverse():t[s]||0;else{t[s]=o?[]:{};var p=a;for(var f in p)t[s][f]=p[f];r[s]=o?[]:{};var m=n[s];if(!this._isDynamic){var g={};for(var f in m)g[f]=m[f];n[s]=m=g}this._setupProperties(p,t[s],m,r[s],i)}}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(e){return void 0===e&&(e=Tc()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=e),this},e.prototype.resume=function(e){return void 0===e&&(e=Tc()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this):this},e.prototype.stopChainedTweens=function(){for(var e=0,t=this._chainedTweens.length;e<t;e++)this._chainedTweens[e].stop();return this},e.prototype.group=function(e){return e?(e.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var e;return null===(e=this._group)||void 0===e||e.remove(this),this},e.prototype.delay=function(e){return void 0===e&&(e=0),this._delayTime=e,this},e.prototype.repeat=function(e){return void 0===e&&(e=0),this._initialRepeat=e,this._repeat=e,this},e.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},e.prototype.yoyo=function(e){return void 0===e&&(e=!1),this._yoyo=e,this},e.prototype.easing=function(e){return void 0===e&&(e=Sc.Linear.None),this._easingFunction=e,this},e.prototype.interpolation=function(e){return void 0===e&&(e=Mc.Linear),this._interpolationFunction=e,this},e.prototype.chain=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._chainedTweens=e,this},e.prototype.onStart=function(e){return this._onStartCallback=e,this},e.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},e.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},e.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},e.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},e.prototype.onStop=function(e){return this._onStopCallback=e,this},e.prototype.update=function(t,n){var r,i,s=this;if(void 0===t&&(t=Tc()),void 0===n&&(n=e.autoStartOnUpdate),this._isPaused)return!0;if(!this._goToEnd&&!this._isPlaying){if(!n)return!1;this.start(t,!0)}if(this._goToEnd=!1,t<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),!1===this._onEveryStartCallbackFired&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=t-this._startTime,o=this._duration+(null!==(r=this._repeatDelayTime)&&void 0!==r?r:this._delayTime),l=this._duration+this._repeat*o,u=function(){if(0===s._duration)return 1;if(a>l)return 1;var e=Math.trunc(a/o),t=a-e*o,n=Math.min(t/s._duration,1);return 0===n&&a===s._duration?1:n}(),c=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,c),this._onUpdateCallback&&this._onUpdateCallback(this._object,u),0===this._duration||a>=this._duration){if(this._repeat>0){var A=Math.min(Math.trunc((a-this._duration)/o)+1,this._repeat);for(i in isFinite(this._repeat)&&(this._repeat-=A),this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[i]||(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=o*A,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var h=0,d=this._chainedTweens.length;h<d;h++)this._chainedTweens[h].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(e,t,n,r){for(var i in n)if(void 0!==t[i]){var s=t[i]||0,a=n[i],o=Array.isArray(e[i]),l=Array.isArray(a);!o&&l?e[i]=this._interpolationFunction(a,r):"object"==typeof a&&a?this._updateProperties(e[i],s,a,r):"number"==typeof(a=this._handleRelativeValue(s,a))&&(e[i]=s+(a-s)*r)}},e.prototype._handleRelativeValue=function(e,t){return"string"!=typeof t?t:"+"===t.charAt(0)||"-"===t.charAt(0)?e+parseFloat(t):parseFloat(t)},e.prototype._swapEndStartRepeatValues=function(e){var t=this._valuesStartRepeat[e],n=this._valuesEnd[e];this._valuesStartRepeat[e]="string"==typeof n?this._valuesStartRepeat[e]+parseFloat(n):this._valuesEnd[e],this._valuesEnd[e]=t},e.autoStartOnUpdate=!1,e}(),Nc=Cc;function Pc(e,t,n=2){const r=t&&t.length,i=r?t[0]*n:e.length;let s=Dc(e,0,i,n,!0);const a=[];if(!s||s.next===s.prev)return a;let o,l,u;if(r&&(s=function(e,t,n,r){const i=[];for(let n=0,s=t.length;n<s;n++){const a=Dc(e,t[n]*r,n<s-1?t[n+1]*r:e.length,r,!1);a===a.next&&(a.steiner=!0),i.push(Vc(a))}i.sort(kc);for(let e=0;e<i.length;e++)n=qc(i[e],n);return n}(e,t,s,n)),e.length>80*n){o=1/0,l=1/0;let t=-1/0,r=-1/0;for(let s=n;s<i;s+=n){const n=e[s],i=e[s+1];n<o&&(o=n),i<l&&(l=i),n>t&&(t=n),i>r&&(r=i)}u=Math.max(t-o,r-l),u=0!==u?32767/u:0}return Ic(s,a,n,o,l,u,0),a}function Dc(e,t,n,r,i){let s;if(i===function(e,t,n,r){let i=0;for(let s=t,a=n-r;s<n;s+=r)i+=(e[a]-e[s])*(e[s+1]+e[a+1]),a=s;return i}(e,t,n,r)>0)for(let i=t;i<n;i+=r)s=eA(i/r|0,e[i],e[i+1],s);else for(let i=n-r;i>=t;i-=r)s=eA(i/r|0,e[i],e[i+1],s);return s&&Qc(s,s.next)&&(tA(s),s=s.next),s}function Lc(e,t){if(!e)return e;t||(t=e);let n,r=e;do{if(n=!1,r.steiner||!Qc(r,r.next)&&0!==Xc(r.prev,r,r.next))r=r.next;else{if(tA(r),r=t=r.prev,r===r.next)break;n=!0}}while(n||r!==t);return t}function Ic(e,t,n,r,i,s,a){if(!e)return;!a&&s&&function(e,t,n,r){let i=e;do{0===i.z&&(i.z=zc(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,n=1;do{let r,i=e;e=null;let s=null;for(t=0;i;){t++;let a=i,o=0;for(let e=0;e<n&&(o++,a=a.nextZ,a);e++);let l=n;for(;o>0||l>0&&a;)0!==o&&(0===l||!a||i.z<=a.z)?(r=i,i=i.nextZ,o--):(r=a,a=a.nextZ,l--),s?s.nextZ=r:e=r,r.prevZ=s,s=r;i=a}s.nextZ=null,n*=2}while(t>1)}(i)}(e,r,i,s);let o=e;for(;e.prev!==e.next;){const l=e.prev,u=e.next;if(s?Bc(e,r,i,s):Uc(e))t.push(l.i,e.i,u.i),tA(e),e=u.next,o=u.next;else if((e=u)===o){a?1===a?Ic(e=Oc(Lc(e),t),t,n,r,i,s,2):2===a&&Fc(e,t,n,r,i,s):Ic(Lc(e),t,n,r,i,s,1);break}}}function Uc(e){const t=e.prev,n=e,r=e.next;if(Xc(t,n,r)>=0)return!1;const i=t.x,s=n.x,a=r.x,o=t.y,l=n.y,u=r.y,c=Math.min(i,s,a),A=Math.min(o,l,u),h=Math.max(i,s,a),d=Math.max(o,l,u);let p=r.next;for(;p!==t;){if(p.x>=c&&p.x<=h&&p.y>=A&&p.y<=d&&jc(i,o,s,l,a,u,p.x,p.y)&&Xc(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Bc(e,t,n,r){const i=e.prev,s=e,a=e.next;if(Xc(i,s,a)>=0)return!1;const o=i.x,l=s.x,u=a.x,c=i.y,A=s.y,h=a.y,d=Math.min(o,l,u),p=Math.min(c,A,h),f=Math.max(o,l,u),m=Math.max(c,A,h),g=zc(d,p,t,n,r),v=zc(f,m,t,n,r);let _=e.prevZ,y=e.nextZ;for(;_&&_.z>=g&&y&&y.z<=v;){if(_.x>=d&&_.x<=f&&_.y>=p&&_.y<=m&&_!==i&&_!==a&&jc(o,c,l,A,u,h,_.x,_.y)&&Xc(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,y.x>=d&&y.x<=f&&y.y>=p&&y.y<=m&&y!==i&&y!==a&&jc(o,c,l,A,u,h,y.x,y.y)&&Xc(y.prev,y,y.next)>=0)return!1;y=y.nextZ}for(;_&&_.z>=g;){if(_.x>=d&&_.x<=f&&_.y>=p&&_.y<=m&&_!==i&&_!==a&&jc(o,c,l,A,u,h,_.x,_.y)&&Xc(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;y&&y.z<=v;){if(y.x>=d&&y.x<=f&&y.y>=p&&y.y<=m&&y!==i&&y!==a&&jc(o,c,l,A,u,h,y.x,y.y)&&Xc(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function Oc(e,t){let n=e;do{const r=n.prev,i=n.next.next;!Qc(r,i)&&Yc(r,n,n.next,i)&&Zc(r,i)&&Zc(i,r)&&(t.push(r.i,n.i,i.i),tA(n),tA(n.next),n=e=i),n=n.next}while(n!==e);return Lc(n)}function Fc(e,t,n,r,i,s){let a=e;do{let e=a.next.next;for(;e!==a.prev;){if(a.i!==e.i&&Wc(a,e)){let o=Jc(a,e);return a=Lc(a,a.next),o=Lc(o,o.next),Ic(a,t,n,r,i,s,0),void Ic(o,t,n,r,i,s,0)}e=e.next}a=a.next}while(a!==e)}function kc(e,t){let n=e.x-t.x;if(0===n&&(n=e.y-t.y,0===n)){n=(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)}return n}function qc(e,t){const n=function(e,t){let n=t;const r=e.x,i=e.y;let s,a=-1/0;if(Qc(e,n))return n;do{if(Qc(e,n.next))return n.next;if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){const e=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>a&&(a=e,s=n.x<n.next.x?n:n.next,e===r))return s}n=n.next}while(n!==t);if(!s)return null;const o=s,l=s.x,u=s.y;let c=1/0;n=s;do{if(r>=n.x&&n.x>=l&&r!==n.x&&Hc(i<u?r:a,i,l,u,i<u?a:r,i,n.x,n.y)){const t=Math.abs(i-n.y)/(r-n.x);Zc(n,e)&&(t<c||t===c&&(n.x>s.x||n.x===s.x&&Gc(s,n)))&&(s=n,c=t)}n=n.next}while(n!==o);return s}(e,t);if(!n)return t;const r=Jc(n,e);return Lc(r,r.next),Lc(n,n.next)}function Gc(e,t){return Xc(e.prev,e,t.prev)<0&&Xc(t.next,e,e.next)<0}function zc(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Vc(e){let t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function Hc(e,t,n,r,i,s,a,o){return(i-a)*(t-o)>=(e-a)*(s-o)&&(e-a)*(r-o)>=(n-a)*(t-o)&&(n-a)*(s-o)>=(i-a)*(r-o)}function jc(e,t,n,r,i,s,a,o){return!(e===a&&t===o)&&Hc(e,t,n,r,i,s,a,o)}function Wc(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Yc(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(Zc(e,t)&&Zc(t,e)&&function(e,t){let n=e,r=!1;const i=(e.x+t.x)/2,s=(e.y+t.y)/2;do{n.y>s!=n.next.y>s&&n.next.y!==n.y&&i<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(Xc(e.prev,e,t.prev)||Xc(e,t.prev,t))||Qc(e,t)&&Xc(e.prev,e,e.next)>0&&Xc(t.prev,t,t.next)>0)}function Xc(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Qc(e,t){return e.x===t.x&&e.y===t.y}function Yc(e,t,n,r){const i=Kc(Xc(e,t,n)),s=Kc(Xc(e,t,r)),a=Kc(Xc(n,r,e)),o=Kc(Xc(n,r,t));return i!==s&&a!==o||(!(0!==i||!$c(e,n,t))||(!(0!==s||!$c(e,r,t))||(!(0!==a||!$c(n,e,r))||!(0!==o||!$c(n,t,r)))))}function $c(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Kc(e){return e>0?1:e<0?-1:0}function Zc(e,t){return Xc(e.prev,e,e.next)<0?Xc(e,t,e.next)>=0&&Xc(e,e.prev,t)>=0:Xc(e,t,e.prev)<0||Xc(e,e.next,t)<0}function Jc(e,t){const n=nA(e.i,e.x,e.y),r=nA(t.i,t.x,t.y),i=e.next,s=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,s.next=r,r.prev=s,r}function eA(e,t,n,r){const i=nA(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function tA(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function nA(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function rA(e){const t=[],n=[],r=e[0][0].length;let i=0,s=0;for(const a of e){for(const e of a)for(let n=0;n<r;n++)t.push(e[n]);s&&(i+=s,n.push(i)),s=a.length}return{vertices:t,holes:n,dimensions:r}}function iA(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function sA(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function aA(e){let t,n,r;function i(e,r,i=0,s=e.length){if(i<s){if(0!==t(r,r))return s;do{const t=i+s>>>1;n(e[t],r)<0?i=t+1:s=t}while(i<s)}return i}return 2!==e.length?(t=iA,n=(t,n)=>iA(e(t),n),r=(t,n)=>e(t)-n):(t=e===iA||e===sA?e:oA,n=e,r=e),{left:i,center:function(e,t,n=0,s=e.length){const a=i(e,t,n,s-1);return a>n&&r(e[a-1],t)>-r(e[a],t)?a-1:a},right:function(e,r,i=0,s=e.length){if(i<s){if(0!==t(r,r))return s;do{const t=i+s>>>1;n(e[t],r)<=0?i=t+1:s=t}while(i<s)}return i}}}function oA(){return 0}Nc.getAll.bind(Nc),Nc.removeAll.bind(Nc),Nc.add.bind(Nc),Nc.remove.bind(Nc),Nc.update.bind(Nc);const lA=aA(iA).right;function uA(e,t){let n,r;if(void 0===t)for(const t of e)null!=t&&(void 0===n?t>=t&&(n=r=t):(n>t&&(n=t),r<t&&(r=t)));else{let i=-1;for(let s of e)null!=(s=t(s,++i,e))&&(void 0===n?s>=s&&(n=r=s):(n>s&&(n=s),r<s&&(r=s)))}return[n,r]}aA((function(e){return null===e?NaN:+e})).center;class cA{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const t=this._partials;let n=0;for(let r=0;r<this._n&&r<32;r++){const i=t[r],s=e+i,a=Math.abs(e)<Math.abs(i)?e-(s-i):i-(s-e);a&&(t[n++]=a),e=s}return t[n]=e,this._n=n+1,this}valueOf(){const e=this._partials;let t,n,r,i=this._n,s=0;if(i>0){for(s=e[--i];i>0&&(t=s,n=e[--i],s=t+n,r=n-(s-t),!r););i>0&&(r<0&&e[i-1]<0||r>0&&e[i-1]>0)&&(n=2*r,t=s+n,n==t-s&&(s=t))}return s}}const AA=Math.sqrt(50),hA=Math.sqrt(10),dA=Math.sqrt(2);function pA(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),a=s>=AA?10:s>=hA?5:s>=dA?2:1;let o,l,u;return i<0?(u=Math.pow(10,-i)/a,o=Math.round(e*u),l=Math.round(t*u),o/u<e&&++o,l/u>t&&--l,u=-u):(u=Math.pow(10,i)*a,o=Math.round(e/u),l=Math.round(t/u),o*u<e&&++o,l*u>t&&--l),l<o&&.5<=n&&n<2?pA(e,t,2*n):[o,l,u]}function fA(e,t,n){return pA(e=+e,t=+t,n=+n)[2]}function mA(e){return Array.from(function*(e){for(const t of e)yield*t}(e))}function gA(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),s=new Array(i);++r<i;)s[r]=e+r*n;return s}var vA=1e-6,_A=1e-12,yA=Math.PI,xA=yA/2,bA=yA/4,SA=2*yA,TA=180/yA,wA=yA/180,MA=Math.abs,EA=Math.atan,CA=Math.atan2,RA=Math.cos,NA=Math.ceil,PA=Math.hypot,DA=Math.sin,LA=Math.sign||function(e){return e>0?1:e<0?-1:0},IA=Math.sqrt;function UA(e){return e>1?xA:e<-1?-xA:Math.asin(e)}function BA(e){return(e=DA(e/2))*e}function OA(){}function FA(e,t){e&&qA.hasOwnProperty(e.type)&&qA[e.type](e,t)}var kA={Feature:function(e,t){FA(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)FA(n[r].geometry,t)}},qA={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){GA(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)GA(n[r],t,0)},Polygon:function(e,t){zA(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)zA(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)FA(n[r],t)}};function GA(e,t,n){var r,i=-1,s=e.length-n;for(t.lineStart();++i<s;)r=e[i],t.point(r[0],r[1],r[2]);t.lineEnd()}function zA(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)GA(e[n],t,1);t.polygonEnd()}function VA(e,t){e&&kA.hasOwnProperty(e.type)?kA[e.type](e,t):FA(e,t)}var HA,jA,WA,XA,QA,YA,$A,KA,ZA,JA,eh,th,nh,rh,ih,sh,ah=new cA,oh=new cA,lh={point:OA,lineStart:OA,lineEnd:OA,polygonStart:function(){ah=new cA,lh.lineStart=uh,lh.lineEnd=ch},polygonEnd:function(){var e=+ah;oh.add(e<0?SA+e:e),this.lineStart=this.lineEnd=this.point=OA},sphere:function(){oh.add(SA)}};function uh(){lh.point=Ah}function ch(){hh(HA,jA)}function Ah(e,t){lh.point=hh,HA=e,jA=t,WA=e*=wA,XA=RA(t=(t*=wA)/2+bA),QA=DA(t)}function hh(e,t){var n=(e*=wA)-WA,r=n>=0?1:-1,i=r*n,s=RA(t=(t*=wA)/2+bA),a=DA(t),o=QA*a,l=XA*s+o*RA(i),u=o*r*DA(i);ah.add(CA(u,l)),WA=e,XA=s,QA=a}function dh(e){return[CA(e[1],e[0]),UA(e[2])]}function ph(e){var t=e[0],n=e[1],r=RA(n);return[r*RA(t),r*DA(t),DA(n)]}function fh(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function mh(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function gh(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function vh(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function _h(e){var t=IA(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var yh,xh,bh,Sh,Th,wh,Mh,Eh,Ch,Rh,Nh,Ph,Dh,Lh,Ih,Uh,Bh={point:Oh,lineStart:kh,lineEnd:qh,polygonStart:function(){Bh.point=Gh,Bh.lineStart=zh,Bh.lineEnd=Vh,rh=new cA,lh.polygonStart()},polygonEnd:function(){lh.polygonEnd(),Bh.point=Oh,Bh.lineStart=kh,Bh.lineEnd=qh,ah<0?(YA=-(KA=180),$A=-(ZA=90)):rh>vA?ZA=90:rh<-1e-6&&($A=-90),sh[0]=YA,sh[1]=KA},sphere:function(){YA=-(KA=180),$A=-(ZA=90)}};function Oh(e,t){ih.push(sh=[YA=e,KA=e]),t<$A&&($A=t),t>ZA&&(ZA=t)}function Fh(e,t){var n=ph([e*wA,t*wA]);if(nh){var r=mh(nh,n),i=mh([r[1],-r[0],0],r);_h(i),i=dh(i);var s,a=e-JA,o=a>0?1:-1,l=i[0]*TA*o,u=MA(a)>180;u^(o*JA<l&&l<o*e)?(s=i[1]*TA)>ZA&&(ZA=s):u^(o*JA<(l=(l+360)%360-180)&&l<o*e)?(s=-i[1]*TA)<$A&&($A=s):(t<$A&&($A=t),t>ZA&&(ZA=t)),u?e<JA?Hh(YA,e)>Hh(YA,KA)&&(KA=e):Hh(e,KA)>Hh(YA,KA)&&(YA=e):KA>=YA?(e<YA&&(YA=e),e>KA&&(KA=e)):e>JA?Hh(YA,e)>Hh(YA,KA)&&(KA=e):Hh(e,KA)>Hh(YA,KA)&&(YA=e)}else ih.push(sh=[YA=e,KA=e]);t<$A&&($A=t),t>ZA&&(ZA=t),nh=n,JA=e}function kh(){Bh.point=Fh}function qh(){sh[0]=YA,sh[1]=KA,Bh.point=Oh,nh=null}function Gh(e,t){if(nh){var n=e-JA;rh.add(MA(n)>180?n+(n>0?360:-360):n)}else eh=e,th=t;lh.point(e,t),Fh(e,t)}function zh(){lh.lineStart()}function Vh(){Gh(eh,th),lh.lineEnd(),MA(rh)>vA&&(YA=-(KA=180)),sh[0]=YA,sh[1]=KA,nh=null}function Hh(e,t){return(t-=e)<0?t+360:t}function jh(e,t){return e[0]-t[0]}function Wh(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function Xh(e){var t,n,r,i,s,a,o;if(ZA=KA=-(YA=$A=1/0),ih=[],VA(e,Bh),n=ih.length){for(ih.sort(jh),t=1,s=[r=ih[0]];t<n;++t)Wh(r,(i=ih[t])[0])||Wh(r,i[1])?(Hh(r[0],i[1])>Hh(r[0],r[1])&&(r[1]=i[1]),Hh(i[0],r[1])>Hh(r[0],r[1])&&(r[0]=i[0])):s.push(r=i);for(a=-1/0,t=0,r=s[n=s.length-1];t<=n;r=i,++t)i=s[t],(o=Hh(r[1],i[0]))>a&&(a=o,YA=i[0],KA=r[1])}return ih=sh=null,YA===1/0||$A===1/0?[[NaN,NaN],[NaN,NaN]]:[[YA,$A],[KA,ZA]]}var Qh={sphere:OA,point:Yh,lineStart:Kh,lineEnd:ed,polygonStart:function(){Qh.lineStart=td,Qh.lineEnd=nd},polygonEnd:function(){Qh.lineStart=Kh,Qh.lineEnd=ed}};function Yh(e,t){e*=wA;var n=RA(t*=wA);$h(n*RA(e),n*DA(e),DA(t))}function $h(e,t,n){++yh,bh+=(e-bh)/yh,Sh+=(t-Sh)/yh,Th+=(n-Th)/yh}function Kh(){Qh.point=Zh}function Zh(e,t){e*=wA;var n=RA(t*=wA);Lh=n*RA(e),Ih=n*DA(e),Uh=DA(t),Qh.point=Jh,$h(Lh,Ih,Uh)}function Jh(e,t){e*=wA;var n=RA(t*=wA),r=n*RA(e),i=n*DA(e),s=DA(t),a=CA(IA((a=Ih*s-Uh*i)*a+(a=Uh*r-Lh*s)*a+(a=Lh*i-Ih*r)*a),Lh*r+Ih*i+Uh*s);xh+=a,wh+=a*(Lh+(Lh=r)),Mh+=a*(Ih+(Ih=i)),Eh+=a*(Uh+(Uh=s)),$h(Lh,Ih,Uh)}function ed(){Qh.point=Yh}function td(){Qh.point=rd}function nd(){id(Ph,Dh),Qh.point=Yh}function rd(e,t){Ph=e,Dh=t,e*=wA,t*=wA,Qh.point=id;var n=RA(t);Lh=n*RA(e),Ih=n*DA(e),Uh=DA(t),$h(Lh,Ih,Uh)}function id(e,t){e*=wA;var n=RA(t*=wA),r=n*RA(e),i=n*DA(e),s=DA(t),a=Ih*s-Uh*i,o=Uh*r-Lh*s,l=Lh*i-Ih*r,u=PA(a,o,l),c=UA(u),A=u&&-c/u;Ch.add(A*a),Rh.add(A*o),Nh.add(A*l),xh+=c,wh+=c*(Lh+(Lh=r)),Mh+=c*(Ih+(Ih=i)),Eh+=c*(Uh+(Uh=s)),$h(Lh,Ih,Uh)}function sd(e){yh=xh=bh=Sh=Th=wh=Mh=Eh=0,Ch=new cA,Rh=new cA,Nh=new cA,VA(e,Qh);var t=+Ch,n=+Rh,r=+Nh,i=PA(t,n,r);return i<_A&&(t=wh,n=Mh,r=Eh,xh<vA&&(t=bh,n=Sh,r=Th),(i=PA(t,n,r))<_A)?[NaN,NaN]:[CA(n,t)*TA,UA(r/i)*TA]}function ad(e,t){function n(n,r){return n=e(n,r),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,r){return(n=t.invert(n,r))&&e.invert(n[0],n[1])}),n}function od(e,t){return MA(e)>yA&&(e-=Math.round(e/SA)*SA),[e,t]}function ld(e,t,n){return(e%=SA)?t||n?ad(cd(e),Ad(t,n)):cd(e):t||n?Ad(t,n):od}function ud(e){return function(t,n){return MA(t+=e)>yA&&(t-=Math.round(t/SA)*SA),[t,n]}}function cd(e){var t=ud(e);return t.invert=ud(-e),t}function Ad(e,t){var n=RA(e),r=DA(e),i=RA(t),s=DA(t);function a(e,t){var a=RA(t),o=RA(e)*a,l=DA(e)*a,u=DA(t),c=u*n+o*r;return[CA(l*i-c*s,o*n-u*r),UA(c*i+l*s)]}return a.invert=function(e,t){var a=RA(t),o=RA(e)*a,l=DA(e)*a,u=DA(t),c=u*i-l*s;return[CA(l*i+u*s,o*n+c*r),UA(c*n-o*r)]},a}function hd(e,t){(t=ph(t))[0]-=e,_h(t);var n,r=(n=-t[1])>1?0:n<-1?yA:Math.acos(n);return((-t[2]<0?-r:r)+SA-vA)%SA}function dd(){var e,t=[];return{point:function(t,n,r){e.push([t,n,r])},lineStart:function(){t.push(e=[])},lineEnd:OA,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function pd(e,t){return MA(e[0]-t[0])<vA&&MA(e[1]-t[1])<vA}function fd(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function md(e,t,n,r,i){var s,a,o=[],l=[];if(e.forEach((function(e){if(!((t=e.length-1)<=0)){var t,n,r=e[0],a=e[t];if(pd(r,a)){if(!r[2]&&!a[2]){for(i.lineStart(),s=0;s<t;++s)i.point((r=e[s])[0],r[1]);return void i.lineEnd()}a[0]+=2e-6}o.push(n=new fd(r,e,null,!0)),l.push(n.o=new fd(r,null,n,!1)),o.push(n=new fd(a,e,null,!1)),l.push(n.o=new fd(a,null,n,!0))}})),o.length){for(l.sort(t),gd(o),gd(l),s=0,a=l.length;s<a;++s)l[s].e=n=!n;for(var u,c,A=o[0];;){for(var h=A,d=!0;h.v;)if((h=h.n)===A)return;u=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(d)for(s=0,a=u.length;s<a;++s)i.point((c=u[s])[0],c[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(d)for(u=h.p.z,s=u.length-1;s>=0;--s)i.point((c=u[s])[0],c[1]);else r(h.x,h.p.x,-1,i);h=h.p}u=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}}function gd(e){if(t=e.length){for(var t,n,r=0,i=e[0];++r<t;)i.n=n=e[r],n.p=i,i=n;i.n=n=e[0],n.p=i}}function vd(e){return MA(e[0])<=yA?e[0]:LA(e[0])*((MA(e[0])+yA)%SA-yA)}function _d(e,t){var n=vd(t),r=t[1],i=DA(r),s=[DA(n),-RA(n),0],a=0,o=0,l=new cA;1===i?r=xA+vA:-1===i&&(r=-xA-vA);for(var u=0,c=e.length;u<c;++u)if(h=(A=e[u]).length)for(var A,h,d=A[h-1],p=vd(d),f=d[1]/2+bA,m=DA(f),g=RA(f),v=0;v<h;++v,p=y,m=b,g=S,d=_){var _=A[v],y=vd(_),x=_[1]/2+bA,b=DA(x),S=RA(x),T=y-p,w=T>=0?1:-1,M=w*T,E=M>yA,C=m*b;if(l.add(CA(C*w*DA(M),g*S+C*RA(M))),a+=E?T+w*SA:T,E^p>=n^y>=n){var R=mh(ph(d),ph(_));_h(R);var N=mh(s,R);_h(N);var P=(E^T>=0?-1:1)*UA(N[2]);(r>P||r===P&&(R[0]||R[1]))&&(o+=E^T>=0?1:-1)}}return(a<-1e-6||a<vA&&l<-1e-12)^1&o}function yd(e,t,n,r){return function(i){var s,a,o,l=t(i),u=dd(),c=t(u),A=!1,h={point:d,lineStart:f,lineEnd:m,polygonStart:function(){h.point=g,h.lineStart=v,h.lineEnd=_,a=[],s=[]},polygonEnd:function(){h.point=d,h.lineStart=f,h.lineEnd=m,a=mA(a);var e=_d(s,r);a.length?(A||(i.polygonStart(),A=!0),md(a,bd,e,n,i)):e&&(A||(i.polygonStart(),A=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),A&&(i.polygonEnd(),A=!1),a=s=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(t,n){e(t,n)&&i.point(t,n)}function p(e,t){l.point(e,t)}function f(){h.point=p,l.lineStart()}function m(){h.point=d,l.lineEnd()}function g(e,t){o.push([e,t]),c.point(e,t)}function v(){c.lineStart(),o=[]}function _(){g(o[0][0],o[0][1]),c.lineEnd();var e,t,n,r,l=c.clean(),h=u.result(),d=h.length;if(o.pop(),s.push(o),o=null,d)if(1&l){if((t=(n=h[0]).length-1)>0){for(A||(i.polygonStart(),A=!0),i.lineStart(),e=0;e<t;++e)i.point((r=n[e])[0],r[1]);i.lineEnd()}}else d>1&&2&l&&h.push(h.pop().concat(h.shift())),a.push(h.filter(xd))}return h}}function xd(e){return e.length>1}function bd(e,t){return((e=e.x)[0]<0?e[1]-xA-vA:xA-e[1])-((t=t.x)[0]<0?t[1]-xA-vA:xA-t[1])}od.invert=od;var Sd=yd((function(){return!0}),(function(e){var t,n=NaN,r=NaN,i=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(s,a){var o=s>0?yA:-yA,l=MA(s-n);MA(l-yA)<vA?(e.point(n,r=(r+a)/2>0?xA:-xA),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(o,r),e.point(s,r),t=0):i!==o&&l>=yA&&(MA(n-i)<vA&&(n-=i*vA),MA(s-o)<vA&&(s-=o*vA),r=function(e,t,n,r){var i,s,a=DA(e-n);return MA(a)>vA?EA((DA(t)*(s=RA(r))*DA(n)-DA(r)*(i=RA(t))*DA(e))/(i*s*a)):(t+r)/2}(n,r,s,a),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(o,r),t=0),e.point(n=s,r=a),i=o},lineEnd:function(){e.lineEnd(),n=r=NaN},clean:function(){return 2-t}}}),(function(e,t,n,r){var i;if(null==e)i=n*xA,r.point(-yA,i),r.point(0,i),r.point(yA,i),r.point(yA,0),r.point(yA,-i),r.point(0,-i),r.point(-yA,-i),r.point(-yA,0),r.point(-yA,i);else if(MA(e[0]-t[0])>vA){var s=e[0]<t[0]?yA:-yA;i=n*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}),[-yA,-xA]);function Td(e){var t=RA(e),n=2*wA,r=t>0,i=MA(t)>vA;function s(e,n){return RA(e)*RA(n)>t}function a(e,n,r){var i=[1,0,0],s=mh(ph(e),ph(n)),a=fh(s,s),o=s[0],l=a-o*o;if(!l)return!r&&e;var u=t*a/l,c=-t*o/l,A=mh(i,s),h=vh(i,u);gh(h,vh(s,c));var d=A,p=fh(h,d),f=fh(d,d),m=p*p-f*(fh(h,h)-1);if(!(m<0)){var g=IA(m),v=vh(d,(-p-g)/f);if(gh(v,h),v=dh(v),!r)return v;var _,y=e[0],x=n[0],b=e[1],S=n[1];x<y&&(_=y,y=x,x=_);var T=x-y,w=MA(T-yA)<vA;if(!w&&S<b&&(_=b,b=S,S=_),w||T<vA?w?b+S>0^v[1]<(MA(v[0]-y)<vA?b:S):b<=v[1]&&v[1]<=S:T>yA^(y<=v[0]&&v[0]<=x)){var M=vh(d,(-p+g)/f);return gh(M,h),[v,dh(M)]}}}function o(t,n){var i=r?e:yA-e,s=0;return t<-i?s|=1:t>i&&(s|=2),n<-i?s|=4:n>i&&(s|=8),s}return yd(s,(function(e){var t,n,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(A,h){var d,p=[A,h],f=s(A,h),m=r?f?0:o(A,h):f?o(A+(A<0?yA:-yA),h):0;if(!t&&(u=l=f)&&e.lineStart(),f!==l&&(!(d=a(t,p))||pd(t,d)||pd(p,d))&&(p[2]=1),f!==l)c=0,f?(e.lineStart(),d=a(p,t),e.point(d[0],d[1])):(d=a(t,p),e.point(d[0],d[1],2),e.lineEnd()),t=d;else if(i&&t&&r^f){var g;m&n||!(g=a(p,t,!0))||(c=0,r?(e.lineStart(),e.point(g[0][0],g[0][1]),e.point(g[1][0],g[1][1]),e.lineEnd()):(e.point(g[1][0],g[1][1]),e.lineEnd(),e.lineStart(),e.point(g[0][0],g[0][1],3)))}!f||t&&pd(t,p)||e.point(p[0],p[1]),t=p,l=f,n=m},lineEnd:function(){l&&e.lineEnd(),t=null},clean:function(){return c|(u&&l)<<1}}}),(function(t,r,i,s){!function(e,t,n,r,i,s){if(n){var a=RA(t),o=DA(t),l=r*n;null==i?(i=t+r*SA,s=t-l/2):(i=hd(a,i),s=hd(a,s),(r>0?i<s:i>s)&&(i+=r*SA));for(var u,c=i;r>0?c>s:c<s;c-=l)u=dh([a,-o*RA(c),-o*DA(c)]),e.point(u[0],u[1])}}(s,e,n,i,t,r)}),r?[0,-e]:[-yA,e-yA])}var wd,Md,Ed,Cd,Rd=1e9,Nd=-Rd;function Pd(e,t,n,r){function i(i,s){return e<=i&&i<=n&&t<=s&&s<=r}function s(i,s,o,u){var c=0,A=0;if(null==i||(c=a(i,o))!==(A=a(s,o))||l(i,s)<0^o>0)do{u.point(0===c||3===c?e:n,c>1?r:t)}while((c=(c+o+4)%4)!==A);else u.point(s[0],s[1])}function a(r,i){return MA(r[0]-e)<vA?i>0?0:3:MA(r[0]-n)<vA?i>0?2:1:MA(r[1]-t)<vA?i>0?1:0:i>0?3:2}function o(e,t){return l(e.x,t.x)}function l(e,t){var n=a(e,1),r=a(t,1);return n!==r?n-r:0===n?t[1]-e[1]:1===n?e[0]-t[0]:2===n?e[1]-t[1]:t[0]-e[0]}return function(a){var l,u,c,A,h,d,p,f,m,g,v,_=a,y=dd(),x={point:b,lineStart:function(){x.point=S,u&&u.push(c=[]);g=!0,m=!1,p=f=NaN},lineEnd:function(){l&&(S(A,h),d&&m&&y.rejoin(),l.push(y.result()));x.point=b,m&&_.lineEnd()},polygonStart:function(){_=y,l=[],u=[],v=!0},polygonEnd:function(){var t=function(){for(var t=0,n=0,i=u.length;n<i;++n)for(var s,a,o=u[n],l=1,c=o.length,A=o[0],h=A[0],d=A[1];l<c;++l)s=h,a=d,h=(A=o[l])[0],d=A[1],a<=r?d>r&&(h-s)*(r-a)>(d-a)*(e-s)&&++t:d<=r&&(h-s)*(r-a)<(d-a)*(e-s)&&--t;return t}(),n=v&&t,i=(l=mA(l)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),s(null,null,1,a),a.lineEnd()),i&&md(l,o,t,s,a),a.polygonEnd());_=a,l=u=c=null}};function b(e,t){i(e,t)&&_.point(e,t)}function S(s,a){var o=i(s,a);if(u&&c.push([s,a]),g)A=s,h=a,d=o,g=!1,o&&(_.lineStart(),_.point(s,a));else if(o&&m)_.point(s,a);else{var l=[p=Math.max(Nd,Math.min(Rd,p)),f=Math.max(Nd,Math.min(Rd,f))],y=[s=Math.max(Nd,Math.min(Rd,s)),a=Math.max(Nd,Math.min(Rd,a))];!function(e,t,n,r,i,s){var a,o=e[0],l=e[1],u=0,c=1,A=t[0]-o,h=t[1]-l;if(a=n-o,A||!(a>0)){if(a/=A,A<0){if(a<u)return;a<c&&(c=a)}else if(A>0){if(a>c)return;a>u&&(u=a)}if(a=i-o,A||!(a<0)){if(a/=A,A<0){if(a>c)return;a>u&&(u=a)}else if(A>0){if(a<u)return;a<c&&(c=a)}if(a=r-l,h||!(a>0)){if(a/=h,h<0){if(a<u)return;a<c&&(c=a)}else if(h>0){if(a>c)return;a>u&&(u=a)}if(a=s-l,h||!(a<0)){if(a/=h,h<0){if(a>c)return;a>u&&(u=a)}else if(h>0){if(a<u)return;a<c&&(c=a)}return u>0&&(e[0]=o+u*A,e[1]=l+u*h),c<1&&(t[0]=o+c*A,t[1]=l+c*h),!0}}}}}(l,y,e,t,n,r)?o&&(_.lineStart(),_.point(s,a),v=!1):(m||(_.lineStart(),_.point(l[0],l[1])),_.point(y[0],y[1]),o||_.lineEnd(),v=!1)}p=s,f=a,m=o}return x}}var Dd={sphere:OA,point:OA,lineStart:function(){Dd.point=Id,Dd.lineEnd=Ld},lineEnd:OA,polygonStart:OA,polygonEnd:OA};function Ld(){Dd.point=Dd.lineEnd=OA}function Id(e,t){Md=e*=wA,Ed=DA(t*=wA),Cd=RA(t),Dd.point=Ud}function Ud(e,t){e*=wA;var n=DA(t*=wA),r=RA(t),i=MA(e-Md),s=RA(i),a=r*DA(i),o=Cd*n-Ed*r*s,l=Ed*n+Cd*r*s;wd.add(CA(IA(a*a+o*o),l)),Md=e,Ed=n,Cd=r}var Bd=[null,null],Od={type:"LineString",coordinates:Bd};function Fd(e,t){return Bd[0]=e,Bd[1]=t,function(e){return wd=new cA,VA(e,Dd),+wd}(Od)}var kd={Feature:function(e,t){return Gd(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)if(Gd(n[r].geometry,t))return!0;return!1}},qd={Sphere:function(){return!0},Point:function(e,t){return zd(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(zd(n[r],t))return!0;return!1},LineString:function(e,t){return Vd(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(Vd(n[r],t))return!0;return!1},Polygon:function(e,t){return Hd(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(Hd(n[r],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)if(Gd(n[r],t))return!0;return!1}};function Gd(e,t){return!(!e||!qd.hasOwnProperty(e.type))&&qd[e.type](e,t)}function zd(e,t){return 0===Fd(e,t)}function Vd(e,t){for(var n,r,i,s=0,a=e.length;s<a;s++){if(0===(r=Fd(e[s],t)))return!0;if(s>0&&(i=Fd(e[s],e[s-1]))>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))<_A*i)return!0;n=r}return!1}function Hd(e,t){return!!_d(e.map(jd),Wd(t))}function jd(e){return(e=e.map(Wd)).pop(),e}function Wd(e){return[e[0]*wA,e[1]*wA]}function Xd(e,t,n){var r=gA(e,t-vA,n).concat(t);return function(e){return r.map((function(t){return[e,t]}))}}function Qd(e,t,n){var r=gA(e,t-vA,n).concat(t);return function(e){return r.map((function(t){return[t,e]}))}}function Yd(){return function(){var e,t,n,r,i,s,a,o,l,u,c,A,h=10,d=h,p=90,f=360,m=2.5;function g(){return{type:"MultiLineString",coordinates:v()}}function v(){return gA(NA(r/p)*p,n,p).map(c).concat(gA(NA(o/f)*f,a,f).map(A)).concat(gA(NA(t/h)*h,e,h).filter((function(e){return MA(e%p)>vA})).map(l)).concat(gA(NA(s/d)*d,i,d).filter((function(e){return MA(e%f)>vA})).map(u))}return g.lines=function(){return v().map((function(e){return{type:"LineString",coordinates:e}}))},g.outline=function(){return{type:"Polygon",coordinates:[c(r).concat(A(a).slice(1),c(n).reverse().slice(1),A(o).reverse().slice(1))]}},g.extent=function(e){return arguments.length?g.extentMajor(e).extentMinor(e):g.extentMinor()},g.extentMajor=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],o=+e[0][1],a=+e[1][1],r>n&&(e=r,r=n,n=e),o>a&&(e=o,o=a,a=e),g.precision(m)):[[r,o],[n,a]]},g.extentMinor=function(n){return arguments.length?(t=+n[0][0],e=+n[1][0],s=+n[0][1],i=+n[1][1],t>e&&(n=t,t=e,e=n),s>i&&(n=s,s=i,i=n),g.precision(m)):[[t,s],[e,i]]},g.step=function(e){return arguments.length?g.stepMajor(e).stepMinor(e):g.stepMinor()},g.stepMajor=function(e){return arguments.length?(p=+e[0],f=+e[1],g):[p,f]},g.stepMinor=function(e){return arguments.length?(h=+e[0],d=+e[1],g):[h,d]},g.precision=function(h){return arguments.length?(m=+h,l=Xd(s,i,90),u=Qd(t,e,m),c=Xd(o,a,90),A=Qd(r,n,m),g):m},g.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}()()}function $d(e,t){var n=e[0]*wA,r=e[1]*wA,i=t[0]*wA,s=t[1]*wA,a=RA(r),o=DA(r),l=RA(s),u=DA(s),c=a*RA(n),A=a*DA(n),h=l*RA(i),d=l*DA(i),p=2*UA(IA(BA(s-r)+a*l*BA(i-n))),f=DA(p),m=p?function(e){var t=DA(e*=p)/f,n=DA(p-e)/f,r=n*c+t*h,i=n*A+t*d,s=n*o+t*u;return[CA(i,r)*TA,CA(s,IA(r*r+i*i))*TA]}:function(){return[n*TA,r*TA]};return m.distance=p,m}var Kd=e=>e,Zd=1/0,Jd=Zd,ep=-Zd,tp=ep,np={point:function(e,t){e<Zd&&(Zd=e);e>ep&&(ep=e);t<Jd&&(Jd=t);t>tp&&(tp=t)},lineStart:OA,lineEnd:OA,polygonStart:OA,polygonEnd:OA,result:function(){var e=[[Zd,Jd],[ep,tp]];return ep=tp=-(Jd=Zd=1/0),e}};function rp(e){return function(t){var n=new ip;for(var r in e)n[r]=e[r];return n.stream=t,n}}function ip(){}function sp(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=r&&e.clipExtent(null),VA(n,e.stream(np)),t(np.result()),null!=r&&e.clipExtent(r),e}function ap(e,t,n){return sp(e,(function(n){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],s=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+t[0][0]+(r-s*(n[1][0]+n[0][0]))/2,o=+t[0][1]+(i-s*(n[1][1]+n[0][1]))/2;e.scale(150*s).translate([a,o])}),n)}ip.prototype={constructor:ip,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var op=RA(30*wA);function lp(e,t){return+t?function(e,t){function n(r,i,s,a,o,l,u,c,A,h,d,p,f,m){var g=u-r,v=c-i,_=g*g+v*v;if(_>4*t&&f--){var y=a+h,x=o+d,b=l+p,S=IA(y*y+x*x+b*b),T=UA(b/=S),w=MA(MA(b)-1)<vA||MA(s-A)<vA?(s+A)/2:CA(x,y),M=e(w,T),E=M[0],C=M[1],R=E-r,N=C-i,P=v*R-g*N;(P*P/_>t||MA((g*R+v*N)/_-.5)>.3||a*h+o*d+l*p<op)&&(n(r,i,s,a,o,l,E,C,w,y/=S,x/=S,b,f,m),m.point(E,C),n(E,C,w,y,x,b,u,c,A,h,d,p,f,m))}}return function(t){var r,i,s,a,o,l,u,c,A,h,d,p,f={point:m,lineStart:g,lineEnd:_,polygonStart:function(){t.polygonStart(),f.lineStart=y},polygonEnd:function(){t.polygonEnd(),f.lineStart=g}};function m(n,r){n=e(n,r),t.point(n[0],n[1])}function g(){c=NaN,f.point=v,t.lineStart()}function v(r,i){var s=ph([r,i]),a=e(r,i);n(c,A,u,h,d,p,c=a[0],A=a[1],u=r,h=s[0],d=s[1],p=s[2],16,t),t.point(c,A)}function _(){f.point=m,t.lineEnd()}function y(){g(),f.point=x,f.lineEnd=b}function x(e,t){v(r=e,t),i=c,s=A,a=h,o=d,l=p,f.point=v}function b(){n(c,A,u,h,d,p,i,s,r,a,o,l,16,t),f.lineEnd=_,_()}return f}}(e,t):function(e){return rp({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}(e)}var up=rp({point:function(e,t){this.stream.point(e*wA,t*wA)}});function cp(e,t,n,r,i,s){if(!s)return function(e,t,n,r,i){function s(s,a){return[t+e*(s*=r),n-e*(a*=i)]}return s.invert=function(s,a){return[(s-t)/e*r,(n-a)/e*i]},s}(e,t,n,r,i);var a=RA(s),o=DA(s),l=a*e,u=o*e,c=a/e,A=o/e,h=(o*n-a*t)/e,d=(o*t+a*n)/e;function p(e,s){return[l*(e*=r)-u*(s*=i)+t,n-u*e-l*s]}return p.invert=function(e,t){return[r*(c*e-A*t+h),i*(d-A*e-c*t)]},p}function Ap(e){return function(e){var t,n,r,i,s,a,o,l,u,c,A=150,h=480,d=250,p=0,f=0,m=0,g=0,v=0,_=0,y=1,x=1,b=null,S=Sd,T=null,w=Kd,M=.5;function E(e){return l(e[0]*wA,e[1]*wA)}function C(e){return(e=l.invert(e[0],e[1]))&&[e[0]*TA,e[1]*TA]}function R(){var e=cp(A,0,0,y,x,_).apply(null,t(p,f)),r=cp(A,h-e[0],d-e[1],y,x,_);return n=ld(m,g,v),o=ad(t,r),l=ad(n,o),a=lp(o,M),N()}function N(){return u=c=null,E}return E.stream=function(e){return u&&c===e?u:u=up(function(e){return rp({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}(n)(S(a(w(c=e)))))},E.preclip=function(e){return arguments.length?(S=e,b=void 0,N()):S},E.postclip=function(e){return arguments.length?(w=e,T=r=i=s=null,N()):w},E.clipAngle=function(e){return arguments.length?(S=+e?Td(b=e*wA):(b=null,Sd),N()):b*TA},E.clipExtent=function(e){return arguments.length?(w=null==e?(T=r=i=s=null,Kd):Pd(T=+e[0][0],r=+e[0][1],i=+e[1][0],s=+e[1][1]),N()):null==T?null:[[T,r],[i,s]]},E.scale=function(e){return arguments.length?(A=+e,R()):A},E.translate=function(e){return arguments.length?(h=+e[0],d=+e[1],R()):[h,d]},E.center=function(e){return arguments.length?(p=e[0]%360*wA,f=e[1]%360*wA,R()):[p*TA,f*TA]},E.rotate=function(e){return arguments.length?(m=e[0]%360*wA,g=e[1]%360*wA,v=e.length>2?e[2]%360*wA:0,R()):[m*TA,g*TA,v*TA]},E.angle=function(e){return arguments.length?(_=e%360*wA,R()):_*TA},E.reflectX=function(e){return arguments.length?(y=e?-1:1,R()):y<0},E.reflectY=function(e){return arguments.length?(x=e?-1:1,R()):x<0},E.precision=function(e){return arguments.length?(a=lp(o,M=e*e),N()):IA(M)},E.fitExtent=function(e,t){return ap(E,e,t)},E.fitSize=function(e,t){return function(e,t,n){return ap(e,[[0,0],t],n)}(E,e,t)},E.fitWidth=function(e,t){return function(e,t,n){return sp(e,(function(n){var r=+t,i=r/(n[1][0]-n[0][0]),s=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];e.scale(150*i).translate([s,a])}),n)}(E,e,t)},E.fitHeight=function(e,t){return function(e,t,n){return sp(e,(function(n){var r=+t,i=r/(n[1][1]-n[0][1]),s=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;e.scale(150*i).translate([s,a])}),n)}(E,e,t)},function(){return t=e.apply(this,arguments),E.invert=t.invert&&C,R()}}((function(){return e}))()}function hp(e,t){var n=RA(t),r=1+RA(e)*n;return[n*DA(e)/r,DA(t)/r]}function dp(){return Ap(hp).scale(250).clipAngle(142)}function pp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function fp(e,t,n){return t=mp(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,gp()?Reflect.construct(t,[],mp(e).constructor):t.apply(e,n))}function mp(e){return mp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},mp(e)}function gp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gp=function(){return!!e})()}function vp(e,t){return vp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},vp(e,t)}function _p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}(e,t)||yp(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yp(e,t){if(e){if("string"==typeof e)return pp(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pp(e,t):void 0}}hp.invert=function(e){return function(t,n){var r=IA(t*t+n*n),i=e(r),s=DA(i),a=RA(i);return[CA(t*s,r*a),UA(r&&n*s/r)]}}((function(e){return 2*EA(e)}));var xp=function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,t=[],n=null;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(r){if(n){var i=180*Fd(r,n)/Math.PI;if(i>e)for(var s=$d(n,r),a=1/Math.ceil(i/e),o=a;o<1;)t.push(s(o)),o+=a}t.push(n=r)})),t},bp="undefined"!=typeof window&&window.THREE?window.THREE:{BufferGeometry:Zr,Float32BufferAttribute:Hr},Sp=(new bp.BufferGeometry).setAttribute?"setAttribute":"addAttribute",Tp=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=fp(this,t)).type="GeoJsonGeometry",n.parameters={geoJson:e,radius:r,resolution:i};var s=({Point:u,MultiPoint:function(e,t){var n={vertices:[],indices:[]};return e.map((function(e){return u(e,t)})).forEach((function(e){var t=_p(e,1)[0];wp(n,t)})),[n]},LineString:c,MultiLineString:function(e,t){var n={vertices:[],indices:[]};return e.map((function(e){return c(e,t)})).forEach((function(e){var t=_p(e,1)[0];wp(n,t)})),[n]},Polygon:A,MultiPolygon:function(e,t){var n={vertices:[],indices:[]},r={vertices:[],indices:[]};e.map((function(e){return A(e,t)})).forEach((function(e){var t=_p(e,2),i=t[0],s=t[1];wp(n,i),s&&wp(r,s)}));var i=[n];return r.vertices.length&&i.push(r),i}}[e.type]||function(){return[]})(e.coordinates,r),a=[],o=[],l=0;function u(e,t){return[{vertices:Ep(e[1],e[0],t),indices:[]}]}function c(e,t){for(var n=rA([xp(e,i).map((function(e){var n=_p(e,2),r=n[0];return Ep(n[1],r,t)}))]).vertices,r=Math.round(n.length/3),s=[],a=1;a<r;a++)s.push(a-1,a);return[{vertices:n,indices:s}]}function A(e,t){for(var n=rA(e.map((function(e){return xp(e,i).map((function(e){var n=_p(e,2),r=n[0];return Ep(n[1],r,t)}))}))),r=n.vertices,s=n.holes,a=s[0]||1/0,o=r.slice(0,3*a),l=r.slice(3*a),u=new Set(s),c=Math.round(r.length/3),A=[],h=[],d=1;d<c;d++)u.has(d)||(d<a?A.push(d-1,d):h.push(d-1-a,d-a));var p=[{indices:A,vertices:o}];return s.length&&p.push({indices:h,vertices:l}),p}return s.forEach((function(e){var t=a.length;wp({indices:a,vertices:o},e),n.addGroup(t,a.length-t,l++)})),a.length&&n.setIndex(a),o.length&&n[Sp]("position",new bp.Float32BufferAttribute(o,3)),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vp(e,t)}(t,e),n=t,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(bp.BufferGeometry);function wp(e,t){var n=Math.round(e.vertices.length/3);Mp(e.vertices,t.vertices),Mp(e.indices,t.indices.map((function(e){return e+n})))}function Mp(e,t){var n,r=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=yp(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){o=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(o)throw s}}}}(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;e.push(i)}}catch(e){r.e(e)}finally{r.f()}}function Ep(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(90-e)*Math.PI/180,i=(90-t)*Math.PI/180;return[n*Math.sin(r)*Math.cos(i),n*Math.cos(r),n*Math.sin(r)*Math.sin(i)]}function Cp(e){let t,n,r,i=-1,s=0;for(let a=0;a<e.length;++a){const o=e[a];if(void 0===t&&(t=o.array.constructor),t!==o.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(void 0===n&&(n=o.itemSize),n!==o.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(void 0===r&&(r=o.normalized),r!==o.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(-1===i&&(i=o.gpuType),i!==o.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;s+=o.count*n}const a=new t(s),o=new qr(a,n,r);let l=0;for(let t=0;t<e.length;++t){const r=e[t];if(r.isInterleavedBufferAttribute){const e=l/n;for(let t=0,i=r.count;t<i;t++)for(let i=0;i<n;i++){const n=r.getComponent(t,i);o.setComponent(t+e,i,n)}}else a.set(r.array,l);l+=r.count*n}return void 0!==i&&(o.gpuType=i),o}function Rp(e){const t=e.data.array.constructor,n=e.count,r=e.itemSize,i=e.normalized,s=new t(n*r);let a;a=e.isInstancedInterleavedBufferAttribute?new Li(s,r,i,e.meshPerAttribute):new qr(s,r,i);for(let t=0;t<n;t++)a.setX(t,e.getX(t)),r>=2&&a.setY(t,e.getY(t)),r>=3&&a.setZ(t,e.getZ(t)),r>=4&&a.setW(t,e.getW(t));return a}var Np=Object.freeze({__proto__:null,computeMikkTSpaceTangents:function(e,t,n=!0){if(!t||!t.isReady)throw new Error("BufferGeometryUtils: Initialized MikkTSpace library required.");if(!e.hasAttribute("position")||!e.hasAttribute("normal")||!e.hasAttribute("uv"))throw new Error('BufferGeometryUtils: Tangents require "position", "normal", and "uv" attributes.');function r(e){if(e.normalized||e.isInterleavedBufferAttribute){const t=new Float32Array(e.count*e.itemSize);for(let n=0,r=0;n<e.count;n++)t[r++]=e.getX(n),t[r++]=e.getY(n),e.itemSize>2&&(t[r++]=e.getZ(n));return t}return e.array instanceof Float32Array?e.array:new Float32Array(e.array)}const i=e.index?e.toNonIndexed():e,s=t.generateTangents(r(i.attributes.position),r(i.attributes.normal),r(i.attributes.uv));if(n)for(let e=3;e<s.length;e+=4)s[e]*=-1;return i.setAttribute("tangent",new qr(s,4)),e!==i&&e.copy(i),e},computeMorphedAttributes:function(e){const t=new on,n=new on,r=new on,i=new on,s=new on,a=new on,o=new on,l=new on,u=new on;function c(e,c,A,h,d,p,f,m){t.fromBufferAttribute(c,d),n.fromBufferAttribute(c,p),r.fromBufferAttribute(c,f);const g=e.morphTargetInfluences;if(A&&g){o.set(0,0,0),l.set(0,0,0),u.set(0,0,0);for(let e=0,c=A.length;e<c;e++){const c=g[e],m=A[e];0!==c&&(i.fromBufferAttribute(m,d),s.fromBufferAttribute(m,p),a.fromBufferAttribute(m,f),h?(o.addScaledVector(i,c),l.addScaledVector(s,c),u.addScaledVector(a,c)):(o.addScaledVector(i.sub(t),c),l.addScaledVector(s.sub(n),c),u.addScaledVector(a.sub(r),c)))}t.add(o),n.add(l),r.add(u)}e.isSkinnedMesh&&(e.applyBoneTransform(d,t),e.applyBoneTransform(p,n),e.applyBoneTransform(f,r)),m[3*d+0]=t.x,m[3*d+1]=t.y,m[3*d+2]=t.z,m[3*p+0]=n.x,m[3*p+1]=n.y,m[3*p+2]=n.z,m[3*f+0]=r.x,m[3*f+1]=r.y,m[3*f+2]=r.z}const A=e.geometry,h=e.material;let d,p,f;const m=A.index,g=A.attributes.position,v=A.morphAttributes.position,_=A.morphTargetsRelative,y=A.attributes.normal,x=A.morphAttributes.position,b=A.groups,S=A.drawRange;let T,w,M,E,C,R,N;const P=new Float32Array(g.count*g.itemSize),D=new Float32Array(y.count*y.itemSize);if(null!==m)if(Array.isArray(h))for(T=0,M=b.length;T<M;T++)for(C=b[T],R=Math.max(C.start,S.start),N=Math.min(C.start+C.count,S.start+S.count),w=R,E=N;w<E;w+=3)d=m.getX(w),p=m.getX(w+1),f=m.getX(w+2),c(e,g,v,_,d,p,f,P),c(e,y,x,_,d,p,f,D);else for(R=Math.max(0,S.start),N=Math.min(m.count,S.start+S.count),T=R,M=N;T<M;T+=3)d=m.getX(T),p=m.getX(T+1),f=m.getX(T+2),c(e,g,v,_,d,p,f,P),c(e,y,x,_,d,p,f,D);else if(Array.isArray(h))for(T=0,M=b.length;T<M;T++)for(C=b[T],R=Math.max(C.start,S.start),N=Math.min(C.start+C.count,S.start+S.count),w=R,E=N;w<E;w+=3)d=w,p=w+1,f=w+2,c(e,g,v,_,d,p,f,P),c(e,y,x,_,d,p,f,D);else for(R=Math.max(0,S.start),N=Math.min(g.count,S.start+S.count),T=R,M=N;T<M;T+=3)d=T,p=T+1,f=T+2,c(e,g,v,_,d,p,f,P),c(e,y,x,_,d,p,f,D);return{positionAttribute:g,normalAttribute:y,morphedPositionAttribute:new Hr(P,3),morphedNormalAttribute:new Hr(D,3)}},deepCloneAttribute:function(e){return e.isInstancedInterleavedBufferAttribute||e.isInterleavedBufferAttribute?Rp(e):e.isInstancedBufferAttribute?(new Li).copy(e):(new qr).copy(e)},deinterleaveAttribute:Rp,deinterleaveGeometry:function(e){const t=e.attributes,n=e.morphTargets,r=new Map;for(const e in t){const n=t[e];n.isInterleavedBufferAttribute&&(r.has(n)||r.set(n,Rp(n)),t[e]=r.get(n))}for(const e in n){const t=n[e];t.isInterleavedBufferAttribute&&(r.has(t)||r.set(t,Rp(t)),n[e]=r.get(t))}},estimateBytesUsed:function(e){let t=0;for(const n in e.attributes){const r=e.getAttribute(n);t+=r.count*r.itemSize*r.array.BYTES_PER_ELEMENT}const n=e.getIndex();return t+=n?n.count*n.itemSize*n.array.BYTES_PER_ELEMENT:0,t},interleaveAttributes:function(e){let t,n=0,r=0;for(let i=0,s=e.length;i<s;++i){const s=e[i];if(void 0===t&&(t=s.array.constructor),t!==s.array.constructor)return console.error("AttributeBuffers of different types cannot be interleaved"),null;n+=s.array.length,r+=s.itemSize}const i=new Ci(new t(n),r);let s=0;const a=[],o=["getX","getY","getZ","getW"],l=["setX","setY","setZ","setW"];for(let t=0,n=e.length;t<n;t++){const n=e[t],r=n.itemSize,u=n.count,c=new Ni(i,r,s,n.normalized);a.push(c),s+=r;for(let e=0;e<u;e++)for(let t=0;t<r;t++)c[l[t]](e,n[o[t]](e))}return a},mergeAttributes:Cp,mergeGeometries:function(e,t=!1){const n=null!==e[0].index,r=new Set(Object.keys(e[0].attributes)),i=new Set(Object.keys(e[0].morphAttributes)),s={},a={},o=e[0].morphTargetsRelative,l=new Zr;let u=0;for(let c=0;c<e.length;++c){const A=e[c];let h=0;if(n!==(null!==A.index))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(const e in A.attributes){if(!r.has(e))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+'. All geometries must have compatible attributes; make sure "'+e+'" attribute exists among all geometries, or in none of them.'),null;void 0===s[e]&&(s[e]=[]),s[e].push(A.attributes[e]),h++}if(h!==r.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". Make sure all geometries have the same number of attributes."),null;if(o!==A.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(const e in A.morphAttributes){if(!i.has(e))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". .morphAttributes must be consistent throughout all geometries."),null;void 0===a[e]&&(a[e]=[]),a[e].push(A.morphAttributes[e])}if(t){let e;if(n)e=A.index.count;else{if(void 0===A.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". The geometry must have either an index or a position attribute"),null;e=A.attributes.position.count}l.addGroup(u,e,c),u+=e}}if(n){let t=0;const n=[];for(let r=0;r<e.length;++r){const i=e[r].index;for(let e=0;e<i.count;++e)n.push(i.getX(e)+t);t+=e[r].attributes.position.count}l.setIndex(n)}for(const e in s){const t=Cp(s[e]);if(!t)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+e+" attribute."),null;l.setAttribute(e,t)}for(const e in a){const t=a[e][0].length;if(0===t)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[e]=[];for(let n=0;n<t;++n){const t=[];for(let r=0;r<a[e].length;++r)t.push(a[e][r][n]);const r=Cp(t);if(!r)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+e+" morphAttribute."),null;l.morphAttributes[e].push(r)}}return l},mergeGroups:function(e){if(0===e.groups.length)return console.warn("THREE.BufferGeometryUtils.mergeGroups(): No groups are defined. Nothing to merge."),e;let t=e.groups;if(t=t.sort(((e,t)=>e.materialIndex!==t.materialIndex?e.materialIndex-t.materialIndex:e.start-t.start)),null===e.getIndex()){const t=e.getAttribute("position"),n=[];for(let e=0;e<t.count;e+=3)n.push(e,e+1,e+2);e.setIndex(n)}const n=e.getIndex(),r=[];for(let e=0;e<t.length;e++){const i=t[e],s=i.start,a=s+i.count;for(let e=s;e<a;e++)r.push(n.getX(e))}e.dispose(),e.setIndex(r);let i=0;for(let e=0;e<t.length;e++){const n=t[e];n.start=i,i+=n.count}let s=t[0];e.groups=[s];for(let n=1;n<t.length;n++){const r=t[n];s.materialIndex===r.materialIndex?s.count+=r.count:(s=r,e.groups.push(s))}return e},mergeVertices:function(e,t=1e-4){t=Math.max(t,Number.EPSILON);const n={},r=e.getIndex(),i=e.getAttribute("position"),s=r?r.count:i.count;let a=0;const o=Object.keys(e.attributes),l={},u={},c=[],A=["getX","getY","getZ","getW"],h=["setX","setY","setZ","setW"];for(let t=0,n=o.length;t<n;t++){const n=o[t],r=e.attributes[n];l[n]=new r.constructor(new r.array.constructor(r.count*r.itemSize),r.itemSize,r.normalized);const i=e.morphAttributes[n];i&&(u[n]||(u[n]=[]),i.forEach(((e,t)=>{const r=new e.array.constructor(e.count*e.itemSize);u[n][t]=new e.constructor(r,e.itemSize,e.normalized)})))}const d=.5*t,p=Math.log10(1/t),f=Math.pow(10,p),m=d*f;for(let t=0;t<s;t++){const i=r?r.getX(t):t;let s="";for(let t=0,n=o.length;t<n;t++){const n=o[t],r=e.getAttribute(n),a=r.itemSize;for(let e=0;e<a;e++)s+=~~(r[A[e]](i)*f+m)+","}if(s in n)c.push(n[s]);else{for(let t=0,n=o.length;t<n;t++){const n=o[t],r=e.getAttribute(n),s=e.morphAttributes[n],c=r.itemSize,d=l[n],p=u[n];for(let e=0;e<c;e++){const t=A[e],n=h[e];if(d[n](a,r[t](i)),s)for(let e=0,r=s.length;e<r;e++)p[e][n](a,s[e][t](i))}}n[s]=a,c.push(a),a++}}const g=e.clone();for(const t in e.attributes){const e=l[t];if(g.setAttribute(t,new e.constructor(e.array.slice(0,a*e.itemSize),e.itemSize,e.normalized)),t in u)for(let e=0;e<u[t].length;e++){const n=u[t][e];g.morphAttributes[t][e]=new n.constructor(n.array.slice(0,a*n.itemSize),n.itemSize,n.normalized)}}return g.setIndex(c),g},toCreasedNormals:function(e,t=Math.PI/3){const n=Math.cos(t),r=100*(1+1e-10),i=[new on,new on,new on],s=new on,a=new on,o=new on,l=new on;function u(e){return`${~~(e.x*r)},${~~(e.y*r)},${~~(e.z*r)}`}const c=e.index?e.toNonIndexed():e,A=c.attributes.position,h={};for(let e=0,t=A.count/3;e<t;e++){const t=3*e,n=i[0].fromBufferAttribute(A,t+0),r=i[1].fromBufferAttribute(A,t+1),o=i[2].fromBufferAttribute(A,t+2);s.subVectors(o,r),a.subVectors(n,r);const l=(new on).crossVectors(s,a).normalize();for(let e=0;e<3;e++){const t=u(i[e]);t in h||(h[t]=[]),h[t].push(l)}}const d=new Float32Array(3*A.count),p=new qr(d,3,!1);for(let e=0,t=A.count/3;e<t;e++){const t=3*e,r=i[0].fromBufferAttribute(A,t+0),c=i[1].fromBufferAttribute(A,t+1),d=i[2].fromBufferAttribute(A,t+2);s.subVectors(d,c),a.subVectors(r,c),o.crossVectors(s,a).normalize();for(let e=0;e<3;e++){const r=h[u(i[e])];l.set(0,0,0);for(let e=0,t=r.length;e<t;e++){const t=r[e];o.dot(t)>n&&l.add(t)}l.normalize(),p.setXYZ(t+e,l.x,l.y,l.z)}}return c.setAttribute("normal",p),c},toTrianglesDrawMode:function(e,t){if(0===t)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(2===t||1===t){let n=e.getIndex();if(null===n){const t=[],r=e.getAttribute("position");if(void 0===r)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e<r.count;e++)t.push(e);e.setIndex(t),n=e.getIndex()}const r=n.count-2,i=[];if(2===t)for(let e=1;e<=r;e++)i.push(n.getX(0)),i.push(n.getX(e)),i.push(n.getX(e+1));else for(let e=0;e<r;e++)e%2==0?(i.push(n.getX(e)),i.push(n.getX(e+1)),i.push(n.getX(e+2))):(i.push(n.getX(e+2)),i.push(n.getX(e+1)),i.push(n.getX(e)));i.length/3!==r&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=e.clone();return s.setIndex(i),s.clearGroups(),s}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e}}),Pp=function(e){return"function"==typeof e?e:"string"==typeof e?function(t){return t[e]}:function(t){return e}};function Dp(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Lp(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ip(){}var Up=.7,Bp=1/Up,Op="\\s*([+-]?\\d+)\\s*",Fp="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",kp="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",qp=/^#([0-9a-f]{3,8})$/,Gp=new RegExp(`^rgb\\(${Op},${Op},${Op}\\)$`),zp=new RegExp(`^rgb\\(${kp},${kp},${kp}\\)$`),Vp=new RegExp(`^rgba\\(${Op},${Op},${Op},${Fp}\\)$`),Hp=new RegExp(`^rgba\\(${kp},${kp},${kp},${Fp}\\)$`),jp=new RegExp(`^hsl\\(${Fp},${kp},${kp}\\)$`),Wp=new RegExp(`^hsla\\(${Fp},${kp},${kp},${Fp}\\)$`),Xp={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Qp(){return this.rgb().formatHex()}function Yp(){return this.rgb().formatRgb()}function $p(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=qp.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Kp(t):3===n?new ef(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Zp(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Zp(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Gp.exec(e))?new ef(t[1],t[2],t[3],1):(t=zp.exec(e))?new ef(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Vp.exec(e))?Zp(t[1],t[2],t[3],t[4]):(t=Hp.exec(e))?Zp(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=jp.exec(e))?of(t[1],t[2]/100,t[3]/100,1):(t=Wp.exec(e))?of(t[1],t[2]/100,t[3]/100,t[4]):Xp.hasOwnProperty(e)?Kp(Xp[e]):"transparent"===e?new ef(NaN,NaN,NaN,0):null}function Kp(e){return new ef(e>>16&255,e>>8&255,255&e,1)}function Zp(e,t,n,r){return r<=0&&(e=t=n=NaN),new ef(e,t,n,r)}function Jp(e,t,n,r){return 1===arguments.length?((i=e)instanceof Ip||(i=$p(i)),i?new ef((i=i.rgb()).r,i.g,i.b,i.opacity):new ef):new ef(e,t,n,null==r?1:r);var i}function ef(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function tf(){return`#${af(this.r)}${af(this.g)}${af(this.b)}`}function nf(){const e=rf(this.opacity);return`${1===e?"rgb(":"rgba("}${sf(this.r)}, ${sf(this.g)}, ${sf(this.b)}${1===e?")":`, ${e})`}`}function rf(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function sf(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function af(e){return((e=sf(e))<16?"0":"")+e.toString(16)}function of(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new uf(e,t,n,r)}function lf(e){if(e instanceof uf)return new uf(e.h,e.s,e.l,e.opacity);if(e instanceof Ip||(e=$p(e)),!e)return new uf;if(e instanceof uf)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),a=NaN,o=s-i,l=(s+i)/2;return o?(a=t===s?(n-r)/o+6*(n<r):n===s?(r-t)/o+2:(t-n)/o+4,o/=l<.5?s+i:2-s-i,a*=60):o=l>0&&l<1?0:a,new uf(a,o,l,e.opacity)}function uf(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function cf(e){return(e=(e||0)%360)<0?e+360:e}function Af(e){return Math.max(0,Math.min(1,e||0))}function hf(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function df(e){return df="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},df(e)}Dp(Ip,$p,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Qp,formatHex:Qp,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return lf(this).formatHsl()},formatRgb:Yp,toString:Yp}),Dp(ef,Jp,Lp(Ip,{brighter(e){return e=null==e?Bp:Math.pow(Bp,e),new ef(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Up:Math.pow(Up,e),new ef(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ef(sf(this.r),sf(this.g),sf(this.b),rf(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:tf,formatHex:tf,formatHex8:function(){return`#${af(this.r)}${af(this.g)}${af(this.b)}${af(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:nf,toString:nf})),Dp(uf,(function(e,t,n,r){return 1===arguments.length?lf(e):new uf(e,t,n,null==r?1:r)}),Lp(Ip,{brighter(e){return e=null==e?Bp:Math.pow(Bp,e),new uf(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Up:Math.pow(Up,e),new uf(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ef(hf(e>=240?e-240:e+120,i,r),hf(e,i,r),hf(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new uf(cf(this.h),Af(this.s),Af(this.l),rf(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=rf(this.opacity);return`${1===e?"hsl(":"hsla("}${cf(this.h)}, ${100*Af(this.s)}%, ${100*Af(this.l)}%${1===e?")":`, ${e})`}`}}));var pf=/^\s+/,ff=/\s+$/;function mf(e,t){if(t=t||{},(e=e||"")instanceof mf)return e;if(!(this instanceof mf))return new mf(e,t);var n=function(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,s=null,a=!1,o=!1;"string"==typeof e&&(e=function(e){e=e.replace(pf,"").replace(ff,"").toLowerCase();var t,n=!1;if(Lf[e])e=Lf[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=Wf.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=Wf.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=Wf.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=Wf.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=Wf.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=Wf.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=Wf.hex8.exec(e))return{r:Ff(t[1]),g:Ff(t[2]),b:Ff(t[3]),a:zf(t[4]),format:n?"name":"hex8"};if(t=Wf.hex6.exec(e))return{r:Ff(t[1]),g:Ff(t[2]),b:Ff(t[3]),format:n?"name":"hex"};if(t=Wf.hex4.exec(e))return{r:Ff(t[1]+""+t[1]),g:Ff(t[2]+""+t[2]),b:Ff(t[3]+""+t[3]),a:zf(t[4]+""+t[4]),format:n?"name":"hex8"};if(t=Wf.hex3.exec(e))return{r:Ff(t[1]+""+t[1]),g:Ff(t[2]+""+t[2]),b:Ff(t[3]+""+t[3]),format:n?"name":"hex"};return!1}(e));"object"==df(e)&&(Xf(e.r)&&Xf(e.g)&&Xf(e.b)?(l=e.r,u=e.g,c=e.b,t={r:255*Bf(l,255),g:255*Bf(u,255),b:255*Bf(c,255)},a=!0,o="%"===String(e.r).substr(-1)?"prgb":"rgb"):Xf(e.h)&&Xf(e.s)&&Xf(e.v)?(r=qf(e.s),i=qf(e.v),t=function(e,t,n){e=6*Bf(e,360),t=Bf(t,100),n=Bf(n,100);var r=Math.floor(e),i=e-r,s=n*(1-t),a=n*(1-i*t),o=n*(1-(1-i)*t),l=r%6,u=[n,a,s,s,o,n][l],c=[o,n,n,a,s,s][l],A=[s,s,o,n,n,a][l];return{r:255*u,g:255*c,b:255*A}}(e.h,r,i),a=!0,o="hsv"):Xf(e.h)&&Xf(e.s)&&Xf(e.l)&&(r=qf(e.s),s=qf(e.l),t=function(e,t,n){var r,i,s;function a(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=Bf(e,360),t=Bf(t,100),n=Bf(n,100),0===t)r=i=s=n;else{var o=n<.5?n*(1+t):n+t-n*t,l=2*n-o;r=a(l,o,e+1/3),i=a(l,o,e),s=a(l,o,e-1/3)}return{r:255*r,g:255*i,b:255*s}}(e.h,r,s),a=!0,o="hsl"),e.hasOwnProperty("a")&&(n=e.a));var l,u,c;return n=Uf(n),{ok:a,format:e.format||o,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function gf(e,t,n){e=Bf(e,255),t=Bf(t,255),n=Bf(n,255);var r,i,s=Math.max(e,t,n),a=Math.min(e,t,n),o=(s+a)/2;if(s==a)r=i=0;else{var l=s-a;switch(i=o>.5?l/(2-s-a):l/(s+a),s){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return{h:r,s:i,l:o}}function vf(e,t,n){e=Bf(e,255),t=Bf(t,255),n=Bf(n,255);var r,i,s=Math.max(e,t,n),a=Math.min(e,t,n),o=s,l=s-a;if(i=0===s?0:l/s,s==a)r=0;else{switch(s){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return{h:r,s:i,v:o}}function _f(e,t,n,r){var i=[kf(Math.round(e).toString(16)),kf(Math.round(t).toString(16)),kf(Math.round(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function yf(e,t,n,r){return[kf(Gf(r)),kf(Math.round(e).toString(16)),kf(Math.round(t).toString(16)),kf(Math.round(n).toString(16))].join("")}function xf(e,t){t=0===t?0:t||10;var n=mf(e).toHsl();return n.s-=t/100,n.s=Of(n.s),mf(n)}function bf(e,t){t=0===t?0:t||10;var n=mf(e).toHsl();return n.s+=t/100,n.s=Of(n.s),mf(n)}function Sf(e){return mf(e).desaturate(100)}function Tf(e,t){t=0===t?0:t||10;var n=mf(e).toHsl();return n.l+=t/100,n.l=Of(n.l),mf(n)}function wf(e,t){t=0===t?0:t||10;var n=mf(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-t/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-t/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-t/100*255))),mf(n)}function Mf(e,t){t=0===t?0:t||10;var n=mf(e).toHsl();return n.l-=t/100,n.l=Of(n.l),mf(n)}function Ef(e,t){var n=mf(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,mf(n)}function Cf(e){var t=mf(e).toHsl();return t.h=(t.h+180)%360,mf(t)}function Rf(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=mf(e).toHsl(),r=[mf(e)],i=360/t,s=1;s<t;s++)r.push(mf({h:(n.h+s*i)%360,s:n.s,l:n.l}));return r}function Nf(e){var t=mf(e).toHsl(),n=t.h;return[mf(e),mf({h:(n+72)%360,s:t.s,l:t.l}),mf({h:(n+216)%360,s:t.s,l:t.l})]}function Pf(e,t,n){t=t||6,n=n||30;var r=mf(e).toHsl(),i=360/n,s=[mf(e)];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,s.push(mf(r));return s}function Df(e,t){t=t||6;for(var n=mf(e).toHsv(),r=n.h,i=n.s,s=n.v,a=[],o=1/t;t--;)a.push(mf({h:r,s:i,v:s})),s=(s+o)%1;return a}mf.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,r=this.toRgb();return e=r.r/255,t=r.g/255,n=r.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=Uf(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=vf(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=vf(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=gf(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=gf(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return _f(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,r,i){var s=[kf(Math.round(e).toString(16)),kf(Math.round(t).toString(16)),kf(Math.round(n).toString(16)),kf(Gf(r))];if(i&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1))return s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0);return s.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*Bf(this._r,255))+"%",g:Math.round(100*Bf(this._g,255))+"%",b:Math.round(100*Bf(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*Bf(this._r,255))+"%, "+Math.round(100*Bf(this._g,255))+"%, "+Math.round(100*Bf(this._b,255))+"%)":"rgba("+Math.round(100*Bf(this._r,255))+"%, "+Math.round(100*Bf(this._g,255))+"%, "+Math.round(100*Bf(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(If[_f(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+yf(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var i=mf(e);n="#"+yf(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0;return t||!r||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return mf(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(Tf,arguments)},brighten:function(){return this._applyModification(wf,arguments)},darken:function(){return this._applyModification(Mf,arguments)},desaturate:function(){return this._applyModification(xf,arguments)},saturate:function(){return this._applyModification(bf,arguments)},greyscale:function(){return this._applyModification(Sf,arguments)},spin:function(){return this._applyModification(Ef,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(Pf,arguments)},complement:function(){return this._applyCombination(Cf,arguments)},monochromatic:function(){return this._applyCombination(Df,arguments)},splitcomplement:function(){return this._applyCombination(Nf,arguments)},triad:function(){return this._applyCombination(Rf,[3])},tetrad:function(){return this._applyCombination(Rf,[4])}},mf.fromRatio=function(e,t){if("object"==df(e)){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]="a"===r?e[r]:qf(e[r]));e=n}return mf(e,t)},mf.equals=function(e,t){return!(!e||!t)&&mf(e).toRgbString()==mf(t).toRgbString()},mf.random=function(){return mf.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},mf.mix=function(e,t,n){n=0===n?0:n||50;var r=mf(e).toRgb(),i=mf(t).toRgb(),s=n/100;return mf({r:(i.r-r.r)*s+r.r,g:(i.g-r.g)*s+r.g,b:(i.b-r.b)*s+r.b,a:(i.a-r.a)*s+r.a})}, 3 3 // <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2) 4 4 // Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2) 5 Pp.readability=function(t,e){var n=Pp(t),i=Pp(e);return(Math.max(n.getLuminance(),i.getLuminance())+.05)/(Math.min(n.getLuminance(),i.getLuminance())+.05)},Pp.isReadable=function(t,e,n){var i,r,s=Pp.readability(t,e);switch(r=!1,(i=function(t){var e,n;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==n&&"large"!==n&&(n="small");return{level:e,size:n}}(n)).level+i.size){case"AAsmall":case"AAAlarge":r=s>=4.5;break;case"AAlarge":r=s>=3;break;case"AAAsmall":r=s>=7}return r},Pp.mostReadable=function(t,e,n){var i,r,s,a,o=null,l=0;r=(n=n||{}).includeFallbackColors,s=n.level,a=n.size;for(var u=0;u<e.length;u++)(i=Pp.readability(t,e[u]))>l&&(l=i,o=Pp(e[u]));return Pp.isReadable(t,o,{level:s,size:a})||!r?o:(n.includeFallbackColors=!1,Pp.mostReadable(t,["#fff","#000"],n))};var Yp=Pp.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Qp=Pp.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(Yp);function $p(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function Zp(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function Kp(t){return Math.min(1,Math.max(0,t))}function Jp(t){return parseInt(t,16)}function tf(t){return 1==t.length?"0"+t:""+t}function ef(t){return t<=1&&(t=100*t+"%"),t}function nf(t){return Math.round(255*parseFloat(t)).toString(16)}function rf(t){return Jp(t)/255}var sf,af,of,lf=(af="[\\s|\\(]+("+(sf="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+sf+")[,|\\s]+("+sf+")\\s*\\)?",of="[\\s|\\(]+("+sf+")[,|\\s]+("+sf+")[,|\\s]+("+sf+")[,|\\s]+("+sf+")\\s*\\)?",{CSS_UNIT:new RegExp(sf),rgb:new RegExp("rgb"+af),rgba:new RegExp("rgba"+of),hsl:new RegExp("hsl"+af),hsla:new RegExp("hsla"+of),hsv:new RegExp("hsv"+af),hsva:new RegExp("hsva"+of),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function uf(t){return!!lf.CSS_UNIT.exec(t)}function hf(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function cf(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(t)).next,0===e);else for(;!(l=(i=s.call(n)).done)&&(o.push(i.value),o.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return o}}(t,e)||pf(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Af(t){return function(t){if(Array.isArray(t))return hf(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||pf(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function df(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof e?e:e+""}function pf(t,e){if(t){if("string"==typeof t)return hf(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hf(t,e):void 0}}var ff=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=(e instanceof Array?e.length?e:[void 0]:[e]).map((function(t){return{keyAccessor:t,isProp:!(t instanceof Function)}})),s=t.reduce((function(t,e){var i=t,s=e;return r.forEach((function(t,e){var a,o=t.keyAccessor;if(t.isProp){var l=s,u=l[o],h=function(t,e){if(null==t)return{};var n,i,r=function(t,e){if(null==t)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.includes(i))continue;n[i]=t[i]}return n}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],e.includes(n)||{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(l,[o].map(df));a=u,s=h}else a=o(s,e);e+1<r.length?(i.hasOwnProperty(a)||(i[a]={}),i=i[a]):n?(i.hasOwnProperty(a)||(i[a]=[]),i[a].push(s)):i[a]=s})),t}),{});n instanceof Function&&function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;i===r.length?Object.keys(e).forEach((function(t){return e[t]=n(e[t])})):Object.values(e).forEach((function(e){return t(e,i+1)}))}(s);var a=s;return i&&(a=[],function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];n.length===r.length?a.push({keys:n,vals:e}):Object.entries(e).forEach((function(e){var i=cf(e,2),r=i[0],s=i[1];return t(s,[].concat(Af(n),[r]))}))}(s),e instanceof Array&&0===e.length&&1===a.length&&(a[0].keys=[])),a};function mf(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function gf(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yf(t,e){if(null==t)return{};var n,i,r=function(t,e){if(null==t)return{};var n,i,r={},s=Object.keys(t);for(i=0;i<s.length;i++)n=s[i],e.indexOf(n)>=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function vf(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(t)).next,0===e);else for(;!(l=(i=s.call(n)).done)&&(o.push(i.value),o.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return o}}(t,e)||xf(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _f(t){return function(t){if(Array.isArray(t))return bf(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||xf(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xf(t,e){if(t){if("string"==typeof t)return bf(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bf(t,e):void 0}}function bf(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var Sf=["createObj","updateObj","exitObj","objBindAttr","dataBindAttr"];function Mf(t,e,n){var i=n.objBindAttr,r=void 0===i?"__obj":i,s=n.dataBindAttr,a=void 0===s?"__data":s,o=n.idAccessor,l=n.purge,u=void 0!==l&&l,h=function(t){return t.hasOwnProperty(a)},c=e.filter((function(t){return!h(t)})),A=e.filter(h).map((function(t){return t[a]})),d=u?{enter:t,exit:A,update:[]}:function(t,e,n){var i={enter:[],update:[],exit:[]};if(n){var r=ff(t,n,!1),s=ff(e,n,!1),a=Object.assign({},r,s);Object.entries(a).forEach((function(t){var e=vf(t,2),n=e[0],a=e[1],o=r.hasOwnProperty(n)?s.hasOwnProperty(n)?"update":"exit":"enter";i[o].push("update"===o?[r[n],s[n]]:a)}))}else{var o=new Set(t),l=new Set(e);new Set([].concat(_f(o),_f(l))).forEach((function(t){var e=o.has(t)?l.has(t)?"update":"exit":"enter";i[e].push("update"===e?[t,t]:t)}))}return i}(A,t,o);return d.update=d.update.map((function(t){var e=vf(t,2),n=e[0],i=e[1];return n!==i&&(i[r]=n[r],i[r][a]=i),i})),d.exit=d.exit.concat(c.map((function(t){return gf({},r,t)}))),d}function wf(t,e,n,i,r){var s=r.createObj,a=void 0===s?function(t){return{}}:s,o=r.updateObj,l=void 0===o?function(t,e){}:o,u=r.exitObj,h=void 0===u?function(t){}:u,c=r.objBindAttr,A=void 0===c?"__obj":c,d=r.dataBindAttr,p=void 0===d?"__data":d,f=yf(r,Sf),m=Mf(t,e,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?mf(Object(n),!0).forEach((function(e){gf(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):mf(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({objBindAttr:A,dataBindAttr:p},f)),g=m.enter,y=m.update;m.exit.forEach((function(t){var e=t[A];delete t[A],h(e),i(e)}));var v=function(t){var e=[];return t.forEach((function(t){var n=a(t);n&&(n[p]=t,t[A]=n,e.push(n))})),e}(g);!function(t){t.forEach((function(t){var e=t[A];e&&(e[p]=t,l(e,t))}))}([].concat(_f(g),_f(y))),v.forEach(n)}function Tf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ef,Cf={exports:{}};var Rf=(Ef||(Ef=1,function(t){t.exports=function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){var i=n(1),r=function(){function t(t,e,n){void 0===t&&(t=NaN),void 0===e&&(e=NaN),void 0===n&&(n=!1),this._minFPS=e,this._maxFPS=t,this._timeScale=1,this._currentTick=0,this._currentTime=0,this._tickDeltaTime=0,this._isRunning=!1,this._maxInterval=isNaN(this._minFPS)?NaN:1e3/this._minFPS,this._minInterval=isNaN(this._maxFPS)?NaN:1e3/this._maxFPS,this._onResume=new i.default,this._onPause=new i.default,this._onTick=new i.default,this._onTickOncePerFrame=new i.default,n||this.resume()}return t.prototype.updateOnce=function(t){t(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick)},t.prototype.resume=function(){this._isRunning||(this._isRunning=!0,this._lastTimeUpdated=this.getTimer(),this._onResume.dispatch(),this.animateOnce())},t.prototype.pause=function(){this._isRunning&&(this._isRunning=!1,this._onPause.dispatch(),window.cancelAnimationFrame(this._animationFrameHandle))},t.prototype.dispose=function(){this.pause(),this._onResume.removeAll(),this._onPause.removeAll(),this._onTick.removeAll()},Object.defineProperty(t.prototype,"currentTick",{get:function(){return this._currentTick},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentTimeSeconds",{get:function(){return this._currentTime/1e3},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"tickDeltaTimeSeconds",{get:function(){return this._tickDeltaTime/1e3},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"timeScale",{get:function(){return this._timeScale},set:function(t){this._timeScale!==t&&(this._timeScale=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onResume",{get:function(){return this._onResume},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onPause",{get:function(){return this._onPause},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onTick",{get:function(){return this._onTick},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onTickOncePerFrame",{get:function(){return this._onTickOncePerFrame},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isRunning",{get:function(){return this._isRunning},enumerable:!0,configurable:!0}),t.prototype.animateOnce=function(){var t=this;this._animationFrameHandle=window.requestAnimationFrame((function(){return t.onFrame()}))},t.prototype.onFrame=function(){if(this._now=this.getTimer(),this._frameDeltaTime=this._now-this._lastTimeUpdated,isNaN(this._minInterval)||this._frameDeltaTime>=this._minInterval)if(isNaN(this._maxInterval))this.update(this._frameDeltaTime*this._timeScale,!0),this._lastTimeUpdated=this._now;else for(this._interval=Math.min(this._frameDeltaTime,this._maxInterval);this._now>=this._lastTimeUpdated+this._interval;)this.update(this._interval*this._timeScale,this._now<=this._lastTimeUpdated+2*this._maxInterval),this._lastTimeUpdated+=this._interval;this._isRunning&&this.animateOnce()},t.prototype.update=function(t,e){void 0===e&&(e=!0),this._currentTick++,this._currentTime+=t,this._tickDeltaTime=t,this._onTick.dispatch(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick),e&&this._onTickOncePerFrame.dispatch(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick)},t.prototype.getTimer=function(){return Date.now()},t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=r},function(t,e,n){!function(e,n){t.exports=n()}(0,(function(){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e){var n=function(){function t(){this.functions=[]}return t.prototype.add=function(t){return-1===this.functions.indexOf(t)&&(this.functions.push(t),!0)},t.prototype.remove=function(t){var e=this.functions.indexOf(t);return e>-1&&(this.functions.splice(e,1),!0)},t.prototype.removeAll=function(){return this.functions.length>0&&(this.functions.length=0,!0)},t.prototype.dispatch=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.functions.concat().forEach((function(e){e.apply(void 0,t)}))},Object.defineProperty(t.prototype,"numItems",{get:function(){return this.functions.length},enumerable:!0,configurable:!0}),t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=n}])}))}])}(Cf)),Cf.exports),Nf=Tf(Rf);function Pf(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}var Df=t=>()=>t;function If(t){return 1==(t=+t)?Lf:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):Df(isNaN(e)?n:e)}}function Lf(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):Df(isNaN(t)?e:t)}var Bf=function t(e){var n=If(e);function i(t,e){var i=n((t=fp(t)).r,(e=fp(e)).r),r=n(t.g,e.g),s=n(t.b,e.b),a=Lf(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=s(e),t.opacity=a(e),t+""}}return i.gamma=t,i}(1);function Uf(t,e){e||(e=[]);var n,i=t?Math.min(e.length,t.length):0,r=e.slice();return function(s){for(n=0;n<i;++n)r[n]=t[n]*(1-s)+e[n]*s;return r}}function Of(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Ff(t,e){return(Of(e)?Uf:kf)(t,e)}function kf(t,e){var n,i=e?e.length:0,r=t?Math.min(i,t.length):0,s=new Array(r),a=new Array(i);for(n=0;n<r;++n)s[n]=Wf(t[n],e[n]);for(;n<i;++n)a[n]=e[n];return function(t){for(n=0;n<r;++n)a[n]=s[n](t);return a}}function zf(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}function qf(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Gf(t,e){var n,i={},r={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?i[n]=Wf(t[n],e[n]):r[n]=e[n];return function(t){for(n in i)r[n]=i[n](t);return r}}var Vf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Hf=new RegExp(Vf.source,"g");function jf(t,e){var n,i,r,s=Vf.lastIndex=Hf.lastIndex=0,a=-1,o=[],l=[];for(t+="",e+="";(n=Vf.exec(t))&&(i=Hf.exec(e));)(r=i.index)>s&&(r=e.slice(s,r),o[a]?o[a]+=r:o[++a]=r),(n=n[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,l.push({i:a,x:qf(n,i)})),s=Hf.lastIndex;return s<e.length&&(r=e.slice(s),o[a]?o[a]+=r:o[++a]=r),o.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var n,i=0;i<e;++i)o[(n=l[i]).i]=n.x(t);return o.join("")})}function Wf(t,e){var n,i=typeof e;return null==e||"boolean"===i?Df(e):("number"===i?qf:"string"===i?(n=Ap(e))?(e=n,Bf):jf:e instanceof Ap?Bf:e instanceof Date?zf:Of(e)?Uf:Array.isArray(e)?kf:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Gf:qf)(t,e)}function Xf(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function Yf(t){return+t}var Qf=[0,1];function $f(t){return t}function Zf(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n});var n}function Kf(t,e,n){var i=t[0],r=t[1],s=e[0],a=e[1];return r<i?(i=Zf(r,i),s=n(a,s)):(i=Zf(i,r),s=n(s,a)),function(t){return s(i(t))}}function Jf(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),s=new Array(i),a=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<i;)r[a]=Zf(t[a],t[a+1]),s[a]=n(e[a],e[a+1]);return function(e){var n=Mh(t,e,1,i)-1;return s[n](r[n](e))}}function tm(){var t,e,n,i,r,s,a=Qf,o=Qf,l=Wf,u=$f;function h(){var t=Math.min(a.length,o.length);return u!==$f&&(u=function(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(a[0],a[t-1])),i=t>2?Jf:Kf,r=s=null,c}function c(e){return null==e||isNaN(e=+e)?n:(r||(r=i(a.map(t),o,l)))(t(u(e)))}return c.invert=function(n){return u(e((s||(s=i(o,a.map(t),qf)))(n)))},c.domain=function(t){return arguments.length?(a=Array.from(t,Yf),h()):a.slice()},c.range=function(t){return arguments.length?(o=Array.from(t),h()):o.slice()},c.rangeRound=function(t){return o=Array.from(t),l=Xf,h()},c.clamp=function(t){return arguments.length?(u=!!t||$f,h()):u!==$f},c.interpolate=function(t){return arguments.length?(l=t,h()):l},c.unknown=function(t){return arguments.length?(n=t,c):n},function(n,i){return t=n,e=i,h()}}function em(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function nm(t){return(t=em(Math.abs(t)))?t[1]:NaN}var im,rm=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function sm(t){if(!(e=rm.exec(t)))throw new Error("invalid format: "+t);var e;return new am({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function am(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function om(t,e){var n=em(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}sm.prototype=am.prototype,am.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var lm={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>om(100*t,e),r:om,s:function(t,e){var n=em(t,e);if(!n)return t+"";var i=n[0],r=n[1],s=r-(im=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,a=i.length;return s===a?i:s>a?i+new Array(s-a+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+em(t,Math.max(0,e+s-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function um(t){return t}var hm,cm,Am,dm=Array.prototype.map,pm=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function fm(t){var e,n,i=void 0===t.grouping||void 0===t.thousands?um:(e=dm.call(t.grouping,Number),n=t.thousands+"",function(t,i){for(var r=t.length,s=[],a=0,o=e[0],l=0;r>0&&o>0&&(l+o+1>i&&(o=Math.max(1,i-l)),s.push(t.substring(r-=o,r+o)),!((l+=o+1)>i));)o=e[a=(a+1)%e.length];return s.reverse().join(n)}),r=void 0===t.currency?"":t.currency[0]+"",s=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",o=void 0===t.numerals?um:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(dm.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",u=void 0===t.minus?"−":t.minus+"",h=void 0===t.nan?"NaN":t.nan+"";function c(t){var e=(t=sm(t)).fill,n=t.align,c=t.sign,A=t.symbol,d=t.zero,p=t.width,f=t.comma,m=t.precision,g=t.trim,y=t.type;"n"===y?(f=!0,y="g"):lm[y]||(void 0===m&&(m=12),g=!0,y="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var v="$"===A?r:"#"===A&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",_="$"===A?s:/[%p]/.test(y)?l:"",x=lm[y],b=/[defgprs%]/.test(y);function S(t){var r,s,l,A=v,S=_;if("c"===y)S=x(t)+S,t="";else{var M=(t=+t)<0||1/t<0;if(t=isNaN(t)?h:x(Math.abs(t),m),g&&(t=function(t){t:for(var e,n=t.length,i=1,r=-1;i<n;++i)switch(t[i]){case".":r=e=i;break;case"0":0===r&&(r=i),e=i;break;default:if(!+t[i])break t;r>0&&(r=0)}return r>0?t.slice(0,r)+t.slice(e+1):t}(t)),M&&0==+t&&"+"!==c&&(M=!1),A=(M?"("===c?c:u:"-"===c||"("===c?"":c)+A,S=("s"===y?pm[8+im/3]:"")+S+(M&&"("===c?")":""),b)for(r=-1,s=t.length;++r<s;)if(48>(l=t.charCodeAt(r))||l>57){S=(46===l?a+t.slice(r+1):t.slice(r))+S,t=t.slice(0,r);break}}f&&!d&&(t=i(t,1/0));var w=A.length+t.length+S.length,T=w<p?new Array(p-w+1).join(e):"";switch(f&&d&&(t=i(T+t,T.length?p-S.length:1/0),T=""),n){case"<":t=A+t+S+T;break;case"=":t=A+T+t+S;break;case"^":t=T.slice(0,w=T.length>>1)+A+t+S+T.slice(w);break;default:t=T+A+t+S}return o(t)}return m=void 0===m?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),S.toString=function(){return t+""},S}return{format:c,formatPrefix:function(t,e){var n=c(((t=sm(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(nm(e)/3))),r=Math.pow(10,-i),s=pm[8+i/3];return function(t){return n(r*t)+s}}}}function mm(t,e,n,i){var r,s=function(t,e,n){n=+n;const i=(e=+e)<(t=+t),r=i?Ph(e,t,n):Ph(t,e,n);return(i?-1:1)*(r<0?1/-r:r)}(t,e,n);switch((i=sm(null==i?",f":i)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=i.precision||isNaN(r=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(nm(e)/3)))-nm(Math.abs(t)))}(s,a))||(i.precision=r),Am(i,a);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,nm(e)-nm(t))+1}(s,Math.max(Math.abs(t),Math.abs(e))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=function(t){return Math.max(0,-nm(Math.abs(t)))}(s))||(i.precision=r-2*("%"===i.type))}return cm(i)}function gm(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const i=e<t,[r,s,a]=i?Nh(e,t,n):Nh(t,e,n);if(!(s>=r))return[];const o=s-r+1,l=new Array(o);if(i)if(a<0)for(let t=0;t<o;++t)l[t]=(s-t)/-a;else for(let t=0;t<o;++t)l[t]=(s-t)*a;else if(a<0)for(let t=0;t<o;++t)l[t]=(r+t)/-a;else for(let t=0;t<o;++t)l[t]=(r+t)*a;return l}(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var i=e();return mm(i[0],i[i.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var i,r,s=e(),a=0,o=s.length-1,l=s[a],u=s[o],h=10;for(u<l&&(r=l,l=u,u=r,r=a,a=o,o=r);h-- >0;){if((r=Ph(l,u,n))===i)return s[a]=l,s[o]=u,e(s);if(r>0)l=Math.floor(l/r)*r,u=Math.ceil(u/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,u=Math.floor(u*r)/r}i=r}return t},t}function ym(){var t=tm()($f,$f);return t.copy=function(){return e=t,ym().domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown());var e},Pf.apply(t,arguments),gm(t)}hm=fm({thousands:",",grouping:[3],currency:["$",""]}),cm=hm.format,Am=hm.formatPrefix;const vm=134217729;function _m(t,e,n,i,r){let s,a,o,l,u=e[0],h=i[0],c=0,A=0;h>u==h>-u?(s=u,u=e[++c]):(s=h,h=i[++A]);let d=0;if(c<t&&A<n)for(h>u==h>-u?(a=u+s,o=s-(a-u),u=e[++c]):(a=h+s,o=s-(a-h),h=i[++A]),s=a,0!==o&&(r[d++]=o);c<t&&A<n;)h>u==h>-u?(a=s+u,l=a-s,o=s-(a-l)+(u-l),u=e[++c]):(a=s+h,l=a-s,o=s-(a-l)+(h-l),h=i[++A]),s=a,0!==o&&(r[d++]=o);for(;c<t;)a=s+u,l=a-s,o=s-(a-l)+(u-l),u=e[++c],s=a,0!==o&&(r[d++]=o);for(;A<n;)a=s+h,l=a-s,o=s-(a-l)+(h-l),h=i[++A],s=a,0!==o&&(r[d++]=o);return 0===s&&0!==d||(r[d++]=s),d}function xm(t){return new Float64Array(t)}const bm=xm(4),Sm=xm(8),Mm=xm(12),wm=xm(16),Tm=xm(4);function Em(t,e,n,i,r,s){const a=(e-s)*(n-r),o=(t-r)*(i-s),l=a-o,u=Math.abs(a+o);return Math.abs(l)>=33306690738754716e-32*u?l:-function(t,e,n,i,r,s,a){let o,l,u,h,c,A,d,p,f,m,g,y,v,_,x,b,S,M;const w=t-r,T=n-r,E=e-s,C=i-s;_=w*C,A=vm*w,d=A-(A-w),p=w-d,A=vm*C,f=A-(A-C),m=C-f,x=p*m-(_-d*f-p*f-d*m),b=E*T,A=vm*E,d=A-(A-E),p=E-d,A=vm*T,f=A-(A-T),m=T-f,S=p*m-(b-d*f-p*f-d*m),g=x-S,c=x-g,bm[0]=x-(g+c)+(c-S),y=_+g,c=y-_,v=_-(y-c)+(g-c),g=v-b,c=v-g,bm[1]=v-(g+c)+(c-b),M=y+g,c=M-y,bm[2]=y-(M-c)+(g-c),bm[3]=M;let R=function(t,e){let n=e[0];for(let i=1;i<t;i++)n+=e[i];return n}(4,bm),N=22204460492503146e-32*a;if(R>=N||-R>=N)return R;if(c=t-w,o=t-(w+c)+(c-r),c=n-T,u=n-(T+c)+(c-r),c=e-E,l=e-(E+c)+(c-s),c=i-C,h=i-(C+c)+(c-s),0===o&&0===l&&0===u&&0===h)return R;if(N=11093356479670487e-47*a+33306690738754706e-32*Math.abs(R),R+=w*h+C*o-(E*u+T*l),R>=N||-R>=N)return R;_=o*C,A=vm*o,d=A-(A-o),p=o-d,A=vm*C,f=A-(A-C),m=C-f,x=p*m-(_-d*f-p*f-d*m),b=l*T,A=vm*l,d=A-(A-l),p=l-d,A=vm*T,f=A-(A-T),m=T-f,S=p*m-(b-d*f-p*f-d*m),g=x-S,c=x-g,Tm[0]=x-(g+c)+(c-S),y=_+g,c=y-_,v=_-(y-c)+(g-c),g=v-b,c=v-g,Tm[1]=v-(g+c)+(c-b),M=y+g,c=M-y,Tm[2]=y-(M-c)+(g-c),Tm[3]=M;const P=_m(4,bm,4,Tm,Sm);_=w*h,A=vm*w,d=A-(A-w),p=w-d,A=vm*h,f=A-(A-h),m=h-f,x=p*m-(_-d*f-p*f-d*m),b=E*u,A=vm*E,d=A-(A-E),p=E-d,A=vm*u,f=A-(A-u),m=u-f,S=p*m-(b-d*f-p*f-d*m),g=x-S,c=x-g,Tm[0]=x-(g+c)+(c-S),y=_+g,c=y-_,v=_-(y-c)+(g-c),g=v-b,c=v-g,Tm[1]=v-(g+c)+(c-b),M=y+g,c=M-y,Tm[2]=y-(M-c)+(g-c),Tm[3]=M;const D=_m(P,Sm,4,Tm,Mm);_=o*h,A=vm*o,d=A-(A-o),p=o-d,A=vm*h,f=A-(A-h),m=h-f,x=p*m-(_-d*f-p*f-d*m),b=l*u,A=vm*l,d=A-(A-l),p=l-d,A=vm*u,f=A-(A-u),m=u-f,S=p*m-(b-d*f-p*f-d*m),g=x-S,c=x-g,Tm[0]=x-(g+c)+(c-S),y=_+g,c=y-_,v=_-(y-c)+(g-c),g=v-b,c=v-g,Tm[1]=v-(g+c)+(c-b),M=y+g,c=M-y,Tm[2]=y-(M-c)+(g-c),Tm[3]=M;const I=_m(D,Mm,4,Tm,wm);return wm[I-1]}(t,e,n,i,r,s,u)}const Cm=Math.pow(2,-52),Rm=new Uint32Array(512);class Nm{static from(t,e=Um,n=Om){const i=t.length,r=new Float64Array(2*i);for(let s=0;s<i;s++){const i=t[s];r[2*s]=e(i),r[2*s+1]=n(i)}return new Nm(r)}constructor(t){const e=t.length>>1;if(e>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:i,_hullHash:r}=this,s=t.length>>1;let a=1/0,o=1/0,l=-1/0,u=-1/0;for(let e=0;e<s;e++){const n=t[2*e],i=t[2*e+1];n<a&&(a=n),i<o&&(o=i),n>l&&(l=n),i>u&&(u=i),this._ids[e]=e}const h=(a+l)/2,c=(o+u)/2;let A,d,p;for(let e=0,n=1/0;e<s;e++){const i=Pm(h,c,t[2*e],t[2*e+1]);i<n&&(A=e,n=i)}const f=t[2*A],m=t[2*A+1];for(let e=0,n=1/0;e<s;e++){if(e===A)continue;const i=Pm(f,m,t[2*e],t[2*e+1]);i<n&&i>0&&(d=e,n=i)}let g=t[2*d],y=t[2*d+1],v=1/0;for(let e=0;e<s;e++){if(e===A||e===d)continue;const n=Im(f,m,g,y,t[2*e],t[2*e+1]);n<v&&(p=e,v=n)}let _=t[2*p],x=t[2*p+1];if(v===1/0){for(let e=0;e<s;e++)this._dists[e]=t[2*e]-t[0]||t[2*e+1]-t[1];Lm(this._ids,this._dists,0,s-1);const e=new Uint32Array(s);let n=0;for(let t=0,i=-1/0;t<s;t++){const r=this._ids[t],s=this._dists[r];s>i&&(e[n++]=r,i=s)}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(Em(f,m,g,y,_,x)<0){const t=d,e=g,n=y;d=p,g=_,y=x,p=t,_=e,x=n}const b=function(t,e,n,i,r,s){const a=n-t,o=i-e,l=r-t,u=s-e,h=a*a+o*o,c=l*l+u*u,A=.5/(a*u-o*l);return{x:t+(u*h-o*c)*A,y:e+(a*c-l*h)*A}}(f,m,g,y,_,x);this._cx=b.x,this._cy=b.y;for(let e=0;e<s;e++)this._dists[e]=Pm(t[2*e],t[2*e+1],b.x,b.y);Lm(this._ids,this._dists,0,s-1),this._hullStart=A;let S=3;n[A]=e[p]=d,n[d]=e[A]=p,n[p]=e[d]=A,i[A]=0,i[d]=1,i[p]=2,r.fill(-1),r[this._hashKey(f,m)]=A,r[this._hashKey(g,y)]=d,r[this._hashKey(_,x)]=p,this.trianglesLen=0,this._addTriangle(A,d,p,-1,-1,-1);for(let s,a,o=0;o<this._ids.length;o++){const l=this._ids[o],u=t[2*l],h=t[2*l+1];if(o>0&&Math.abs(u-s)<=Cm&&Math.abs(h-a)<=Cm)continue;if(s=u,a=h,l===A||l===d||l===p)continue;let c=0;for(let t=0,e=this._hashKey(u,h);t<this._hashSize&&(c=r[(e+t)%this._hashSize],-1===c||c===n[c]);t++);c=e[c];let f,m=c;for(;f=n[m],Em(u,h,t[2*m],t[2*m+1],t[2*f],t[2*f+1])>=0;)if(m=f,m===c){m=-1;break}if(-1===m)continue;let g=this._addTriangle(m,l,n[m],-1,-1,i[m]);i[l]=this._legalize(g+2),i[m]=g,S++;let y=n[m];for(;f=n[y],Em(u,h,t[2*y],t[2*y+1],t[2*f],t[2*f+1])<0;)g=this._addTriangle(y,l,f,i[l],-1,i[y]),i[l]=this._legalize(g+2),n[y]=y,S--,y=f;if(m===c)for(;f=e[m],Em(u,h,t[2*f],t[2*f+1],t[2*m],t[2*m+1])<0;)g=this._addTriangle(f,l,m,-1,i[m],i[f]),this._legalize(g+2),i[f]=g,n[m]=m,S--,m=f;this._hullStart=e[l]=m,n[m]=e[y]=l,n[l]=y,r[this._hashKey(u,h)]=l,r[this._hashKey(t[2*m],t[2*m+1])]=m}this.hull=new Uint32Array(S);for(let t=0,e=this._hullStart;t<S;t++)this.hull[t]=e,e=n[e];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,e){return Math.floor(function(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:i}=this;let r=0,s=0;for(;;){const a=n[t],o=t-t%3;if(s=o+(t+2)%3,-1===a){if(0===r)break;t=Rm[--r];continue}const l=a-a%3,u=o+(t+1)%3,h=l+(a+2)%3,c=e[s],A=e[t],d=e[u],p=e[h];if(Dm(i[2*c],i[2*c+1],i[2*A],i[2*A+1],i[2*d],i[2*d+1],i[2*p],i[2*p+1])){e[t]=p,e[a]=c;const i=n[h];if(-1===i){let e=this._hullStart;do{if(this._hullTri[e]===h){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,i),this._link(a,n[s]),this._link(s,h);const o=l+(a+1)%3;r<Rm.length&&(Rm[r++]=o)}else{if(0===r)break;t=Rm[--r]}}return s}_link(t,e){this._halfedges[t]=e,-1!==e&&(this._halfedges[e]=t)}_addTriangle(t,e,n,i,r,s){const a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=e,this._triangles[a+2]=n,this._link(a,i),this._link(a+1,r),this._link(a+2,s),this.trianglesLen+=3,a}}function Pm(t,e,n,i){const r=t-n,s=e-i;return r*r+s*s}function Dm(t,e,n,i,r,s,a,o){const l=t-a,u=e-o,h=n-a,c=i-o,A=r-a,d=s-o,p=h*h+c*c,f=A*A+d*d;return l*(c*f-p*d)-u*(h*f-p*A)+(l*l+u*u)*(h*d-c*A)<0}function Im(t,e,n,i,r,s){const a=n-t,o=i-e,l=r-t,u=s-e,h=a*a+o*o,c=l*l+u*u,A=.5/(a*u-o*l),d=(u*h-o*c)*A,p=(a*c-l*h)*A;return d*d+p*p}function Lm(t,e,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const i=t[r],s=e[i];let a=r-1;for(;a>=n&&e[t[a]]>s;)t[a+1]=t[a--];t[a+1]=i}else{let r=n+1,s=i;Bm(t,n+i>>1,r),e[t[n]]>e[t[i]]&&Bm(t,n,i),e[t[r]]>e[t[i]]&&Bm(t,r,i),e[t[n]]>e[t[r]]&&Bm(t,n,r);const a=t[r],o=e[a];for(;;){do{r++}while(e[t[r]]<o);do{s--}while(e[t[s]]>o);if(s<r)break;Bm(t,r,s)}t[n+1]=t[s],t[s]=a,i-r+1>=s-n?(Lm(t,e,r,i),Lm(t,e,n,s-1)):(Lm(t,e,n,s-1),Lm(t,e,r,i))}}function Bm(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function Um(t){return t[0]}function Om(t){return t[1]}function Fm(t,e){for(var n=0,i=0,r=0,s=0,a=0,o=0,l=0,u=0,h=null,c=null,A=t[0],d=t[1],p=e.length;n<p;n++){i=0;var f=e[n].length-1,m=e[n];if((h=m[0])[0]!==m[f][0]&&h[1]!==m[f][1])throw new Error("First and last coordinates in a ring must be the same");for(a=h[0]-A,o=h[1]-d;i<f;i++)if(u=(c=m[i+1])[1]-d,o<0&&u<0||o>0&&u>0)o=u,a=(h=c)[0]-A;else{if(l=c[0]-t[0],u>0&&o<=0){if((s=a*u-l*o)>0)r+=1;else if(0===s)return 0}else if(o>0&&u<=0){if((s=a*u-l*o)<0)r+=1;else if(0===s)return 0}else if(0===u&&o<0){if(0===(s=a*u-l*o))return 0}else if(0===o&&u<0){if(0===(s=a*u-l*o))return 0}else if(0===o&&0===u){if(l<=0&&a>=0)return 0;if(a<=0&&l>=0)return 0}h=c,o=u,a=l}}return r%2!=0}var km=function(t,e,n={}){if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");const i=function(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return[...t.geometry.coordinates];if("Point"===t.type)return[...t.coordinates]}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return[...t];throw new Error("coord must be GeoJSON Point or an Array of numbers")}(t),r="Feature"===(s=e).type?s.geometry:s;var s;const a=r.type,o=e.bbox;let l=r.coordinates;if(o&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(i,o))return!1;"Polygon"===a&&(l=[l]);let u=!1;for(var h=0;h<l.length;++h){const t=Fm(i,l[h]);if(0===t)return!n.ignoreBoundary;t&&(u=!0)}return u};const zm=1e-6;class qm{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,e){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,e){this._+=`L${this._x1=+t},${this._y1=+e}`}arc(t,e,n){const i=(t=+t)+(n=+n),r=e=+e;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${i},${r}`:(Math.abs(this._x1-i)>zm||Math.abs(this._y1-r)>zm)&&(this._+="L"+i+","+r),n&&(this._+=`A${n},${n},0,1,1,${t-n},${e}A${n},${n},0,1,1,${this._x1=i},${this._y1=r}`)}rect(t,e,n,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${+n}v${+i}h${-n}Z`}value(){return this._||null}}class Gm{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class Vm{constructor(t,[e,n,i,r]=[0,0,960,500]){if(!((i=+i)>=(e=+e)&&(r=+r)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=i,this.xmin=e,this.ymax=r,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:i}=this;let r,s;const a=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let i,o,l=0,u=0,h=n.length;l<h;l+=3,u+=2){const h=2*n[l],c=2*n[l+1],A=2*n[l+2],d=t[h],p=t[h+1],f=t[c],m=t[c+1],g=t[A],y=t[A+1],v=f-d,_=m-p,x=g-d,b=y-p,S=2*(v*b-_*x);if(Math.abs(S)<1e-9){if(void 0===r){r=s=0;for(const n of e)r+=t[2*n],s+=t[2*n+1];r/=e.length,s/=e.length}const n=1e9*Math.sign((r-d)*b-(s-p)*x);i=(d+g)/2-n*b,o=(p+y)/2+n*x}else{const t=1/S,e=v*v+_*_,n=x*x+b*b;i=d+(b*e-_*n)*t,o=p+(v*n-x*e)*t}a[u]=i,a[u+1]=o}let o,l,u,h=e[e.length-1],c=4*h,A=t[2*h],d=t[2*h+1];i.fill(0);for(let n=0;n<e.length;++n)h=e[n],o=c,l=A,u=d,c=4*h,A=t[2*h],d=t[2*h+1],i[o+2]=i[c]=u-d,i[o+3]=i[c+1]=A-l}render(t){const e=null==t?t=new qm:void 0,{delaunay:{halfedges:n,inedges:i,hull:r},circumcenters:s,vectors:a}=this;if(r.length<=1)return null;for(let e=0,i=n.length;e<i;++e){const i=n[e];if(i<e)continue;const r=2*Math.floor(e/3),a=2*Math.floor(i/3),o=s[r],l=s[r+1],u=s[a],h=s[a+1];this._renderSegment(o,l,u,h,t)}let o,l=r[r.length-1];for(let e=0;e<r.length;++e){o=l,l=r[e];const n=2*Math.floor(i[l]/3),u=s[n],h=s[n+1],c=4*o,A=this._project(u,h,a[c+2],a[c+3]);A&&this._renderSegment(u,h,A[0],A[1],t)}return e&&e.value()}renderBounds(t){const e=null==t?t=new qm:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),e&&e.value()}renderCell(t,e){const n=null==e?e=new qm:void 0,i=this._clip(t);if(null===i||!i.length)return;e.moveTo(i[0],i[1]);let r=i.length;for(;i[0]===i[r-2]&&i[1]===i[r-1]&&r>1;)r-=2;for(let t=2;t<r;t+=2)i[t]===i[t-2]&&i[t+1]===i[t-1]||e.lineTo(i[t],i[t+1]);return e.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let e=0,n=t.length/2;e<n;++e){const t=this.cellPolygon(e);t&&(t.index=e,yield t)}}cellPolygon(t){const e=new Gm;return this.renderCell(t,e),e.value()}_renderSegment(t,e,n,i,r){let s;const a=this._regioncode(t,e),o=this._regioncode(n,i);0===a&&0===o?(r.moveTo(t,e),r.lineTo(n,i)):(s=this._clipSegment(t,e,n,i,a,o))&&(r.moveTo(s[0],s[1]),r.lineTo(s[2],s[3]))}contains(t,e,n){return(e=+e)==e&&(n=+n)==n&&this.delaunay._step(t,e,n)===t}*neighbors(t){const e=this._clip(t);if(e)for(const n of this.delaunay.neighbors(t)){const t=this._clip(n);if(t)t:for(let i=0,r=e.length;i<r;i+=2)for(let s=0,a=t.length;s<a;s+=2)if(e[i]===t[s]&&e[i+1]===t[s+1]&&e[(i+2)%r]===t[(s+a-2)%a]&&e[(i+3)%r]===t[(s+a-1)%a]){yield n;break t}}}_cell(t){const{circumcenters:e,delaunay:{inedges:n,halfedges:i,triangles:r}}=this,s=n[t];if(-1===s)return null;const a=[];let o=s;do{const n=Math.floor(o/3);if(a.push(e[2*n],e[2*n+1]),o=o%3==2?o-2:o+1,r[o]!==t)break;o=i[o]}while(o!==s&&-1!==o);return a}_clip(t){if(0===t&&1===this.delaunay.hull.length)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const e=this._cell(t);if(null===e)return null;const{vectors:n}=this,i=4*t;return this._simplify(n[i]||n[i+1]?this._clipInfinite(t,e,n[i],n[i+1],n[i+2],n[i+3]):this._clipFinite(t,e))}_clipFinite(t,e){const n=e.length;let i,r,s,a,o=null,l=e[n-2],u=e[n-1],h=this._regioncode(l,u),c=0;for(let A=0;A<n;A+=2)if(i=l,r=u,l=e[A],u=e[A+1],s=h,h=this._regioncode(l,u),0===s&&0===h)a=c,c=0,o?o.push(l,u):o=[l,u];else{let e,n,A,d,p;if(0===s){if(null===(e=this._clipSegment(i,r,l,u,s,h)))continue;[n,A,d,p]=e}else{if(null===(e=this._clipSegment(l,u,i,r,h,s)))continue;[d,p,n,A]=e,a=c,c=this._edgecode(n,A),a&&c&&this._edge(t,a,c,o,o.length),o?o.push(n,A):o=[n,A]}a=c,c=this._edgecode(d,p),a&&c&&this._edge(t,a,c,o,o.length),o?o.push(d,p):o=[d,p]}if(o)a=c,c=this._edgecode(o[0],o[1]),a&&c&&this._edge(t,a,c,o,o.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return o}_clipSegment(t,e,n,i,r,s){const a=r<s;for(a&&([t,e,n,i,r,s]=[n,i,t,e,s,r]);;){if(0===r&&0===s)return a?[n,i,t,e]:[t,e,n,i];if(r&s)return null;let o,l,u=r||s;8&u?(o=t+(n-t)*(this.ymax-e)/(i-e),l=this.ymax):4&u?(o=t+(n-t)*(this.ymin-e)/(i-e),l=this.ymin):2&u?(l=e+(i-e)*(this.xmax-t)/(n-t),o=this.xmax):(l=e+(i-e)*(this.xmin-t)/(n-t),o=this.xmin),r?(t=o,e=l,r=this._regioncode(t,e)):(n=o,i=l,s=this._regioncode(n,i))}}_clipInfinite(t,e,n,i,r,s){let a,o=Array.from(e);if((a=this._project(o[0],o[1],n,i))&&o.unshift(a[0],a[1]),(a=this._project(o[o.length-2],o[o.length-1],r,s))&&o.push(a[0],a[1]),o=this._clipFinite(t,o))for(let e,n=0,i=o.length,r=this._edgecode(o[i-2],o[i-1]);n<i;n+=2)e=r,r=this._edgecode(o[n],o[n+1]),e&&r&&(n=this._edge(t,e,r,o,n),i=o.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(o=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return o}_edge(t,e,n,i,r){for(;e!==n;){let n,s;switch(e){case 5:e=4;continue;case 4:e=6,n=this.xmax,s=this.ymin;break;case 6:e=2;continue;case 2:e=10,n=this.xmax,s=this.ymax;break;case 10:e=8;continue;case 8:e=9,n=this.xmin,s=this.ymax;break;case 9:e=1;continue;case 1:e=5,n=this.xmin,s=this.ymin}i[r]===n&&i[r+1]===s||!this.contains(t,n,s)||(i.splice(r,0,n,s),r+=2)}return r}_project(t,e,n,i){let r,s,a,o=1/0;if(i<0){if(e<=this.ymin)return null;(r=(this.ymin-e)/i)<o&&(a=this.ymin,s=t+(o=r)*n)}else if(i>0){if(e>=this.ymax)return null;(r=(this.ymax-e)/i)<o&&(a=this.ymax,s=t+(o=r)*n)}if(n>0){if(t>=this.xmax)return null;(r=(this.xmax-t)/n)<o&&(s=this.xmax,a=e+(o=r)*i)}else if(n<0){if(t<=this.xmin)return null;(r=(this.xmin-t)/n)<o&&(s=this.xmin,a=e+(o=r)*i)}return[s,a]}_edgecode(t,e){return(t===this.xmin?1:t===this.xmax?2:0)|(e===this.ymin?4:e===this.ymax?8:0)}_regioncode(t,e){return(t<this.xmin?1:t>this.xmax?2:0)|(e<this.ymin?4:e>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let e=0;e<t.length;e+=2){const n=(e+2)%t.length,i=(e+4)%t.length;(t[e]===t[n]&&t[n]===t[i]||t[e+1]===t[n+1]&&t[n+1]===t[i+1])&&(t.splice(n,2),e-=2)}t.length||(t=null)}return t}}const Hm=2*Math.PI,jm=Math.pow;function Wm(t){return t[0]}function Xm(t){return t[1]}function Ym(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class Qm{static from(t,e=Wm,n=Xm,i){return new Qm("length"in t?function(t,e,n,i){const r=t.length,s=new Float64Array(2*r);for(let a=0;a<r;++a){const r=t[a];s[2*a]=e.call(i,r,a,t),s[2*a+1]=n.call(i,r,a,t)}return s}(t,e,n,i):Float64Array.from(function*(t,e,n,i){let r=0;for(const s of t)yield e.call(i,s,r,t),yield n.call(i,s,r,t),++r}(t,e,n,i)))}constructor(t){this._delaunator=new Nm(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,e=this.points;if(t.hull&&t.hull.length>2&&function(t){const{triangles:e,coords:n}=t;for(let t=0;t<e.length;t+=3){const i=2*e[t],r=2*e[t+1],s=2*e[t+2];if((n[s]-n[i])*(n[r+1]-n[i+1])-(n[r]-n[i])*(n[s+1]-n[i+1])>1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:e.length/2},((t,e)=>e)).sort(((t,n)=>e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]));const t=this.collinear[0],n=this.collinear[this.collinear.length-1],i=[e[2*t],e[2*t+1],e[2*n],e[2*n+1]],r=1e-8*Math.hypot(i[3]-i[1],i[2]-i[0]);for(let t=0,n=e.length/2;t<n;++t){const n=Ym(e[2*t],e[2*t+1],r);e[2*t]=n[0],e[2*t+1]=n[1]}this._delaunator=new Nm(e)}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,r=this.triangles=this._delaunator.triangles,s=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let t=0,e=n.length;t<e;++t){const e=r[t%3==2?t-2:t+1];-1!==n[t]&&-1!==s[e]||(s[e]=t)}for(let t=0,e=i.length;t<e;++t)a[i[t]]=t;i.length<=2&&i.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],s[i[0]]=1,2===i.length&&(s[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(t){return new Vm(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:i,halfedges:r,triangles:s,collinear:a}=this;if(a){const e=a.indexOf(t);return e>0&&(yield a[e-1]),void(e<a.length-1&&(yield a[e+1]))}const o=e[t];if(-1===o)return;let l=o,u=-1;do{if(yield u=s[l],l=l%3==2?l-2:l+1,s[l]!==t)return;if(l=r[l],-1===l){const e=n[(i[t]+1)%n.length];return void(e!==u&&(yield e))}}while(l!==o)}find(t,e,n=0){if((t=+t)!=t||(e=+e)!=e)return-1;const i=n;let r;for(;(r=this._step(n,t,e))>=0&&r!==n&&r!==i;)n=r;return r}_step(t,e,n){const{inedges:i,hull:r,_hullIndex:s,halfedges:a,triangles:o,points:l}=this;if(-1===i[t]||!l.length)return(t+1)%(l.length>>1);let u=t,h=jm(e-l[2*t],2)+jm(n-l[2*t+1],2);const c=i[t];let A=c;do{let i=o[A];const c=jm(e-l[2*i],2)+jm(n-l[2*i+1],2);if(c<h&&(h=c,u=i),A=A%3==2?A-2:A+1,o[A]!==t)break;if(A=a[A],-1===A){if(A=r[(s[t]+1)%r.length],A!==i&&jm(e-l[2*A],2)+jm(n-l[2*A+1],2)<h)return A;break}}while(A!==c);return u}render(t){const e=null==t?t=new qm:void 0,{points:n,halfedges:i,triangles:r}=this;for(let e=0,s=i.length;e<s;++e){const s=i[e];if(s<e)continue;const a=2*r[e],o=2*r[s];t.moveTo(n[a],n[a+1]),t.lineTo(n[o],n[o+1])}return this.renderHull(t),e&&e.value()}renderPoints(t,e){void 0!==e||t&&"function"==typeof t.moveTo||(e=t,t=null),e=null==e?2:+e;const n=null==t?t=new qm:void 0,{points:i}=this;for(let n=0,r=i.length;n<r;n+=2){const r=i[n],s=i[n+1];t.moveTo(r+e,s),t.arc(r,s,e,0,Hm)}return n&&n.value()}renderHull(t){const e=null==t?t=new qm:void 0,{hull:n,points:i}=this,r=2*n[0],s=n.length;t.moveTo(i[r],i[r+1]);for(let e=1;e<s;++e){const r=2*n[e];t.lineTo(i[r],i[r+1])}return t.closePath(),e&&e.value()}hullPolygon(){const t=new Gm;return this.renderHull(t),t.value()}renderTriangle(t,e){const n=null==e?e=new qm:void 0,{points:i,triangles:r}=this,s=2*r[t*=3],a=2*r[t+1],o=2*r[t+2];return e.moveTo(i[s],i[s+1]),e.lineTo(i[a],i[a+1]),e.lineTo(i[o],i[o+1]),e.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:t}=this;for(let e=0,n=t.length/3;e<n;++e)yield this.trianglePolygon(e)}trianglePolygon(t){const e=new Gm;return this.renderTriangle(t,e),e.value()}}const $m=Math.PI,Zm=$m/2,Km=180/$m,Jm=$m/180,tg=Math.atan2,eg=Math.cos,ng=Math.max,ig=Math.min,rg=Math.sin,sg=Math.sign||function(t){return t>0?1:t<0?-1:0},ag=Math.sqrt;function og(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function lg(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function ug(t,e){return[t[0]+e[0],t[1]+e[1],t[2]+e[2]]}function hg(t){var e=ag(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);return[t[0]/e,t[1]/e,t[2]/e]}function cg(t){return[tg(t[1],t[0])*Km,(e=ng(-1,ig(1,t[2])),(e>1?Zm:e<-1?-Zm:Math.asin(e))*Km)];var e}function Ag(t){const e=t[0]*Jm,n=t[1]*Jm,i=eg(n);return[i*eg(e),i*rg(e),rg(n)]}function dg(t){return og((t=t.map((t=>Ag(t))))[0],lg(t[2],t[1]))}function pg(t){const e=function(t){if(t.length<2)return{};let e=0;for(;isNaN(t[e][0]+t[e][1])&&e++<t.length;);const n=function(t){function e(e){return(e=t(e[0]*qh,e[1]*qh))[0]*=zh,e[1]*=zh,e}return t=MA(t[0]*qh,t[1]*qh,t.length>2?t[2]*qh:0),e.invert=function(e){return(e=t.invert(e[0]*qh,e[1]*qh))[0]*=zh,e[1]*=zh,e},e}(t[e]),i=Rd().translate([0,0]).scale(1).rotate(n.invert([180,0]));t=t.map(i);const r=[];let s=1;for(let e=0,n=t.length;e<n;e++){let n=t[e][0]**2+t[e][1]**2;!isFinite(n)||n>1e32?r.push(e):n>s&&(s=n)}const a=1e6*ag(s);r.forEach((e=>t[e]=[a,0])),t.push([0,a]),t.push([-a,0]),t.push([0,-a]);const o=Qm.from(t);o.projection=i;const{triangles:l,halfedges:u,inedges:h}=o;for(let n=0,i=u.length;n<i;n++)if(u[n]<0){const t=n%3==2?n-2:n+1,i=n%3==0?n+2:n-1,r=u[t],s=u[i];u[r]=s,u[s]=r,u[t]=u[i]=-1,l[n]=l[t]=l[i]=e,h[l[r]]=r%3==0?r+2:r-1,h[l[s]]=s%3==0?s+2:s-1,n+=2-n%3}else l[n]>t.length-3-1&&(l[n]=e);return o}(t),n=function(t){const{triangles:e}=t;if(!e)return[];const n=[];for(let t=0,i=e.length/3;t<i;t++){const i=e[3*t],r=e[3*t+1],s=e[3*t+2];i!==r&&r!==s&&n.push([i,s,r])}return n}(e),i=function(t,e){const n=new Set;return 2===e.length?[[0,1]]:(t.forEach((t=>{if(t[0]!==t[1]&&!(dg(t.map((t=>e[t])))<0))for(let e,i=0;i<3;i++)e=(i+1)%3,n.add(wh([t[i],t[e]]).join("-"))})),Array.from(n,(t=>t.split("-").map(Number))))}(n,t),r=function(t,e){const n=[];t.forEach((t=>{for(let e=0;e<3;e++){const i=t[e],r=t[(e+1)%3];n[i]=n[i]||[],n[i].push(r)}})),0===t.length&&(2===e?(n[0]=[1],n[1]=[0]):1===e&&(n[0]=[]));return n}(n,t.length),s=function(t,e){function n(t,e){let n=t[0]-e[0],i=t[1]-e[1],r=t[2]-e[2];return n*n+i*i+r*r}return function(i,r,s){void 0===s&&(s=0);let a,o,l=s;const u=Ag([i,r]);do{a=s,s=null,o=n(u,Ag(e[a])),t[a].forEach((t=>{let i=n(u,Ag(e[t]));if(i<o)return o=i,s=t,void(l=t)}))}while(null!==s);return l}}(r,t),a=function(t,e){return t.map((t=>{const n=t.map((t=>e[t])).map(Ag);return cg(hg(ug(ug(lg(n[1],n[0]),lg(n[2],n[1])),lg(n[0],n[2]))))}))}(n,t),{polygons:o,centers:l}=function(t,e,n){const i=[],r=t.slice();if(0===e.length){if(n.length<2)return{polygons:i,centers:r};if(2===n.length){const t=Ag(n[0]),e=Ag(n[1]),s=hg(ug(t,e)),o=hg(lg(t,e)),l=lg(s,o),u=[s,lg(s,l),lg(lg(s,l),l),lg(lg(lg(s,l),l),l)].map(cg).map(a);return i.push(u),i.push(u.slice().reverse()),{polygons:i,centers:r}}}e.forEach(((t,e)=>{for(let n=0;n<3;n++){const r=t[n],s=t[(n+1)%3],a=t[(n+2)%3];i[r]=i[r]||[],i[r].push([s,a,e,[r,s,a]])}}));const s=i.map((t=>{const e=[t[0][2]];let i=t[0][1];for(let n=1;n<t.length;n++)for(let n=0;n<t.length;n++)if(t[n][0]==i){i=t[n][1],e.push(t[n][2]);break}if(e.length>2)return e;if(2==e.length){const i=fg(n[t[0][3][0]],n[t[0][3][1]],r[e[0]]),s=fg(n[t[0][3][2]],n[t[0][3][0]],r[e[0]]),o=a(i),l=a(s);return[e[0],l,e[1],o]}}));function a(t){let n=-1;return r.slice(e.length,1/0).forEach(((i,r)=>{i[0]===t[0]&&i[1]===t[1]&&(n=r+e.length)})),n<0&&(n=r.length,r.push(t)),n}return{polygons:s,centers:r}}(a,n,t),u=function(t){const e=[];return t.forEach((t=>{if(!t)return;let n=t[t.length-1];for(let i of t)i>n&&e.push([n,i]),n=i})),e}(o),h=function(t,e){const n=new Set,i=[];t.map((t=>{if(!(dg(t.map((t=>e[t>e.length?0:t])))>1e-12))for(let e=0;e<3;e++){let i=[t[e],t[(e+1)%3]],r=`${i[0]}-${i[1]}`;n.has(r)?n.delete(r):n.add(`${i[1]}-${i[0]}`)}}));const r=new Map;let s;if(n.forEach((t=>{t=t.split("-").map(Number),r.set(t[0],t[1]),s=t[0]})),void 0===s)return i;let a=s;do{i.push(a);let t=r.get(a);r.set(a,-1),a=t}while(a>-1&&a!==s);return i}(n,t),c=function(t,e){return function(n){const i=new Map,r=new Map;return t.forEach(((t,e)=>{const s=t.join("-");i.set(s,n[e]),r.set(s,!0)})),e.forEach((t=>{let e=0,n=-1;for(let r=0;r<3;r++){let s=wh([t[r],t[(r+1)%3]]).join("-");i.get(s)>e&&(e=i.get(s),n=s)}r.set(n,!1)})),t.map((t=>r.get(t.join("-"))))}}(i,n);return{delaunay:e,edges:i,triangles:n,centers:l,neighbors:r,polygons:o,mesh:u,hull:h,urquhart:c,find:s}}function fg(t,e,n){t=Ag(t),e=Ag(e),n=Ag(n);const i=sg(og(lg(e,t),n));return cg(hg(ug(t,e)).map((t=>i*t)))}function mg(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function gg(t,e,n){return e=yg(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,vg()?Reflect.construct(e,[],yg(t).constructor):e.apply(t,n))}function yg(t){return yg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},yg(t)}function vg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(vg=function(){return!!t})()}function _g(t,e){return _g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_g(t,e)}function xg(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(t)).next,0===e);else for(;!(l=(i=s.call(n)).done)&&(o.push(i.value),o.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return o}}(t,e)||Sg(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bg(t){return function(t){if(Array.isArray(t))return mg(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Sg(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sg(t,e){if(t){if("string"==typeof t)return mg(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mg(t,e):void 0}}function Mg(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).resolution,n=void 0===e?1/0:e,i=function(t,e){return t.map((function(t){var n,i=[];return t.forEach((function(t){if(n){var r=180*td(t,n)/Math.PI;if(r>e)for(var s=Ad(n,t),a=1/Math.ceil(r/e),o=a;o<1;)i.push(s(o)),o+=a}i.push(n=t)})),i}))}(t,n),r=Dh(i),s=function(t,e){var n={type:"Polygon",coordinates:t},i=uA(n),r=xg(i,2),s=xg(r[0],2),a=s[0],o=s[1],l=xg(r[1],2),u=l[0],h=l[1];if(Math.min(Math.abs(u-a),Math.abs(h-o))<e)return[];var c=a>u||h>=89||o<=-89;return function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.minLng,i=e.maxLng,r=e.minLat,s=e.maxLat,a=Math.round(Math.pow(360/t,2)/Math.PI),o=(1+Math.sqrt(5))/2,l=function(t){return t/o*360%360-180},u=function(t){return Math.acos(2*t/a-1)/Math.PI*180-90},h=function(t){return a*(Math.cos((t+90)*Math.PI/180)+1)/2},c=[void 0!==s?Math.ceil(h(s)):0,void 0!==r?Math.floor(h(r)):a-1],A=void 0===n&&void 0===i?function(){return!0}:void 0===n?function(t){return t<=i}:void 0===i?function(t){return t>=n}:i>=n?function(t){return t>=n&&t<=i}:function(t){return t>=n||t<=i},d=[],p=c[0];p<=c[1];p++){var f=l(p);A(f)&&d.push([f,u(p)])}return d}(e,{minLng:a,maxLng:u,minLat:o,maxLat:h}).filter((function(t){return wg(t,n,c)}))}(t,n),a=[].concat(bg(r),bg(s)),o={type:"Polygon",coordinates:t},l=xg(uA(o),2),u=xg(l[0],2),h=u[0],c=u[1],A=xg(l[1],2),d=A[0],p=A[1],f=h>d||p>=89||c<=-89,m=[];if(f){var g=function(t){const e=function(t){if(e.delaunay=null,e._data=t,"object"==typeof e._data&&"FeatureCollection"===e._data.type&&(e._data=e._data.features),"object"==typeof e._data){const t=e._data.map((t=>[e._vx(t),e._vy(t),t])).filter((t=>isFinite(t[0]+t[1])));e.points=t.map((t=>[t[0],t[1]])),e.valid=t.map((t=>t[2])),e.delaunay=pg(e.points)}return e};return e._vx=function(t){return"object"==typeof t&&"type"in t?xA(t)[0]:0 in t?t[0]:void 0},e._vy=function(t){return"object"==typeof t&&"type"in t?xA(t)[1]:1 in t?t[1]:void 0},e.x=function(t){return t?(e._vx=t,e):e._vx},e.y=function(t){return t?(e._vy=t,e):e._vy},e.polygons=function(t){if(void 0!==t&&e(t),!e.delaunay)return!1;const n={type:"FeatureCollection",features:[]};return 0===e.valid.length||(e.delaunay.polygons.forEach(((t,i)=>n.features.push({type:"Feature",geometry:t?{type:"Polygon",coordinates:[[...t,t[0]].map((t=>e.delaunay.centers[t]))]}:null,properties:{site:e.valid[i],sitecoordinates:e.points[i],neighbours:e.delaunay.neighbors[i]}}))),1===e.valid.length&&n.features.push({type:"Feature",geometry:{type:"Sphere"},properties:{site:e.valid[0],sitecoordinates:e.points[0],neighbours:[]}})),n},e.triangles=function(t){return void 0!==t&&e(t),!!e.delaunay&&{type:"FeatureCollection",features:e.delaunay.triangles.map(((t,n)=>((t=t.map((t=>e.points[t]))).center=e.delaunay.centers[n],t))).filter((t=>dg(t)>0)).map((t=>({type:"Feature",properties:{circumcenter:t.center},geometry:{type:"Polygon",coordinates:[[...t,t[0]]]}})))}},e.links=function(t){if(void 0!==t&&e(t),!e.delaunay)return!1;const n=e.delaunay.edges.map((t=>td(e.points[t[0]],e.points[t[1]]))),i=e.delaunay.urquhart(n);return{type:"FeatureCollection",features:e.delaunay.edges.map(((t,r)=>({type:"Feature",properties:{source:e.valid[t[0]],target:e.valid[t[1]],length:n[r],urquhart:!!i[r]},geometry:{type:"LineString",coordinates:[e.points[t[0]],e.points[t[1]]]}})))}},e.mesh=function(t){return void 0!==t&&e(t),!!e.delaunay&&{type:"MultiLineString",coordinates:e.delaunay.edges.map((t=>[e.points[t[0]],e.points[t[1]]]))}},e.cellMesh=function(t){if(void 0!==t&&e(t),!e.delaunay)return!1;const{centers:n,polygons:i}=e.delaunay,r=[];for(const t of i)if(t)for(let e=t.length,i=t[e-1],s=t[0],a=0;a<e;i=s,s=t[++a])s>i&&r.push([n[i],n[s]]);return{type:"MultiLineString",coordinates:r}},e._found=void 0,e.find=function(t,n,i){if(e._found=e.delaunay.find(t,n,e._found),!i||td([t,n],e.points[e._found])<i)return e._found},e.hull=function(t){void 0!==t&&e(t);const n=e.delaunay.hull,i=e.points;return 0===n.length?null:{type:"Polygon",coordinates:[[...n.map((t=>i[t])),i[n[0]]]]}},t?e(t):e}(a).triangles(),y=new Map(a.map((function(t,e){var n=xg(t,2),i=n[0],r=n[1];return["".concat(i,"-").concat(r),e]})));g.features.forEach((function(t){var e,n=t.geometry.coordinates[0].slice(0,3).reverse(),i=[];if(n.forEach((function(t){var e=xg(t,2),n=e[0],r=e[1],s="".concat(n,"-").concat(r);y.has(s)&&i.push(y.get(s))})),3===i.length){if(i.some((function(t){return t<r.length})))if(!wg(t.properties.circumcenter,o,f))return;(e=m).push.apply(e,i)}}))}else if(s.length)for(var v=Nm.from(a),_=function(t){var e,n=[2,1,0].map((function(e){return v.triangles[t+e]})),i=n.map((function(t){return a[t]}));if(n.some((function(t){return t<r.length}))){var s=[0,1].map((function(t){return function(t,e){let n=0,i=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,i+=e);else{let r=-1;for(let s of t)null!=(s=e(s,++r,t))&&(s=+s)>=s&&(++n,i+=s)}if(n)return i/n}(i,(function(e){return e[t]}))}));if(!wg(s,o,f))return 1}(e=m).push.apply(e,bg(n))},x=0,b=v.triangles.length;x<b;x+=3)_(x);else{var S=vh(i),M=S.vertices,w=S.holes;m=Yu(M,void 0===w?[]:w,2)}var T=ym(wh(a,(function(t){return t[0]})),[0,1]),E=ym(wh(a,(function(t){return t[1]})),[0,1]),C=a.map((function(t){var e=xg(t,2),n=e[0],i=e[1];return[T(n),E(i)]}));return{contour:i,triangles:{points:a,indices:m,uvs:C}}}function wg(t,e){return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?function(t,e){return(t&&ed.hasOwnProperty(t.type)?ed[t.type]:id)(t,e)}(e,t):km(t,e)}var Tg=window.THREE?window.THREE:{BufferGeometry:Gi,Float32BufferAttribute:Li},Eg=(new Tg.BufferGeometry).setAttribute?"setAttribute":"addAttribute",Cg=function(t){function e(t,n,i,r,s,a,o){var l;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(l=gg(this,e)).type="ConicPolygonBufferGeometry",l.parameters={polygonGeoJson:t,startHeight:n,endHeight:i,closedBottom:r,closedTop:s,includeSides:a,curvatureResolution:o},n=n||0,i=i||1,r=void 0===r||r,s=void 0===s||s,a=void 0===a||a;var u=Mg(t,{resolution:o=o||5}),h=u.contour,c=u.triangles,A=Dh(c.uvs),d=[],p=[],f=[],m=0,g=function(t){var e=Math.round(d.length/3),n=f.length;d=d.concat(t.vertices),p=p.concat(t.uvs),f=f.concat(e?t.indices.map((function(t){return t+e})):t.indices),l.addGroup(n,f.length-n,m++)};function y(t,e){var n=t.map((function(t){return t.map((function(t){var n=xg(t,2),i=n[0];return function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=(90-t)*Math.PI/180,r=(90-e)*Math.PI/180;return[n*Math.sin(i)*Math.cos(r),n*Math.cos(i),n*Math.sin(i)*Math.sin(r)]}(n[1],i,e)}))}));return vh(n)}function v(t){return{indices:!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?c.indices:c.indices.slice().reverse(),vertices:y([c.points],t).vertices,uvs:A}}return a&&g(function(){for(var t=y(h,n),e=t.vertices,r=t.holes,s=y(h,i).vertices,a=Dh([s,e]),o=Math.round(s.length/3),l=new Set(r),u=0,c=[],A=0;A<o;A++){var d=A+1;if(d===o)d=u;else if(l.has(d)){var p=d;d=u,u=p}c.push(A,A+o,d+o),c.push(d+o,d,A)}for(var f=[],m=1;m>=0;m--)for(var g=0;g<o;g+=1)f.push(g/(o-1),m);return{indices:c,vertices:a,uvs:f}}()),r&&g(v(n,!1)),s&&g(v(i,!0)),l.setIndex(f),l[Eg]("position",new Tg.Float32BufferAttribute(d,3)),l[Eg]("uv",new Tg.Float32BufferAttribute(p,2)),l.computeVertexNormals(),l}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_g(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(Tg.BufferGeometry);var Rg=function(t){var e,n=void 0!==(t=t||{})?t:{},i={};for(e in n)n.hasOwnProperty(e)&&(i[e]=n[e]);var r,s,a,o,l;r="object"==typeof window,s="function"==typeof importScripts,o="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,a=o&&!r&&!s,l=!r&&!a&&!s;var u,h,c,A,d,p="";a?(p=__dirname+"/",u=function(t,e){var n;return(n=it(t))||(A||(A=require("fs")),d||(d=require("path")),t=d.normalize(t),n=A.readFileSync(t)),e?n:n.toString()},c=function(t){var e=u(t,!0);return e.buffer||(e=new Uint8Array(e)),v(e.buffer),e},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),n.inspect=function(){return"[Emscripten Module object]"}):l?("undefined"!=typeof read&&(u=function(t){var e=it(t);return e?et(e):read(t)}),c=function(t){var e;return(e=it(t))?e:"function"==typeof readbuffer?new Uint8Array(readbuffer(t)):(v("object"==typeof(e=read(t,"binary"))),e)},"undefined"!=typeof scriptArgs&&scriptArgs,"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(r||s)&&(s?p=self.location.href:"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),p=0!==p.indexOf("blob:")?p.substr(0,p.lastIndexOf("/")+1):"",u=function(t){try{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText}catch(e){var n=it(t);if(n)return et(n);throw e}},s&&(c=function(t){try{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}catch(e){var n=it(t);if(n)return n;throw e}}),h=function(t,e,n){var i=new XMLHttpRequest;i.open("GET",t,!0),i.responseType="arraybuffer",i.onload=function(){if(200==i.status||0==i.status&&i.response)e(i.response);else{var r=it(t);r?e(r.buffer):n()}},i.onerror=n,i.send(null)});var f=n.print||console.log.bind(console),m=n.printErr||console.warn.bind(console);for(e in i)i.hasOwnProperty(e)&&(n[e]=i[e]);i=null,n.arguments&&n.arguments,n.thisProgram&&n.thisProgram;var g=0;var y=!1;function v(t,e){t||gt("Assertion failed: "+e)}function _(t){var e=n["_"+t];return v(e,"Cannot call unknown function "+t+", make sure it is exported"),e}function x(t,e,n,i,r){var s={string:function(t){var e=0;if(null!=t&&0!==t){var n=1+(t.length<<2);(function(t,e,n){(function(t,e,n,i){if(!(i>0))return 0;for(var r=n,s=n+i-1,a=0;a<t.length;++a){var o=t.charCodeAt(a);if(o>=55296&&o<=57343)o=65536+((1023&o)<<10)|1023&t.charCodeAt(++a);if(o<=127){if(n>=s)break;e[n++]=o}else if(o<=2047){if(n+1>=s)break;e[n++]=192|o>>6,e[n++]=128|63&o}else if(o<=65535){if(n+2>=s)break;e[n++]=224|o>>12,e[n++]=128|o>>6&63,e[n++]=128|63&o}else{if(n+3>=s)break;e[n++]=240|o>>18,e[n++]=128|o>>12&63,e[n++]=128|o>>6&63,e[n++]=128|63&o}}e[n]=0})(t,M,e,n)})(t,e=lt(n),n)}return e},array:function(t){var e=lt(t.length);return function(t,e){S.set(t,e)}(t,e),e}};var a=_(t),o=[],l=0;if(i)for(var u=0;u<i.length;u++){var h=s[n[u]];h?(0===l&&(l=ht()),o[u]=h(i[u])):o[u]=i[u]}var c=a.apply(null,o);return c=function(t){return"string"===e?N(t):"boolean"===e?Boolean(t):t}(c),0!==l&&ut(l),c}var b,S,M,w,T,E,C,R="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function N(t,e){return t?function(t,e,n){for(var i=e+n,r=e;t[r]&&!(r>=i);)++r;if(r-e>16&&t.subarray&&R)return R.decode(t.subarray(e,r));for(var s="";e<r;){var a=t[e++];if(128&a){var o=63&t[e++];if(192!=(224&a)){var l=63&t[e++];if((a=224==(240&a)?(15&a)<<12|o<<6|l:(7&a)<<18|o<<12|l<<6|63&t[e++])<65536)s+=String.fromCharCode(a);else{var u=a-65536;s+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else s+=String.fromCharCode((31&a)<<6|o)}else s+=String.fromCharCode(a)}return s}(M,t,e):""}function P(t,e){return t%e>0&&(t+=e-t%e),t}function D(t){b=t,n.HEAP8=S=new Int8Array(t),n.HEAP16=w=new Int16Array(t),n.HEAP32=T=new Int32Array(t),n.HEAPU8=M=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=new Uint32Array(t),n.HEAPF32=E=new Float32Array(t),n.HEAPF64=C=new Float64Array(t)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var I=n.TOTAL_MEMORY||33554432;function L(t){for(;t.length>0;){var e=t.shift();if("function"!=typeof e){var i=e.func;"number"==typeof i?void 0===e.arg?n.dynCall_v(i):n.dynCall_vi(i,e.arg):i(void 0===e.arg?null:e.arg)}else e()}}I=(b=n.buffer?n.buffer:new ArrayBuffer(I)).byteLength,D(b),T[6032]=5267040;var B=[],U=[],O=[],F=[];var k=Math.abs,z=Math.ceil,q=Math.floor,G=Math.min,V=0,H=null;n.preloadedImages={},n.preloadedAudios={};var j,W,X=null,Y="data:application/octet-stream;base64,";function Q(t){return String.prototype.startsWith?t.startsWith(Y):0===t.indexOf(Y)}X="data:application/octet-stream;base64,AAAAAAAAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAAAQAAAAQAAAADAAAABgAAAAUAAAACAAAAAAAAAAIAAAADAAAAAQAAAAQAAAAGAAAAAAAAAAUAAAADAAAABgAAAAQAAAAFAAAAAAAAAAEAAAACAAAABAAAAAUAAAAGAAAAAAAAAAIAAAADAAAAAQAAAAUAAAACAAAAAAAAAAEAAAADAAAABgAAAAQAAAAGAAAAAAAAAAUAAAACAAAAAQAAAAQAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAAAAAAEAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAYAAAAAAAAABQAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAYAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAAYAAAAAAAAAAwAAAAIAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAFAAAABAAAAAAAAAABAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAYAAAAAAAAABAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAgAAAAQAAAADAAAACAAAAAEAAAAHAAAABgAAAAkAAAAAAAAAAwAAAAIAAAACAAAABgAAAAoAAAALAAAAAAAAAAEAAAAFAAAAAwAAAA0AAAABAAAABwAAAAQAAAAMAAAAAAAAAAQAAAB/AAAADwAAAAgAAAADAAAAAAAAAAwAAAAFAAAAAgAAABIAAAAKAAAACAAAAAAAAAAQAAAABgAAAA4AAAALAAAAEQAAAAEAAAAJAAAAAgAAAAcAAAAVAAAACQAAABMAAAADAAAADQAAAAEAAAAIAAAABQAAABYAAAAQAAAABAAAAAAAAAAPAAAACQAAABMAAAAOAAAAFAAAAAEAAAAHAAAABgAAAAoAAAALAAAAGAAAABcAAAAFAAAAAgAAABIAAAALAAAAEQAAABcAAAAZAAAAAgAAAAYAAAAKAAAADAAAABwAAAANAAAAGgAAAAQAAAAPAAAAAwAAAA0AAAAaAAAAFQAAAB0AAAADAAAADAAAAAcAAAAOAAAAfwAAABEAAAAbAAAACQAAABQAAAAGAAAADwAAABYAAAAcAAAAHwAAAAQAAAAIAAAADAAAABAAAAASAAAAIQAAAB4AAAAIAAAABQAAABYAAAARAAAACwAAAA4AAAAGAAAAIwAAABkAAAAbAAAAEgAAABgAAAAeAAAAIAAAAAUAAAAKAAAAEAAAABMAAAAiAAAAFAAAACQAAAAHAAAAFQAAAAkAAAAUAAAADgAAABMAAAAJAAAAKAAAABsAAAAkAAAAFQAAACYAAAATAAAAIgAAAA0AAAAdAAAABwAAABYAAAAQAAAAKQAAACEAAAAPAAAACAAAAB8AAAAXAAAAGAAAAAsAAAAKAAAAJwAAACUAAAAZAAAAGAAAAH8AAAAgAAAAJQAAAAoAAAAXAAAAEgAAABkAAAAXAAAAEQAAAAsAAAAtAAAAJwAAACMAAAAaAAAAKgAAAB0AAAArAAAADAAAABwAAAANAAAAGwAAACgAAAAjAAAALgAAAA4AAAAUAAAAEQAAABwAAAAfAAAAKgAAACwAAAAMAAAADwAAABoAAAAdAAAAKwAAACYAAAAvAAAADQAAABoAAAAVAAAAHgAAACAAAAAwAAAAMgAAABAAAAASAAAAIQAAAB8AAAApAAAALAAAADUAAAAPAAAAFgAAABwAAAAgAAAAHgAAABgAAAASAAAANAAAADIAAAAlAAAAIQAAAB4AAAAxAAAAMAAAABYAAAAQAAAAKQAAACIAAAATAAAAJgAAABUAAAA2AAAAJAAAADMAAAAjAAAALgAAAC0AAAA4AAAAEQAAABsAAAAZAAAAJAAAABQAAAAiAAAAEwAAADcAAAAoAAAANgAAACUAAAAnAAAANAAAADkAAAAYAAAAFwAAACAAAAAmAAAAfwAAACIAAAAzAAAAHQAAAC8AAAAVAAAAJwAAACUAAAAZAAAAFwAAADsAAAA5AAAALQAAACgAAAAbAAAAJAAAABQAAAA8AAAALgAAADcAAAApAAAAMQAAADUAAAA9AAAAFgAAACEAAAAfAAAAKgAAADoAAAArAAAAPgAAABwAAAAsAAAAGgAAACsAAAA+AAAALwAAAEAAAAAaAAAAKgAAAB0AAAAsAAAANQAAADoAAABBAAAAHAAAAB8AAAAqAAAALQAAACcAAAAjAAAAGQAAAD8AAAA7AAAAOAAAAC4AAAA8AAAAOAAAAEQAAAAbAAAAKAAAACMAAAAvAAAAJgAAACsAAAAdAAAARQAAADMAAABAAAAAMAAAADEAAAAeAAAAIQAAAEMAAABCAAAAMgAAADEAAAB/AAAAPQAAAEIAAAAhAAAAMAAAACkAAAAyAAAAMAAAACAAAAAeAAAARgAAAEMAAAA0AAAAMwAAAEUAAAA2AAAARwAAACYAAAAvAAAAIgAAADQAAAA5AAAARgAAAEoAAAAgAAAAJQAAADIAAAA1AAAAPQAAAEEAAABLAAAAHwAAACkAAAAsAAAANgAAAEcAAAA3AAAASQAAACIAAAAzAAAAJAAAADcAAAAoAAAANgAAACQAAABIAAAAPAAAAEkAAAA4AAAARAAAAD8AAABNAAAAIwAAAC4AAAAtAAAAOQAAADsAAABKAAAATgAAACUAAAAnAAAANAAAADoAAAB/AAAAPgAAAEwAAAAsAAAAQQAAACoAAAA7AAAAPwAAAE4AAABPAAAAJwAAAC0AAAA5AAAAPAAAAEgAAABEAAAAUAAAACgAAAA3AAAALgAAAD0AAAA1AAAAMQAAACkAAABRAAAASwAAAEIAAAA+AAAAKwAAADoAAAAqAAAAUgAAAEAAAABMAAAAPwAAAH8AAAA4AAAALQAAAE8AAAA7AAAATQAAAEAAAAAvAAAAPgAAACsAAABUAAAARQAAAFIAAABBAAAAOgAAADUAAAAsAAAAVgAAAEwAAABLAAAAQgAAAEMAAABRAAAAVQAAADEAAAAwAAAAPQAAAEMAAABCAAAAMgAAADAAAABXAAAAVQAAAEYAAABEAAAAOAAAADwAAAAuAAAAWgAAAE0AAABQAAAARQAAADMAAABAAAAALwAAAFkAAABHAAAAVAAAAEYAAABDAAAANAAAADIAAABTAAAAVwAAAEoAAABHAAAAWQAAAEkAAABbAAAAMwAAAEUAAAA2AAAASAAAAH8AAABJAAAANwAAAFAAAAA8AAAAWAAAAEkAAABbAAAASAAAAFgAAAA2AAAARwAAADcAAABKAAAATgAAAFMAAABcAAAANAAAADkAAABGAAAASwAAAEEAAAA9AAAANQAAAF4AAABWAAAAUQAAAEwAAABWAAAAUgAAAGAAAAA6AAAAQQAAAD4AAABNAAAAPwAAAEQAAAA4AAAAXQAAAE8AAABaAAAATgAAAEoAAAA7AAAAOQAAAF8AAABcAAAATwAAAE8AAABOAAAAPwAAADsAAABdAAAAXwAAAE0AAABQAAAARAAAAEgAAAA8AAAAYwAAAFoAAABYAAAAUQAAAFUAAABeAAAAZQAAAD0AAABCAAAASwAAAFIAAABgAAAAVAAAAGIAAAA+AAAATAAAAEAAAABTAAAAfwAAAEoAAABGAAAAZAAAAFcAAABcAAAAVAAAAEUAAABSAAAAQAAAAGEAAABZAAAAYgAAAFUAAABXAAAAZQAAAGYAAABCAAAAQwAAAFEAAABWAAAATAAAAEsAAABBAAAAaAAAAGAAAABeAAAAVwAAAFMAAABmAAAAZAAAAEMAAABGAAAAVQAAAFgAAABIAAAAWwAAAEkAAABjAAAAUAAAAGkAAABZAAAAYQAAAFsAAABnAAAARQAAAFQAAABHAAAAWgAAAE0AAABQAAAARAAAAGoAAABdAAAAYwAAAFsAAABJAAAAWQAAAEcAAABpAAAAWAAAAGcAAABcAAAAUwAAAE4AAABKAAAAbAAAAGQAAABfAAAAXQAAAE8AAABaAAAATQAAAG0AAABfAAAAagAAAF4AAABWAAAAUQAAAEsAAABrAAAAaAAAAGUAAABfAAAAXAAAAE8AAABOAAAAbQAAAGwAAABdAAAAYAAAAGgAAABiAAAAbgAAAEwAAABWAAAAUgAAAGEAAAB/AAAAYgAAAFQAAABnAAAAWQAAAG8AAABiAAAAbgAAAGEAAABvAAAAUgAAAGAAAABUAAAAYwAAAFAAAABpAAAAWAAAAGoAAABaAAAAcQAAAGQAAABmAAAAUwAAAFcAAABsAAAAcgAAAFwAAABlAAAAZgAAAGsAAABwAAAAUQAAAFUAAABeAAAAZgAAAGUAAABXAAAAVQAAAHIAAABwAAAAZAAAAGcAAABbAAAAYQAAAFkAAAB0AAAAaQAAAG8AAABoAAAAawAAAG4AAABzAAAAVgAAAF4AAABgAAAAaQAAAFgAAABnAAAAWwAAAHEAAABjAAAAdAAAAGoAAABdAAAAYwAAAFoAAAB1AAAAbQAAAHEAAABrAAAAfwAAAGUAAABeAAAAcwAAAGgAAABwAAAAbAAAAGQAAABfAAAAXAAAAHYAAAByAAAAbQAAAG0AAABsAAAAXQAAAF8AAAB1AAAAdgAAAGoAAABuAAAAYgAAAGgAAABgAAAAdwAAAG8AAABzAAAAbwAAAGEAAABuAAAAYgAAAHQAAABnAAAAdwAAAHAAAABrAAAAZgAAAGUAAAB4AAAAcwAAAHIAAABxAAAAYwAAAHQAAABpAAAAdQAAAGoAAAB5AAAAcgAAAHAAAABkAAAAZgAAAHYAAAB4AAAAbAAAAHMAAABuAAAAawAAAGgAAAB4AAAAdwAAAHAAAAB0AAAAZwAAAHcAAABvAAAAcQAAAGkAAAB5AAAAdQAAAH8AAABtAAAAdgAAAHEAAAB5AAAAagAAAHYAAAB4AAAAbAAAAHIAAAB1AAAAeQAAAG0AAAB3AAAAbwAAAHMAAABuAAAAeQAAAHQAAAB4AAAAeAAAAHMAAAByAAAAcAAAAHkAAAB3AAAAdgAAAHkAAAB0AAAAeAAAAHcAAAB1AAAAcQAAAHYAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAACAAAABQAAAAEAAAAAAAAA/////wEAAAAAAAAAAwAAAAQAAAACAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAUAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABAAAAAUAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAUAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAD//////////wEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAAAAAAAAAAABAAAAAgAAAAYAAAAEAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAAAAAAAAAAAAQAAAAEAAAAFAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAAAAAAAAAAABAAAAAwAAAAcAAAAGAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADgAAAAIAAAAAAAAAAAAAAAEAAAAAAAAACQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAAAAAAAAAAAAAEAAAAEAAAACAAAAAoAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAAAAAAAAAAAAQAAAAsAAAAPAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAIAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAAAAAAAAAAAAQAAAAwAAAAQAAAADAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAAAAAAAAAAABAAAACgAAABMAAAAIAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAAAAAAAAAAAAAEAAAANAAAAEQAAAA0AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAACAAAAAAAAAAAAAAABAAAADgAAABIAAAAPAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAADwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABIAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAAAAAAAAQAAAP//////////EwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAASAAAAAAAAABgAAAAAAAAAIQAAAAAAAAAeAAAAAAAAACAAAAADAAAAMQAAAAEAAAAwAAAAAwAAADIAAAADAAAACAAAAAAAAAAFAAAABQAAAAoAAAAFAAAAFgAAAAAAAAAQAAAAAAAAABIAAAAAAAAAKQAAAAEAAAAhAAAAAAAAAB4AAAAAAAAABAAAAAAAAAAAAAAABQAAAAIAAAAFAAAADwAAAAEAAAAIAAAAAAAAAAUAAAAFAAAAHwAAAAEAAAAWAAAAAAAAABAAAAAAAAAAAgAAAAAAAAAGAAAAAAAAAA4AAAAAAAAACgAAAAAAAAALAAAAAAAAABEAAAADAAAAGAAAAAEAAAAXAAAAAwAAABkAAAADAAAAAAAAAAAAAAABAAAABQAAAAkAAAAFAAAABQAAAAAAAAACAAAAAAAAAAYAAAAAAAAAEgAAAAEAAAAKAAAAAAAAAAsAAAAAAAAABAAAAAEAAAADAAAABQAAAAcAAAAFAAAACAAAAAEAAAAAAAAAAAAAAAEAAAAFAAAAEAAAAAEAAAAFAAAAAAAAAAIAAAAAAAAABwAAAAAAAAAVAAAAAAAAACYAAAAAAAAACQAAAAAAAAATAAAAAAAAACIAAAADAAAADgAAAAEAAAAUAAAAAwAAACQAAAADAAAAAwAAAAAAAAANAAAABQAAAB0AAAAFAAAAAQAAAAAAAAAHAAAAAAAAABUAAAAAAAAABgAAAAEAAAAJAAAAAAAAABMAAAAAAAAABAAAAAIAAAAMAAAABQAAABoAAAAFAAAAAAAAAAEAAAADAAAAAAAAAA0AAAAFAAAAAgAAAAEAAAABAAAAAAAAAAcAAAAAAAAAGgAAAAAAAAAqAAAAAAAAADoAAAAAAAAAHQAAAAAAAAArAAAAAAAAAD4AAAADAAAAJgAAAAEAAAAvAAAAAwAAAEAAAAADAAAADAAAAAAAAAAcAAAABQAAACwAAAAFAAAADQAAAAAAAAAaAAAAAAAAACoAAAAAAAAAFQAAAAEAAAAdAAAAAAAAACsAAAAAAAAABAAAAAMAAAAPAAAABQAAAB8AAAAFAAAAAwAAAAEAAAAMAAAAAAAAABwAAAAFAAAABwAAAAEAAAANAAAAAAAAABoAAAAAAAAAHwAAAAAAAAApAAAAAAAAADEAAAAAAAAALAAAAAAAAAA1AAAAAAAAAD0AAAADAAAAOgAAAAEAAABBAAAAAwAAAEsAAAADAAAADwAAAAAAAAAWAAAABQAAACEAAAAFAAAAHAAAAAAAAAAfAAAAAAAAACkAAAAAAAAAKgAAAAEAAAAsAAAAAAAAADUAAAAAAAAABAAAAAQAAAAIAAAABQAAABAAAAAFAAAADAAAAAEAAAAPAAAAAAAAABYAAAAFAAAAGgAAAAEAAAAcAAAAAAAAAB8AAAAAAAAAMgAAAAAAAAAwAAAAAAAAADEAAAADAAAAIAAAAAAAAAAeAAAAAwAAACEAAAADAAAAGAAAAAMAAAASAAAAAwAAABAAAAADAAAARgAAAAAAAABDAAAAAAAAAEIAAAADAAAANAAAAAMAAAAyAAAAAAAAADAAAAAAAAAAJQAAAAMAAAAgAAAAAAAAAB4AAAADAAAAUwAAAAAAAABXAAAAAwAAAFUAAAADAAAASgAAAAMAAABGAAAAAAAAAEMAAAAAAAAAOQAAAAEAAAA0AAAAAwAAADIAAAAAAAAAGQAAAAAAAAAXAAAAAAAAABgAAAADAAAAEQAAAAAAAAALAAAAAwAAAAoAAAADAAAADgAAAAMAAAAGAAAAAwAAAAIAAAADAAAALQAAAAAAAAAnAAAAAAAAACUAAAADAAAAIwAAAAMAAAAZAAAAAAAAABcAAAAAAAAAGwAAAAMAAAARAAAAAAAAAAsAAAADAAAAPwAAAAAAAAA7AAAAAwAAADkAAAADAAAAOAAAAAMAAAAtAAAAAAAAACcAAAAAAAAALgAAAAMAAAAjAAAAAwAAABkAAAAAAAAAJAAAAAAAAAAUAAAAAAAAAA4AAAADAAAAIgAAAAAAAAATAAAAAwAAAAkAAAADAAAAJgAAAAMAAAAVAAAAAwAAAAcAAAADAAAANwAAAAAAAAAoAAAAAAAAABsAAAADAAAANgAAAAMAAAAkAAAAAAAAABQAAAAAAAAAMwAAAAMAAAAiAAAAAAAAABMAAAADAAAASAAAAAAAAAA8AAAAAwAAAC4AAAADAAAASQAAAAMAAAA3AAAAAAAAACgAAAAAAAAARwAAAAMAAAA2AAAAAwAAACQAAAAAAAAAQAAAAAAAAAAvAAAAAAAAACYAAAADAAAAPgAAAAAAAAArAAAAAwAAAB0AAAADAAAAOgAAAAMAAAAqAAAAAwAAABoAAAADAAAAVAAAAAAAAABFAAAAAAAAADMAAAADAAAAUgAAAAMAAABAAAAAAAAAAC8AAAAAAAAATAAAAAMAAAA+AAAAAAAAACsAAAADAAAAYQAAAAAAAABZAAAAAwAAAEcAAAADAAAAYgAAAAMAAABUAAAAAAAAAEUAAAAAAAAAYAAAAAMAAABSAAAAAwAAAEAAAAAAAAAASwAAAAAAAABBAAAAAAAAADoAAAADAAAAPQAAAAAAAAA1AAAAAwAAACwAAAADAAAAMQAAAAMAAAApAAAAAwAAAB8AAAADAAAAXgAAAAAAAABWAAAAAAAAAEwAAAADAAAAUQAAAAMAAABLAAAAAAAAAEEAAAAAAAAAQgAAAAMAAAA9AAAAAAAAADUAAAADAAAAawAAAAAAAABoAAAAAwAAAGAAAAADAAAAZQAAAAMAAABeAAAAAAAAAFYAAAAAAAAAVQAAAAMAAABRAAAAAwAAAEsAAAAAAAAAOQAAAAAAAAA7AAAAAAAAAD8AAAADAAAASgAAAAAAAABOAAAAAwAAAE8AAAADAAAAUwAAAAMAAABcAAAAAwAAAF8AAAADAAAAJQAAAAAAAAAnAAAAAwAAAC0AAAADAAAANAAAAAAAAAA5AAAAAAAAADsAAAAAAAAARgAAAAMAAABKAAAAAAAAAE4AAAADAAAAGAAAAAAAAAAXAAAAAwAAABkAAAADAAAAIAAAAAMAAAAlAAAAAAAAACcAAAADAAAAMgAAAAMAAAA0AAAAAAAAADkAAAAAAAAALgAAAAAAAAA8AAAAAAAAAEgAAAADAAAAOAAAAAAAAABEAAAAAwAAAFAAAAADAAAAPwAAAAMAAABNAAAAAwAAAFoAAAADAAAAGwAAAAAAAAAoAAAAAwAAADcAAAADAAAAIwAAAAAAAAAuAAAAAAAAADwAAAAAAAAALQAAAAMAAAA4AAAAAAAAAEQAAAADAAAADgAAAAAAAAAUAAAAAwAAACQAAAADAAAAEQAAAAMAAAAbAAAAAAAAACgAAAADAAAAGQAAAAMAAAAjAAAAAAAAAC4AAAAAAAAARwAAAAAAAABZAAAAAAAAAGEAAAADAAAASQAAAAAAAABbAAAAAwAAAGcAAAADAAAASAAAAAMAAABYAAAAAwAAAGkAAAADAAAAMwAAAAAAAABFAAAAAwAAAFQAAAADAAAANgAAAAAAAABHAAAAAAAAAFkAAAAAAAAANwAAAAMAAABJAAAAAAAAAFsAAAADAAAAJgAAAAAAAAAvAAAAAwAAAEAAAAADAAAAIgAAAAMAAAAzAAAAAAAAAEUAAAADAAAAJAAAAAMAAAA2AAAAAAAAAEcAAAAAAAAAYAAAAAAAAABoAAAAAAAAAGsAAAADAAAAYgAAAAAAAABuAAAAAwAAAHMAAAADAAAAYQAAAAMAAABvAAAAAwAAAHcAAAADAAAATAAAAAAAAABWAAAAAwAAAF4AAAADAAAAUgAAAAAAAABgAAAAAAAAAGgAAAAAAAAAVAAAAAMAAABiAAAAAAAAAG4AAAADAAAAOgAAAAAAAABBAAAAAwAAAEsAAAADAAAAPgAAAAMAAABMAAAAAAAAAFYAAAADAAAAQAAAAAMAAABSAAAAAAAAAGAAAAAAAAAAVQAAAAAAAABXAAAAAAAAAFMAAAADAAAAZQAAAAAAAABmAAAAAwAAAGQAAAADAAAAawAAAAMAAABwAAAAAwAAAHIAAAADAAAAQgAAAAAAAABDAAAAAwAAAEYAAAADAAAAUQAAAAAAAABVAAAAAAAAAFcAAAAAAAAAXgAAAAMAAABlAAAAAAAAAGYAAAADAAAAMQAAAAAAAAAwAAAAAwAAADIAAAADAAAAPQAAAAMAAABCAAAAAAAAAEMAAAADAAAASwAAAAMAAABRAAAAAAAAAFUAAAAAAAAAXwAAAAAAAABcAAAAAAAAAFMAAAAAAAAATwAAAAAAAABOAAAAAAAAAEoAAAADAAAAPwAAAAEAAAA7AAAAAwAAADkAAAADAAAAbQAAAAAAAABsAAAAAAAAAGQAAAAFAAAAXQAAAAEAAABfAAAAAAAAAFwAAAAAAAAATQAAAAEAAABPAAAAAAAAAE4AAAAAAAAAdQAAAAQAAAB2AAAABQAAAHIAAAAFAAAAagAAAAEAAABtAAAAAAAAAGwAAAAAAAAAWgAAAAEAAABdAAAAAQAAAF8AAAAAAAAAWgAAAAAAAABNAAAAAAAAAD8AAAAAAAAAUAAAAAAAAABEAAAAAAAAADgAAAADAAAASAAAAAEAAAA8AAAAAwAAAC4AAAADAAAAagAAAAAAAABdAAAAAAAAAE8AAAAFAAAAYwAAAAEAAABaAAAAAAAAAE0AAAAAAAAAWAAAAAEAAABQAAAAAAAAAEQAAAAAAAAAdQAAAAMAAABtAAAABQAAAF8AAAAFAAAAcQAAAAEAAABqAAAAAAAAAF0AAAAAAAAAaQAAAAEAAABjAAAAAQAAAFoAAAAAAAAAaQAAAAAAAABYAAAAAAAAAEgAAAAAAAAAZwAAAAAAAABbAAAAAAAAAEkAAAADAAAAYQAAAAEAAABZAAAAAwAAAEcAAAADAAAAcQAAAAAAAABjAAAAAAAAAFAAAAAFAAAAdAAAAAEAAABpAAAAAAAAAFgAAAAAAAAAbwAAAAEAAABnAAAAAAAAAFsAAAAAAAAAdQAAAAIAAABqAAAABQAAAFoAAAAFAAAAeQAAAAEAAABxAAAAAAAAAGMAAAAAAAAAdwAAAAEAAAB0AAAAAQAAAGkAAAAAAAAAdwAAAAAAAABvAAAAAAAAAGEAAAAAAAAAcwAAAAAAAABuAAAAAAAAAGIAAAADAAAAawAAAAEAAABoAAAAAwAAAGAAAAADAAAAeQAAAAAAAAB0AAAAAAAAAGcAAAAFAAAAeAAAAAEAAAB3AAAAAAAAAG8AAAAAAAAAcAAAAAEAAABzAAAAAAAAAG4AAAAAAAAAdQAAAAEAAABxAAAABQAAAGkAAAAFAAAAdgAAAAEAAAB5AAAAAAAAAHQAAAAAAAAAcgAAAAEAAAB4AAAAAQAAAHcAAAAAAAAAcgAAAAAAAABwAAAAAAAAAGsAAAAAAAAAZAAAAAAAAABmAAAAAAAAAGUAAAADAAAAUwAAAAEAAABXAAAAAwAAAFUAAAADAAAAdgAAAAAAAAB4AAAAAAAAAHMAAAAFAAAAbAAAAAEAAAByAAAAAAAAAHAAAAAAAAAAXAAAAAEAAABkAAAAAAAAAGYAAAAAAAAAdQAAAAAAAAB5AAAABQAAAHcAAAAFAAAAbQAAAAEAAAB2AAAAAAAAAHgAAAAAAAAAXwAAAAEAAABsAAAAAQAAAHIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAGAAAAAgAAAAUAAAABAAAABAAAAAAAAAAAAAAABQAAAAMAAAABAAAABgAAAAQAAAACAAAAAAAAAH6iBfbytuk/Gq6akm/58z/Xrm0Liez0P5doSdOpSwRAWs602ULg8D/dT7Rcbo/1v1N1RQHFNOM/g9Snx7HW3L8HWsP8Q3jfP6VwOLosutk/9rjk1YQcxj+gnmKMsNn6P/HDeuPFY+M/YHwDjqKhB0Ci19/fCVrbP4UxKkDWOP6/pvljWa09tL9wi7wrQXjnv/Z6yLImkM2/3yTlOzY14D+m+WNZrT20PzwKVQnrQwNA9nrIsiaQzT/g40rFrRQFwPa45NWEHMa/kbslHEZq97/xw3rjxWPjv4cLC2SMBci/otff3wla27+rKF5oIAv0P1N1RQHFNOO/iDJPGyWHBUAHWsP8Q3jfvwQf/by16gXAfqIF9vK26b8XrO0Vh0r+v9eubQuJ7PS/BxLrA0ZZ479azrTZQuDwv1MK1EuItPw/yscgV9Z6FkAwHBR2WjQMQJNRzXsQ5vY/GlUHVJYKF0DONuFv2lMNQNCGZ28QJfk/0WUwoIL36D8ggDOMQuATQNqMOeAy/wZAWFYOYM+M2z/LWC4uH3oSQDE+LyTsMgRAkJzhRGWFGEDd4soovCQQQKqk0DJMEP8/rGmNdwOLBUAW2X/9xCbjP4hu3dcqJhNAzuYItRvdB0CgzW3zJW/sPxotm/Y2TxRAQAk9XmdDDEC1Kx9MKgT3P1M+NctcghZAFVqcLlb0C0Bgzd3sB2b2P77mZDPUWhZAFROHJpUGCEDAfma5CxXtPz1DWq/zYxRAmhYY5824F0DOuQKWSbAOQNCMqrvu3fs/L6DR22K2wT9nAAxPBU8RQGiN6mW43AFAZhu25b633D8c1YgmzowSQNM25BRKWARArGS08/lNxD+LFssHwmMRQLC5aNcxBgJABL9HT0WRF0CjCmJmOGEOQHsuaVzMP/s/TWJCaGGwBUCeu1PAPLzjP9nqN9DZOBNAKE4JcydbCkCGtbd1qjPzP8dgm9U8jhVAtPeKTkVwDkCeCLss5l37P401XMPLmBdAFd29VMVQDUBg0yA55h75Pz6odcYLCRdApBM4rBrkAkDyAVWgQxbRP4XDMnK20hFAymLlF7EmzD8GUgo9XBHlP3lbK7T9COc/k+OhPthhy7+YGEpnrOvCPzBFhLs15u4/epbqB6H4uz9IuuLF5svev6lzLKY31es/CaQ0envF5z8ZY0xlUADXv7zaz7HYEuI/CfbK1sn16T8uAQfWwxLWPzKn/YuFN94/5KdbC1AFu793fyCSnlfvPzK2y4doAMY/NRg5t1/X6b/shq4QJaHDP5yNIAKPOeI/vpn7BSE30r/X4YQrO6nrv78Ziv/Thto/DqJ1Y6+y5z9l51NaxFrlv8QlA65HOLS/86dxiEc96z+Hj0+LFjneP6LzBZ8LTc2/DaJ1Y6+y579l51NaxFrlP8QlA65HOLQ/8qdxiEc967+Jj0+LFjnev6LzBZ8LTc0/1qdbC1AFuz93fyCSnlfvvzK2y4doAMa/NRg5t1/X6T/vhq4QJaHDv5yNIAKPOeK/wJn7BSE30j/W4YQrO6nrP78Ziv/Thtq/CaQ0envF578XY0xlUADXP7zaz7HYEuK/CvbK1sn16b8rAQfWwxLWvzKn/YuFN96/zWLlF7EmzL8GUgo9XBHlv3lbK7T9COe/kOOhPthhyz+cGEpnrOvCvzBFhLs15u6/c5bqB6H4u79IuuLF5sveP6lzLKY31eu/AQAAAP////8HAAAA/////zEAAAD/////VwEAAP////9hCQAA/////6dBAAD/////kcsBAP/////3kAwA/////8H2VwAAAAAAAAAAAAAAAAACAAAA/////w4AAAD/////YgAAAP////+uAgAA/////8ISAAD/////ToMAAP////8ilwMA/////+4hGQD/////gu2vAAAAAAAAAAAAAAAAAAAAAAACAAAA//////////8BAAAAAwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////AgAAAP//////////AQAAAAAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD/////////////////////AQAAAP///////////////wIAAAD///////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP///////////////////////////////wIAAAD///////////////8BAAAA/////////////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAABAAAA//////////8CAAAA//////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAAAQAAAP//////////AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAACAAAAAAAAAAIAAAABAAAAAQAAAAIAAAACAAAAAAAAAAUAAAAFAAAAAAAAAAIAAAACAAAAAwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAAEAAAACAAAAAgAAAAIAAAAAAAAABQAAAAYAAAAAAAAAAgAAAAIAAAADAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAAAAAACAAAAAQAAAAMAAAACAAAAAgAAAAAAAAAFAAAABwAAAAAAAAACAAAAAgAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAACAAAAAAAAAAIAAAABAAAABAAAAAIAAAACAAAAAAAAAAUAAAAIAAAAAAAAAAIAAAACAAAAAwAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAIAAAAAAAAAAgAAAAEAAAAAAAAAAgAAAAIAAAAAAAAABQAAAAkAAAAAAAAAAgAAAAIAAAADAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAIAAAAAAAAAAwAAAA4AAAACAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAgAAAAMAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAgAAAAAAAAADAAAACgAAAAIAAAAAAAAAAgAAAAMAAAABAAAAAAAAAAIAAAACAAAAAwAAAAcAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAIAAAACAAAAAAAAAAMAAAALAAAAAgAAAAAAAAACAAAAAwAAAAIAAAAAAAAAAgAAAAIAAAADAAAACAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAgAAAAIAAAAAAAAAAwAAAAwAAAACAAAAAAAAAAIAAAADAAAAAwAAAAAAAAACAAAAAgAAAAMAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAACAAAAAgAAAAAAAAADAAAADQAAAAIAAAAAAAAAAgAAAAMAAAAEAAAAAAAAAAIAAAACAAAAAwAAAAoAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAIAAAACAAAAAAAAAAMAAAAGAAAAAgAAAAAAAAACAAAAAwAAAA8AAAAAAAAAAgAAAAIAAAADAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAIAAAAAAAAAAwAAAAcAAAACAAAAAAAAAAIAAAADAAAAEAAAAAAAAAACAAAAAgAAAAMAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAACAAAAAgAAAAAAAAADAAAACAAAAAIAAAAAAAAAAgAAAAMAAAARAAAAAAAAAAIAAAACAAAAAwAAAA0AAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAACAAAAAAAAAAMAAAAJAAAAAgAAAAAAAAACAAAAAwAAABIAAAAAAAAAAgAAAAIAAAADAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAgAAAAIAAAAAAAAAAwAAAAUAAAACAAAAAAAAAAIAAAADAAAAEwAAAAAAAAACAAAAAgAAAAMAAAAPAAAAAAAAAAAAAAAAAAAAAAAAABAAAAACAAAAAAAAAAIAAAABAAAAEwAAAAIAAAACAAAAAAAAAAUAAAAKAAAAAAAAAAIAAAACAAAAAwAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAIAAAAAAAAAAgAAAAEAAAAPAAAAAgAAAAIAAAAAAAAABQAAAAsAAAAAAAAAAgAAAAIAAAADAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAgAAAAAAAAACAAAAAQAAABAAAAACAAAAAgAAAAAAAAAFAAAADAAAAAAAAAACAAAAAgAAAAMAAAASAAAAAAAAAAAAAAAAAAAAAAAAABMAAAACAAAAAAAAAAIAAAABAAAAEQAAAAIAAAACAAAAAAAAAAUAAAANAAAAAAAAAAIAAAACAAAAAwAAABMAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAIAAAAAAAAAAgAAAAEAAAASAAAAAgAAAAIAAAAAAAAABQAAAA4AAAAAAAAAAgAAAAIAAAADAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAOgehWlKfUEEz1zLi+JsiQa2og3wcMfVAWCbHorc0yEDi+Yn/Y6mbQJ11/mfsnG9At6bnG4UQQkBvMCQWKqUUQJVmwwswmOc/3hVgVBL3uj//qqOEOdGOPw/WDN4gnGE/H3ANkCUgND+AA8btKgAHPwTXBqJVSdo+XfRQAqsKrj4fc+zLYbSPQklEmCZHv2FCUP+uDso1NEKYtPhwphUHQptxnyFXYdpB7CddZAMmrkGAt1AxSTqBQUibBVdTsFNBSuX3MV+AJkFocv82SLf5QAqmgj7AY81A23VDSEnLoEDGEJVSeDFzQDYrqvBk70VA8U157pcRGUBWfEF+ZKbsP7KBdLHZTpFAqKYk69AqekDbeGY41MdjQD8AZzHK501A1vcrrjubNkD5LnquvBYhQCbiRRD71QlAqt72EbOH8z8Eu+jL1YbdP4uaox/xUcY/abedg1XfsD+BsUdzJ4KZP5wE9YFySIM/rW1kAKMpbT+rZFthVRhWPy4PKlXIs0A/qMZLlwDnMEHByqEF0I0ZQQYSFD8lUQNBPpY+dFs07UAH8BZImBPWQN9RY0I0sMBA2T7kLfc6qUByFYvfhBKTQMq+0Mis1XxA0XQbeQXMZUBJJ5aEGXpQQP7/SY0a6ThAaMD92b/UIkAs8s8yqXoMQNIegOvCk/U/aOi7NZJP4D8AAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAD/////AAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAA/////wAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAP////8AAAAABQAAAAAAAAAAAAAAAAAAAAAAAAD/////BQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAABAAAAAAAAAAUAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAEAAQAAAQEAAAAAAAEAAAABAAAAAQABAAAAAAAAAAAAAAAAAAAAAAcAAAAHAAAAAQAAAAIAAAAEAAAAAwAAAAAAAAAAAAAABwAAAAMAAAABAAAAAgAAAAUAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAACAAAAAQAAAAMAAAAOAAAABgAAAAsAAAACAAAABwAAAAEAAAAYAAAABQAAAAoAAAABAAAABgAAAAAAAAAmAAAABwAAAAwAAAADAAAACAAAAAIAAAAxAAAACQAAAA4AAAAAAAAABQAAAAQAAAA6AAAACAAAAA0AAAAEAAAACQAAAAMAAAA/AAAACwAAAAYAAAAPAAAACgAAABAAAABIAAAADAAAAAcAAAAQAAAACwAAABEAAABTAAAACgAAAAUAAAATAAAADgAAAA8AAABhAAAADQAAAAgAAAARAAAADAAAABIAAABrAAAADgAAAAkAAAASAAAADQAAABMAAAB1AAAADwAAABMAAAARAAAAEgAAABAAAAAGAAAAAgAAAAMAAAAFAAAABAAAAAAAAAAAAAAAAAAAAAYAAAACAAAAAwAAAAEAAAAFAAAABAAAAAAAAAAAAAAABwAAAAUAAAADAAAABAAAAAEAAAAAAAAAAgAAAAAAAAACAAAAAwAAAAEAAAAFAAAABAAAAAYAAAAAAAAAAAAAAGFsZ29zLmMAaDNOZWlnaGJvclJvdGF0aW9ucwBjb29yZGlqay5jAF91cEFwN0NoZWNrZWQAX3VwQXA3ckNoZWNrZWQAZGlyZWN0ZWRFZGdlLmMAZGlyZWN0ZWRFZGdlVG9Cb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbdG1wRmlqay5mYWNlXVtmaWprLmZhY2VdID09IEtJAGZhY2VpamsuYwBfZmFjZUlqa1BlbnRUb0NlbGxCb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbY2VudGVySUpLLmZhY2VdW2ZhY2UyXSA9PSBLSQBfZmFjZUlqa1RvQ2VsbEJvdW5kYXJ5AGgzSW5kZXguYwBjb21wYWN0Q2VsbHMAbGF0TG5nVG9DZWxsAGNlbGxUb0NoaWxkUG9zAHZhbGlkYXRlQ2hpbGRQb3MAbGF0TG5nLmMAY2VsbEFyZWFSYWRzMgBwb2x5Z29uLT5uZXh0ID09IE5VTEwAbGlua2VkR2VvLmMAYWRkTmV3TGlua2VkUG9seWdvbgBuZXh0ICE9IE5VTEwAbG9vcCAhPSBOVUxMAGFkZE5ld0xpbmtlZExvb3AAcG9seWdvbi0+Zmlyc3QgPT0gTlVMTABhZGRMaW5rZWRMb29wAGNvb3JkICE9IE5VTEwAYWRkTGlua2VkQ29vcmQAbG9vcC0+Zmlyc3QgPT0gTlVMTABpbm5lckxvb3BzICE9IE5VTEwAbm9ybWFsaXplTXVsdGlQb2x5Z29uAGJib3hlcyAhPSBOVUxMAGNhbmRpZGF0ZXMgIT0gTlVMTABmaW5kUG9seWdvbkZvckhvbGUAY2FuZGlkYXRlQkJveGVzICE9IE5VTEwAcmV2RGlyICE9IElOVkFMSURfRElHSVQAbG9jYWxpai5jAGNlbGxUb0xvY2FsSWprAGJhc2VDZWxsICE9IG9yaWdpbkJhc2VDZWxsACEob3JpZ2luT25QZW50ICYmIGluZGV4T25QZW50KQBiYXNlQ2VsbCA9PSBvcmlnaW5CYXNlQ2VsbABiYXNlQ2VsbCAhPSBJTlZBTElEX0JBU0VfQ0VMTABsb2NhbElqa1RvQ2VsbAAhX2lzQmFzZUNlbGxQZW50YWdvbihiYXNlQ2VsbCkAYmFzZUNlbGxSb3RhdGlvbnMgPj0gMABncmlkUGF0aENlbGxzADAAdmVydGV4LmMAY2VsbFRvVmVydGV4AGdyYXBoLT5idWNrZXRzICE9IE5VTEwAdmVydGV4R3JhcGguYwBpbml0VmVydGV4R3JhcGgAbm9kZSAhPSBOVUxMAGFkZFZlcnRleE5vZGU=";function $(t){return t}function Z(t){return t.replace(/\b__Z[\w\d_]+/g,(function(t){return t===t?t:t+" ["+t+"]"}))}function K(){var t=new Error;if(!t.stack){try{throw new Error(0)}catch(e){t=e}if(!t.stack)return"(no stack trace available)"}return t.stack.toString()}function J(){return S.length}function tt(t){try{var e=new ArrayBuffer(t);if(e.byteLength!=t)return;return new Int8Array(e).set(S),st(e),D(e),1}catch(t){}}function et(t){for(var e=[],n=0;n<t.length;n++){var i=t[n];i>255&&(i&=255),e.push(String.fromCharCode(i))}return e.join("")}var nt="function"==typeof atob?atob:function(t){var e,n,i,r,s,a,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l="",u=0;t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{e=o.indexOf(t.charAt(u++))<<2|(r=o.indexOf(t.charAt(u++)))>>4,n=(15&r)<<4|(s=o.indexOf(t.charAt(u++)))>>2,i=(3&s)<<6|(a=o.indexOf(t.charAt(u++))),l+=String.fromCharCode(e),64!==s&&(l+=String.fromCharCode(n)),64!==a&&(l+=String.fromCharCode(i))}while(u<t.length);return l};function it(t){if(Q(t))return function(t){if("boolean"==typeof a&&a){var e;try{e=Buffer.from(t,"base64")}catch(n){e=new Buffer(t,"base64")}return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}try{for(var n=nt(t),i=new Uint8Array(n.length),r=0;r<n.length;++r)i[r]=n.charCodeAt(r);return i}catch(t){throw new Error("Converting base64 string to bytes failed.")}}(t.slice(Y.length))}var rt=function(t,e,n){var i=new t.Int8Array(n),r=new t.Int32Array(n);new t.Uint8Array(n),new t.Float32Array(n);var s=new t.Float64Array(n),a=0|e.o,o=0|e.p,l=t.Math.floor,u=t.Math.abs,h=t.Math.sqrt,c=t.Math.pow,A=t.Math.cos,d=t.Math.sin,p=t.Math.tan,f=t.Math.acos,m=t.Math.asin,g=t.Math.atan,y=t.Math.atan2,v=t.Math.ceil,_=t.Math.imul,x=t.Math.min,b=t.Math.max,S=t.Math.clz32,M=e.b,w=e.c,T=e.d,E=e.e,C=e.f,R=e.g,N=e.h,P=e.i,D=24160;function I(t,e,n,i){return 0|L(t|=0,e|=0,n|=0,i|=0,0)}function L(t,e,n,i,s){var a,o=0,l=0,u=0,h=0;if(a=D,D=D+16|0,l=a,!(0|B(t|=0,e|=0,n|=0,i|=0,s|=0)))return D=a,0|(i=0);do{if((0|n)>=0){if((0|n)>13780509){if(0|(o=0|ee(15,l)))break;l=0|r[(u=l)>>2],u=0|r[u+4>>2]}else h=0|Oe(0|n,0|(o=((0|n)<0)<<31>>31),3,0),u=0|w(),o=0|De(0|n,0|o,1,0),o=0|De(0|(o=0|Oe(0|h,0|u,0|o,0|w())),0|w(),1,0),u=0|w(),r[l>>2]=o,r[l+4>>2]=u,l=o;if(Xe(0|i,0,l<<3),0|s){Xe(0|s,0,l<<2),o=0|U(t,e,n,i,s,l,u,0);break}(o=0|Pe(l,4))?(h=0|U(t,e,n,i,o,l,u,0),Ne(o),o=h):o=13}else o=2}while(0);return D=a,0|(h=o)}function B(t,e,n,i,s){t|=0,e|=0,n|=0,i|=0,s|=0;var a,o,l=0,u=0,h=0,c=0,A=0,d=0,p=0,f=0,m=0;if(o=D,D=D+16|0,m=o+8|0,r[(f=a=o)>>2]=t,r[f+4>>2]=e,(0|n)<0)return D=o,0|(m=2);if(r[(l=i)>>2]=t,r[l+4>>2]=e,(l=!!(0|s))&&(r[s>>2]=0),0|Ot(t,e))return D=o,0|(m=9);r[m>>2]=0;t:do{if((0|n)>=1)if(l)for(d=1,A=0,p=0,f=1,l=t;;){if(!(A|p)){if(0|(l=0|O(l,e,4,m,a)))break t;if(0|Ot(l=0|r[(e=a)>>2],e=0|r[e+4>>2])){l=9;break t}}if(0|(l=0|O(l,e,0|r[22384+(p<<2)>>2],m,a)))break t;if(l=0|r[(e=a)>>2],e=0|r[e+4>>2],r[(t=i+(d<<3)|0)>>2]=l,r[t+4>>2]=e,r[s+(d<<2)>>2]=f,u=(0|(t=A+1|0))==(0|f),c=6==(0|(h=p+1|0)),0|Ot(l,e)){l=9;break t}if((0|(f=f+(c&u&1)|0))>(0|n)){l=0;break}d=d+1|0,A=u?0:t,p=u?c?0:h:p}else for(d=1,A=0,p=0,f=1,l=t;;){if(!(A|p)){if(0|(l=0|O(l,e,4,m,a)))break t;if(0|Ot(l=0|r[(e=a)>>2],e=0|r[e+4>>2])){l=9;break t}}if(0|(l=0|O(l,e,0|r[22384+(p<<2)>>2],m,a)))break t;if(l=0|r[(e=a)>>2],e=0|r[e+4>>2],r[(t=i+(d<<3)|0)>>2]=l,r[t+4>>2]=e,u=(0|(t=A+1|0))==(0|f),c=6==(0|(h=p+1|0)),0|Ot(l,e)){l=9;break t}if((0|(f=f+(c&u&1)|0))>(0|n)){l=0;break}d=d+1|0,A=u?0:t,p=u?c?0:h:p}else l=0}while(0);return D=o,0|(m=l)}function U(t,e,n,i,s,a,o,l){n|=0,i|=0,s|=0,l|=0;var u,h,c,A=0,d=0,p=0,f=0,m=0,g=0,y=0;if(c=D,D=D+16|0,u=c+8|0,h=c,A=0|ke(0|(t|=0),0|(e|=0),0|(a|=0),0|(o|=0)),p=0|w(),!(!(0|(y=0|r[(g=f=i+(A<<3)|0)>>2]))&!(0|(g=0|r[g+4>>2]))|(d=(0|y)==(0|t)&(0|g)==(0|e))))do{A=0|Fe(0|(A=0|De(0|A,0|p,1,0)),0|w(),0|a,0|o),p=0|w(),d=(0|(g=0|r[(y=f=i+(A<<3)|0)>>2]))==(0|t)&(0|(y=0|r[y+4>>2]))==(0|e)}while(!(!(0|g)&!(0|y)|d));if(A=s+(A<<2)|0,d&&(0|r[A>>2])<=(0|l))return D=c,0|(y=0);if(r[(y=f)>>2]=t,r[y+4>>2]=e,r[A>>2]=l,(0|l)>=(0|n))return D=c,0|(y=0);switch(d=l+1|0,r[u>>2]=0,0|(A=0|O(t,e,2,u,h))){case 9:m=9;break;case 0:(A=0|U(0|r[(A=h)>>2],0|r[A+4>>2],n,i,s,a,o,d))||(m=9)}t:do{if(9==(0|m)){switch(r[u>>2]=0,0|(A=0|O(t,e,3,u,h))){case 9:break;case 0:if(0|(A=0|U(0|r[(A=h)>>2],0|r[A+4>>2],n,i,s,a,o,d)))break t;break;default:break t}switch(r[u>>2]=0,0|(A=0|O(t,e,1,u,h))){case 9:break;case 0:if(0|(A=0|U(0|r[(A=h)>>2],0|r[A+4>>2],n,i,s,a,o,d)))break t;break;default:break t}switch(r[u>>2]=0,0|(A=0|O(t,e,5,u,h))){case 9:break;case 0:if(0|(A=0|U(0|r[(A=h)>>2],0|r[A+4>>2],n,i,s,a,o,d)))break t;break;default:break t}switch(r[u>>2]=0,0|(A=0|O(t,e,4,u,h))){case 9:break;case 0:if(0|(A=0|U(0|r[(A=h)>>2],0|r[A+4>>2],n,i,s,a,o,d)))break t;break;default:break t}switch(r[u>>2]=0,0|(A=0|O(t,e,6,u,h))){case 9:break;case 0:if(0|(A=0|U(0|r[(A=h)>>2],0|r[A+4>>2],n,i,s,a,o,d)))break t;break;default:break t}return D=c,0|(y=0)}}while(0);return D=c,0|(y=A)}function O(t,e,n,i,s){t|=0,e|=0,s|=0;var a,o,l=0,u=0,h=0,c=0,A=0,d=0,p=0;if((n|=0)>>>0>6)return 0|(s=1);if(A=(0|r[(i|=0)>>2])%6|0,r[i>>2]=A,(0|A)>0){l=0;do{n=0|pt(n),l=l+1|0}while((0|l)<(0|r[i>>2]))}if(A=0|qe(0|t,0|e,45),w(),(o=127&A)>>>0>121)return 0|(s=5);a=0|Ft(t,e),l=0|qe(0|t,0|e,52),w(),l&=15;t:do{if(l){for(;;){if(h=0|qe(0|t,0|e,0|(u=3*(15-l|0)|0)),w(),7==(0|(h&=7))){e=5;break}if(p=!(0|Vt(l)),l=l+-1|0,d=0|Ge(7,0,0|u),e&=~w(),t=0|Ge(0|r[(p?432:16)+(28*h|0)+(n<<2)>>2],0,0|u)|t&~d,e|=u=0|w(),!(n=0|r[(p?640:224)+(28*h|0)+(n<<2)>>2])){n=0;break t}if(!l){c=8;break t}}return 0|e}c=8}while(0);8==(0|c)&&(t|=0|Ge(0|(p=0|r[848+(28*o|0)+(n<<2)>>2]),0,45),e=w()|-1040385&e,n=0|r[4272+(28*o|0)+(n<<2)>>2],127&~p||(p=0|Ge(0|r[848+(28*o|0)+20>>2],0,45),e=w()|-1040385&e,n=0|r[4272+(28*o|0)+20>>2],t=0|zt(p|t,e),e=0|w(),r[i>>2]=1+(0|r[i>>2]))),h=0|qe(0|t,0|e,45),w(),h&=127;t:do{if(0|z(h)){e:do{if(1==(0|Ft(t,e))){if((0|o)!=(0|h)){if(0|H(h,0|r[7696+(28*o|0)>>2])){t=0|Gt(t,e),u=1,e=0|w();break}T(23313,22416,436,22424)}switch(0|a){case 3:t=0|zt(t,e),e=0|w(),r[i>>2]=1+(0|r[i>>2]),u=0;break e;case 5:t=0|Gt(t,e),e=0|w(),r[i>>2]=5+(0|r[i>>2]),u=0;break e;case 0:return 0|(p=9);default:return 0|(p=1)}}else u=0}while(0);if((0|n)>0){l=0;do{t=0|kt(t,e),e=0|w(),l=l+1|0}while((0|l)!=(0|n))}if((0|o)!=(0|h)){if(!(0|q(h))){if(!!(0|u)|5!=(0|Ft(t,e)))break;r[i>>2]=1+(0|r[i>>2]);break}switch(127&A){case 8:case 118:break t}3!=(0|Ft(t,e))&&(r[i>>2]=1+(0|r[i>>2]))}}else if((0|n)>0){l=0;do{t=0|zt(t,e),e=0|w(),l=l+1|0}while((0|l)!=(0|n))}}while(0);return r[i>>2]=((0|r[i>>2])+n|0)%6|0,r[(p=s)>>2]=t,r[p+4>>2]=e,0|(p=0)}function F(t,e,n,i){n|=0,i|=0;var s,a,o,l=0,u=0;for(o=D,D=D+16|0,s=o,a=o+8|0,l=(l=!(0|Ot(t|=0,e|=0)))?1:2;;){if(r[a>>2]=0,!(0|O(t,e,l,a,s))&((0|r[(u=s)>>2])==(0|n)?(0|r[u+4>>2])==(0|i):0)){t=4;break}if((l=l+1|0)>>>0>=7){l=7,t=4;break}}return 4==(0|t)?(D=o,0|l):0}function k(t,e,n,i,a,o,l){e|=0,n|=0,i|=0,a|=0,o|=0,l|=0;var u,h,c,A,d,p,f,m,g,y,v=0,_=0,x=0,b=0,S=0,M=0,T=0,E=0,C=0,R=0,N=0,P=0,I=0,L=0,B=0,U=0,O=0,F=0,k=0;if(y=D,D=D+64|0,f=y+48|0,m=y+32|0,g=y+24|0,u=y+8|0,h=y,(0|(_=0|r[(t|=0)>>2]))<=0)return D=y,0|(B=0);for(c=t+4|0,A=f+8|0,d=m+8|0,p=u+8|0,v=0,I=0;;){P=(x=0|r[c>>2])+(I<<4)|0,r[f>>2]=r[P>>2],r[f+4>>2]=r[P+4>>2],r[f+8>>2]=r[P+8>>2],r[f+12>>2]=r[P+12>>2],(0|I)==(_+-1|0)?(r[m>>2]=r[x>>2],r[m+4>>2]=r[x+4>>2],r[m+8>>2]=r[x+8>>2],r[m+12>>2]=r[x+12>>2]):(P=x+(I+1<<4)|0,r[m>>2]=r[P>>2],r[m+4>>2]=r[P+4>>2],r[m+8>>2]=r[P+8>>2],r[m+12>>2]=r[P+12>>2]),_=0|$(f,m,i,g);t:do{if(_)x=0,v=_;else if(_=0|r[(x=g)>>2],(0|(x=0|r[x+4>>2]))>0|!(0|x)&_>>>0>0){N=0,P=0;e:for(;;){if(k=+s[f>>3],F=+((R=0|Ie(0|_,0|x,0|N,0|P))>>>0)+4294967296*+(0|w()),U=+(_>>>0)+4294967296*+(0|x),O=+(N>>>0)+4294967296*+(0|P),s[u>>3]=k*F/U+ +s[m>>3]*O/U,s[p>>3]=+s[A>>3]*F/U+ +s[d>>3]*O/U,0|(_=0|Ht(u,i,h))){v=_;break}M=0|ke(0|(C=0|r[(R=h)>>2]),0|(R=0|r[R+4>>2]),0|e,0|n),b=0|w(),x=0|r[(S=_=l+(M<<3)|0)>>2],S=0|r[S+4>>2];n:do{if(!(0|x)&!(0|S))L=_,B=16;else for(T=0,E=0;;){if((0|T)>(0|n)|(0|T)==(0|n)&E>>>0>e>>>0){v=1;break e}if((0|x)==(0|C)&(0|S)==(0|R))break n;if(M=0|Fe(0|(_=0|De(0|M,0|b,1,0)),0|w(),0|e,0|n),b=0|w(),E=0|De(0|E,0|T,1,0),T=0|w(),!(0|(x=0|r[(S=_=l+(M<<3)|0)>>2]))&!(0|(S=0|r[S+4>>2]))){L=_,B=16;break}}}while(0);if(16!=(0|B)||(B=0,!(0|C)&!(0|R))||(r[(E=L)>>2]=C,r[E+4>>2]=R,E=o+(r[a>>2]<<3)|0,r[E>>2]=C,r[E+4>>2]=R,E=0|De(0|r[(E=a)>>2],0|r[E+4>>2],1,0),C=0|w(),r[(R=a)>>2]=E,r[R+4>>2]=C),N=0|De(0|N,0|P,1,0),P=0|w(),_=0|r[(x=g)>>2],!((0|(x=0|r[x+4>>2]))>(0|P)|(0|x)==(0|P)&_>>>0>N>>>0)){x=1;break t}}x=0}else x=1}while(0);if(I=I+1|0,!x){B=21;break}if((0|I)>=(0|(_=0|r[t>>2]))){v=0,B=21;break}}return 21==(0|B)?(D=y,0|v):0}function z(t){return(t|=0)>>>0>121?0|(t=0):0|(t=0|r[7696+(28*t|0)+16>>2])}function q(t){return 4==(0|(t|=0))|117==(0|t)}function G(t){return 0|r[11120+(216*(0|r[(t|=0)>>2])|0)+(72*(0|r[t+4>>2])|0)+(24*(0|r[t+8>>2])|0)+(r[t+12>>2]<<3)>>2]}function V(t){return 0|r[11120+(216*(0|r[(t|=0)>>2])|0)+(72*(0|r[t+4>>2])|0)+(24*(0|r[t+8>>2])|0)+(r[t+12>>2]<<3)+4>>2]}function H(t,e){return e|=0,(0|r[7696+(28*(t|=0)|0)+20>>2])==(0|e)?0|(e=1):0|(e=(0|r[7696+(28*t|0)+24>>2])==(0|e))}function j(t,e){return 0|r[848+(28*(t|=0)|0)+((e|=0)<<2)>>2]}function W(t,e){return e|=0,(0|r[848+(28*(t|=0)|0)>>2])==(0|e)?0|(e=0):(0|r[848+(28*t|0)+4>>2])==(0|e)?0|(e=1):(0|r[848+(28*t|0)+8>>2])==(0|e)?0|(e=2):(0|r[848+(28*t|0)+12>>2])==(0|e)?0|(e=3):(0|r[848+(28*t|0)+16>>2])==(0|e)?0|(e=4):(0|r[848+(28*t|0)+20>>2])==(0|e)?0|(e=5):0|((0|r[848+(28*t|0)+24>>2])==(0|e)?6:7)}function X(t){return+s[(t|=0)+16>>3]<+s[t+24>>3]|0}function Y(t,e){t|=0;var n,i,r=0;return(r=+s[(e|=0)>>3])>=+s[t+8>>3]&&r<=+s[t>>3]?(n=+s[t+16>>3],r=+s[t+24>>3],e=(i=+s[e+8>>3])>=r,t=i<=n&1,n<r?e&&(t=1):e||(t=0),0|(e=!!(0|t))):0|(e=0)}function Q(t,e,n){t|=0,e|=0,n|=0;var i,o,h,c,A,d,p,f=0,m=0,g=0,y=0,_=0,b=0,S=0;d=D,D=D+288|0,A=d+264|0,y=d+96|0,m=(f=g=d)+96|0;do{r[f>>2]=0,f=f+4|0}while((0|f)<(0|m));return 0|(e=0|Qt(e,g))?(D=d,0|(b=e)):(Xt(g=0|r[(m=g)>>2],m=0|r[m+4>>2],A),Yt(g,m,y),c=+te(A,y+8|0),s[A>>3]=+s[t>>3],s[(m=A+8|0)>>3]=+s[t+16>>3],s[y>>3]=+s[t+8>>3],s[(g=y+8|0)>>3]=+s[t+24>>3],o=+te(A,y),S=+s[m>>3]-+s[g>>3],h=+u(+S),p=+s[A>>3]-+s[y>>3],i=+u(+p),!(0==S|0==p)&&(S=+Ve(+h,+i),S=+v(+o*o/+He(+S/+He(+h,+i),3)/(c*(2.59807621135*c)*.8)),s[a>>3]=S,_=~~S>>>0,b=+u(S)>=1?S>0?~~+x(+l(S/4294967296),4294967295)>>>0:~~+v((S-+(~~S>>>0))/4294967296)>>>0:0,2146435072&~r[a+4>>2])?(y=!(0|_)&!(0|b),r[(e=n)>>2]=y?1:_,r[e+4>>2]=y?0:b,e=0):e=1,D=d,0|(b=e))}function $(t,e,n,i){t|=0,e|=0,n|=0,i|=0;var o,h,c,A,d=0,p=0,f=0;A=D,D=D+288|0,h=A+264|0,c=A+96|0,o=(d=p=A)+96|0;do{r[d>>2]=0,d=d+4|0}while((0|d)<(0|o));return 0|(n=0|Qt(n,p))?(D=A,0|(i=n)):(Xt(d=0|r[(n=p)>>2],n=0|r[n+4>>2],h),Yt(d,n,c),f=+te(h,c+8|0),f=+v(+ +te(t,e)/(2*f)),s[a>>3]=f,n=~~f>>>0,d=+u(f)>=1?f>0?~~+x(+l(f/4294967296),4294967295)>>>0:~~+v((f-+(~~f>>>0))/4294967296)>>>0:0,2146435072&~r[a+4>>2]?(p=!(0|n)&!(0|d),r[i>>2]=p?1:n,r[i+4>>2]=p?0:d,D=A,0|(i=0)):(D=A,0|(i=1)))}function Z(t,e,n,i){e|=0,n|=0,i|=0,r[(t|=0)>>2]=e,r[t+4>>2]=n,r[t+8>>2]=i}function K(t,e){t|=0;var n,i,a,o,l=0,h=0,c=0,A=0,d=0,p=0,f=0;r[(o=(e|=0)+8|0)>>2]=0,i=+s[t>>3],A=+u(+i),a=+s[t+8>>3],A+=.5*(d=+u(+a)/.8660254037844386),A-=+(0|(l=~~A)),d-=+(0|(t=~~d));do{if(A<.5){if(A<.3333333333333333){if(r[e>>2]=l,d<.5*(A+1)){r[e+4>>2]=t;break}t=t+1|0,r[e+4>>2]=t;break}if(t=(1&!(d<(f=1-A)))+t|0,r[e+4>>2]=t,f<=d&d<2*A){l=l+1|0,r[e>>2]=l;break}r[e>>2]=l;break}if(!(A<.6666666666666666)){if(l=l+1|0,r[e>>2]=l,d<.5*A){r[e+4>>2]=t;break}t=t+1|0,r[e+4>>2]=t;break}if(d<1-A){if(r[e+4>>2]=t,2*A-1<d){r[e>>2]=l;break}}else t=t+1|0,r[e+4>>2]=t;l=l+1|0,r[e>>2]=l}while(0);do{if(i<0){if(1&t){l=~~(+(0|l)-(2*(+((p=0|Ie(0|l,((0|l)<0)<<31>>31,0|(p=(t+1|0)/2|0),((0|p)<0)<<31>>31))>>>0)+4294967296*+(0|w()))+1)),r[e>>2]=l;break}l=~~(+(0|l)-2*(+((p=0|Ie(0|l,((0|l)<0)<<31>>31,0|(p=(0|t)/2|0),((0|p)<0)<<31>>31))>>>0)+4294967296*+(0|w()))),r[e>>2]=l;break}}while(0);p=e+4|0,a<0&&(l=l-((1|t<<1)/2|0)|0,r[e>>2]=l,t=0-t|0,r[p>>2]=t),h=t-l|0,(0|l)<0?(c=0-l|0,r[p>>2]=h,r[o>>2]=c,r[e>>2]=0,t=h,l=0):c=0,(0|t)<0&&(l=l-t|0,r[e>>2]=l,c=c-t|0,r[o>>2]=c,r[p>>2]=0,t=0),n=l-c|0,h=t-c|0,(0|c)<0&&(r[e>>2]=n,r[p>>2]=h,r[o>>2]=0,t=h,l=n,c=0),(0|(h=(0|c)<(0|(h=(0|t)<(0|l)?t:l))?c:h))<=0||(r[e>>2]=l-h,r[p>>2]=t-h,r[o>>2]=c-h)}function J(t){var e,n=0,i=0,s=0,a=0,o=0;n=0|r[(t|=0)>>2],i=0|r[(e=t+4|0)>>2],(0|n)<0&&(i=i-n|0,r[e>>2]=i,r[(o=t+8|0)>>2]=(0|r[o>>2])-n,r[t>>2]=0,n=0),(0|i)<0?(n=n-i|0,r[t>>2]=n,a=(0|r[(o=t+8|0)>>2])-i|0,r[o>>2]=a,r[e>>2]=0,i=0):(o=a=t+8|0,a=0|r[a>>2]),(0|a)<0&&(n=n-a|0,r[t>>2]=n,i=i-a|0,r[e>>2]=i,r[o>>2]=0,a=0),(0|(s=(0|a)<(0|(s=(0|i)<(0|n)?i:n))?a:s))<=0||(r[t>>2]=n-s,r[e>>2]=i-s,r[o>>2]=a-s)}function tt(t,e){e|=0;var n,i;i=0|r[(t|=0)+8>>2],n=+((0|r[t+4>>2])-i|0),s[e>>3]=+((0|r[t>>2])-i|0)-.5*n,s[e+8>>3]=.8660254037844386*n}function et(t,e,n){t|=0,e|=0,r[(n|=0)>>2]=(0|r[e>>2])+(0|r[t>>2]),r[n+4>>2]=(0|r[e+4>>2])+(0|r[t+4>>2]),r[n+8>>2]=(0|r[e+8>>2])+(0|r[t+8>>2])}function nt(t,e,n){t|=0,e|=0,r[(n|=0)>>2]=(0|r[t>>2])-(0|r[e>>2]),r[n+4>>2]=(0|r[t+4>>2])-(0|r[e+4>>2]),r[n+8>>2]=(0|r[t+8>>2])-(0|r[e+8>>2])}function it(t,e){e|=0;var n,i=0;i=0|_(0|r[(t|=0)>>2],e),r[t>>2]=i,n=0|_(0|r[(i=t+4|0)>>2],e),r[i>>2]=n,e=0|_(0|r[(t=t+8|0)>>2],e),r[t>>2]=e}function rt(t){var e,n,i=0,s=0,a=0,o=0,l=0;l=(0|(n=0|r[(t|=0)>>2]))<0,t=(t=(s=(0|(o=((e=(0|(a=(0|r[t+4>>2])-(l?n:0)|0))<0)?0-a|0:0)+((0|r[t+8>>2])-(l?n:0))|0))<0)?0:o)-((a=(0|(s=(0|t)<(0|(s=(0|(i=(e?0:a)-(s?o:0)|0))<(0|(o=(l?0:n)-(e?a:0)-(s?o:0)|0))?i:o))?t:s))>0)?s:0)|0,i=i-(a?s:0)|0;t:do{switch(o-(a?s:0)|0){case 0:switch(0|i){case 0:return 0|(l=0|t?1==(0|t)?1:7:0);case 1:return 0|(l=0|t?1==(0|t)?3:7:2);default:break t}case 1:switch(0|i){case 0:return 0|(l=0|t?1==(0|t)?5:7:4);case 1:if(t)break t;return 0|(t=6);default:break t}}}while(0);return 0|(l=7)}function st(t){var e,n=0,i=0,s=0,a=0,o=0,l=0;a=0|r[(e=(t|=0)+8|0)>>2],o=(0|r[t>>2])-a|0,a=(0|r[(l=t+4|0)>>2])-a|0;do{if(o>>>0>715827881|a>>>0>715827881){if(i=(0|o)>0){if((2147483647-o|0)<(0|o))return 0|(l=1);if((2147483647-(o<<1)|0)<(0|o))return 0|(l=1)}else{if((-2147483648-o|0)>(0|o))return 0|(l=1);if((-2147483648-(o<<1)|0)>(0|o))return 0|(l=1)}if(n=3*o|0,(0|a)>0){if((2147483647-a|0)<(0|a))return 0|(l=1)}else if((-2147483648-a|0)>(0|a))return 0|(l=1);if(s=a<<1,(0|o)>-1){if((-2147483648|n)>=(0|a))return 0|(l=1)}else if((-2147483648^n)<(0|a))return 0|(l=1);if(i){if(!((2147483647-o|0)<(0|s))){i=s;break}return 0|(n=1)}if(!((-2147483648-o|0)>(0|s))){i=s;break}return 0|(n=1)}i=a<<1,n=3*o|0}while(0);s=0|Ce(+(n-a|0)/7),r[t>>2]=s,a=0|Ce(+(i+o|0)/7),r[l>>2]=a,r[e>>2]=0,n=(i=(0|a)<(0|s))?s:a,i=i?a:s;do{if((0|i)<0){if((0|n)>0){if((-2147483648|n)<(0|i)&-2147483648!=(0|i)&(2147483647-n|0)>=(0|i))break;T(23313,22444,355,22455)}if(-2147483648==(0|i)|(-2147483648-n|0)>(0|i)&&T(23313,22444,355,22455),(0|n)>-1){if((-2147483648|n)<(0|i))break;T(23313,22444,355,22455)}else{if((-2147483648^n)>=(0|i))break;T(23313,22444,355,22455)}}}while(0);return n=a-s|0,(0|s)<0?(i=0-s|0,r[l>>2]=n,r[e>>2]=i,r[t>>2]=0,s=0):(n=a,i=0),(0|n)<0&&(s=s-n|0,r[t>>2]=s,i=i-n|0,r[e>>2]=i,r[l>>2]=0,n=0),o=s-i|0,a=n-i|0,(0|i)<0?(r[t>>2]=o,r[l>>2]=a,r[e>>2]=0,n=a,a=o,i=0):a=s,(0|(s=(0|i)<(0|(s=(0|n)<(0|a)?n:a))?i:s))<=0||(r[t>>2]=a-s,r[l>>2]=n-s,r[e>>2]=i-s),0|(l=0)}function at(t){var e,n=0,i=0,s=0,a=0,o=0,l=0;a=0|r[(e=(t|=0)+8|0)>>2],o=(0|r[t>>2])-a|0,a=(0|r[(l=t+4|0)>>2])-a|0;do{if(o>>>0>715827881|a>>>0>715827881){if(i=(0|o)>0){if((2147483647-o|0)<(0|o))return 0|(l=1)}else if((-2147483648-o|0)>(0|o))return 0|(l=1);if(n=o<<1,(0|a)>0){if((2147483647-a|0)<(0|a))return 0|(l=1);if((2147483647-(a<<1)|0)<(0|a))return 0|(l=1)}else{if((-2147483648-a|0)>(0|a))return 0|(l=1);if((-2147483648-(a<<1)|0)>(0|a))return 0|(l=1)}if(s=3*a|0,i){if((2147483647-n|0)<(0|a))return 0|(l=1)}else if((-2147483648-n|0)>(0|a))return 0|(l=1);if((0|a)>-1){if((-2147483648|s)<(0|o)){i=s;break}return 0|(n=1)}if(!((-2147483648^s)<(0|o))){i=s;break}return 0|(n=1)}i=3*a|0,n=o<<1}while(0);s=0|Ce(+(n+a|0)/7),r[t>>2]=s,a=0|Ce(+(i-o|0)/7),r[l>>2]=a,r[e>>2]=0,n=(i=(0|a)<(0|s))?s:a,i=i?a:s;do{if((0|i)<0){if((0|n)>0){if((-2147483648|n)<(0|i)&-2147483648!=(0|i)&(2147483647-n|0)>=(0|i))break;T(23313,22444,404,22469)}if(-2147483648==(0|i)|(-2147483648-n|0)>(0|i)&&T(23313,22444,404,22469),(0|n)>-1){if((-2147483648|n)<(0|i))break;T(23313,22444,404,22469)}else{if((-2147483648^n)>=(0|i))break;T(23313,22444,404,22469)}}}while(0);return n=a-s|0,(0|s)<0?(i=0-s|0,r[l>>2]=n,r[e>>2]=i,r[t>>2]=0,s=0):(n=a,i=0),(0|n)<0&&(s=s-n|0,r[t>>2]=s,i=i-n|0,r[e>>2]=i,r[l>>2]=0,n=0),o=s-i|0,a=n-i|0,(0|i)<0?(r[t>>2]=o,r[l>>2]=a,r[e>>2]=0,n=a,a=o,i=0):a=s,(0|(s=(0|i)<(0|(s=(0|n)<(0|a)?n:a))?i:s))<=0||(r[t>>2]=a-s,r[l>>2]=n-s,r[e>>2]=i-s),0|(l=0)}function ot(t){var e,n,i=0,s=0,a=0,o=0,l=0;s=0|r[(e=(t|=0)+8|0)>>2],a=0|Ce(+((3*(i=(0|r[t>>2])-s|0)|0)-(s=(0|r[(n=t+4|0)>>2])-s|0)|0)/7),r[t>>2]=a,i=0|Ce(+((s<<1)+i|0)/7),r[n>>2]=i,r[e>>2]=0,s=i-a|0,(0|a)<0?(l=0-a|0,r[n>>2]=s,r[e>>2]=l,r[t>>2]=0,i=s,a=0,s=l):s=0,(0|i)<0&&(a=a-i|0,r[t>>2]=a,s=s-i|0,r[e>>2]=s,r[n>>2]=0,i=0),l=a-s|0,o=i-s|0,(0|s)<0?(r[t>>2]=l,r[n>>2]=o,r[e>>2]=0,i=o,o=l,s=0):o=a,(0|(a=(0|s)<(0|(a=(0|i)<(0|o)?i:o))?s:a))<=0||(r[t>>2]=o-a,r[n>>2]=i-a,r[e>>2]=s-a)}function lt(t){var e,n,i=0,s=0,a=0,o=0,l=0;s=0|r[(e=(t|=0)+8|0)>>2],a=0|Ce(+(((i=(0|r[t>>2])-s|0)<<1)+(s=(0|r[(n=t+4|0)>>2])-s|0)|0)/7),r[t>>2]=a,i=0|Ce(+((3*s|0)-i|0)/7),r[n>>2]=i,r[e>>2]=0,s=i-a|0,(0|a)<0?(l=0-a|0,r[n>>2]=s,r[e>>2]=l,r[t>>2]=0,i=s,a=0,s=l):s=0,(0|i)<0&&(a=a-i|0,r[t>>2]=a,s=s-i|0,r[e>>2]=s,r[n>>2]=0,i=0),l=a-s|0,o=i-s|0,(0|s)<0?(r[t>>2]=l,r[n>>2]=o,r[e>>2]=0,i=o,o=l,s=0):o=a,(0|(a=(0|s)<(0|(a=(0|i)<(0|o)?i:o))?s:a))<=0||(r[t>>2]=o-a,r[n>>2]=i-a,r[e>>2]=s-a)}function ut(t){var e,n,i,s=0,a=0,o=0,l=0;s=0|r[(t|=0)>>2],a=0|r[(n=t+4|0)>>2],o=0|r[(i=t+8|0)>>2],l=a+(3*s|0)|0,r[t>>2]=l,a=o+(3*a|0)|0,r[n>>2]=a,s=(3*o|0)+s|0,r[i>>2]=s,o=a-l|0,(0|l)<0?(s=s-l|0,r[n>>2]=o,r[i>>2]=s,r[t>>2]=0,a=o,o=0):o=l,(0|a)<0&&(o=o-a|0,r[t>>2]=o,s=s-a|0,r[i>>2]=s,r[n>>2]=0,a=0),e=o-s|0,l=a-s|0,(0|s)<0?(r[t>>2]=e,r[n>>2]=l,r[i>>2]=0,o=e,s=0):l=a,(0|(a=(0|s)<(0|(a=(0|l)<(0|o)?l:o))?s:a))<=0||(r[t>>2]=o-a,r[n>>2]=l-a,r[i>>2]=s-a)}function ht(t){var e,n,i,s=0,a=0,o=0,l=0;l=0|r[(t|=0)>>2],o=(3*(s=0|r[(n=t+4|0)>>2])|0)+l|0,l=(a=0|r[(i=t+8|0)>>2])+(3*l|0)|0,r[t>>2]=l,r[n>>2]=o,s=(3*a|0)+s|0,r[i>>2]=s,a=o-l|0,(0|l)<0?(s=s-l|0,r[n>>2]=a,r[i>>2]=s,r[t>>2]=0,l=0):a=o,(0|a)<0&&(l=l-a|0,r[t>>2]=l,s=s-a|0,r[i>>2]=s,r[n>>2]=0,a=0),e=l-s|0,o=a-s|0,(0|s)<0?(r[t>>2]=e,r[n>>2]=o,r[i>>2]=0,l=e,s=0):o=a,(0|(a=(0|s)<(0|(a=(0|o)<(0|l)?o:l))?s:a))<=0||(r[t>>2]=l-a,r[n>>2]=o-a,r[i>>2]=s-a)}function ct(t,e){t|=0;var n,i,s,a=0,o=0,l=0;((e|=0)+-1|0)>>>0>=6||(l=(0|r[15440+(12*e|0)>>2])+(0|r[t>>2])|0,r[t>>2]=l,s=t+4|0,o=(0|r[15440+(12*e|0)+4>>2])+(0|r[s>>2])|0,r[s>>2]=o,i=t+8|0,e=(0|r[15440+(12*e|0)+8>>2])+(0|r[i>>2])|0,r[i>>2]=e,a=o-l|0,(0|l)<0?(e=e-l|0,r[s>>2]=a,r[i>>2]=e,r[t>>2]=0,o=0):(a=o,o=l),(0|a)<0&&(o=o-a|0,r[t>>2]=o,e=e-a|0,r[i>>2]=e,r[s>>2]=0,a=0),n=o-e|0,l=a-e|0,(0|e)<0?(r[t>>2]=n,r[s>>2]=l,r[i>>2]=0,o=n,e=0):l=a,(0|(a=(0|e)<(0|(a=(0|l)<(0|o)?l:o))?e:a))<=0||(r[t>>2]=o-a,r[s>>2]=l-a,r[i>>2]=e-a))}function At(t){var e,n,i,s=0,a=0,o=0,l=0;l=0|r[(t|=0)>>2],o=(s=0|r[(n=t+4|0)>>2])+l|0,l=(a=0|r[(i=t+8|0)>>2])+l|0,r[t>>2]=l,r[n>>2]=o,s=a+s|0,r[i>>2]=s,a=o-l|0,(0|l)<0?(s=s-l|0,r[n>>2]=a,r[i>>2]=s,r[t>>2]=0,o=0):(a=o,o=l),(0|a)<0&&(o=o-a|0,r[t>>2]=o,s=s-a|0,r[i>>2]=s,r[n>>2]=0,a=0),e=o-s|0,l=a-s|0,(0|s)<0?(r[t>>2]=e,r[n>>2]=l,r[i>>2]=0,o=e,s=0):l=a,(0|(a=(0|s)<(0|(a=(0|l)<(0|o)?l:o))?s:a))<=0||(r[t>>2]=o-a,r[n>>2]=l-a,r[i>>2]=s-a)}function dt(t){var e,n,i,s=0,a=0,o=0,l=0;s=0|r[(t|=0)>>2],o=0|r[(n=t+4|0)>>2],a=0|r[(i=t+8|0)>>2],l=o+s|0,r[t>>2]=l,o=a+o|0,r[n>>2]=o,s=a+s|0,r[i>>2]=s,a=o-l|0,(0|l)<0?(s=s-l|0,r[n>>2]=a,r[i>>2]=s,r[t>>2]=0,o=0):(a=o,o=l),(0|a)<0&&(o=o-a|0,r[t>>2]=o,s=s-a|0,r[i>>2]=s,r[n>>2]=0,a=0),e=o-s|0,l=a-s|0,(0|s)<0?(r[t>>2]=e,r[n>>2]=l,r[i>>2]=0,o=e,s=0):l=a,(0|(a=(0|s)<(0|(a=(0|l)<(0|o)?l:o))?s:a))<=0||(r[t>>2]=o-a,r[n>>2]=l-a,r[i>>2]=s-a)}function pt(t){switch(0|(t|=0)){case 1:t=5;break;case 5:t=4;break;case 4:t=6;break;case 6:t=2;break;case 2:t=3;break;case 3:t=1}return 0|t}function ft(t){switch(0|(t|=0)){case 1:t=3;break;case 3:t=2;break;case 2:t=6;break;case 6:t=4;break;case 4:t=5;break;case 5:t=1}return 0|t}function mt(t){var e,n,i,s=0,a=0,o=0,l=0;s=0|r[(t|=0)>>2],a=0|r[(n=t+4|0)>>2],o=0|r[(i=t+8|0)>>2],l=a+(s<<1)|0,r[t>>2]=l,a=o+(a<<1)|0,r[n>>2]=a,s=(o<<1)+s|0,r[i>>2]=s,o=a-l|0,(0|l)<0?(s=s-l|0,r[n>>2]=o,r[i>>2]=s,r[t>>2]=0,a=o,o=0):o=l,(0|a)<0&&(o=o-a|0,r[t>>2]=o,s=s-a|0,r[i>>2]=s,r[n>>2]=0,a=0),e=o-s|0,l=a-s|0,(0|s)<0?(r[t>>2]=e,r[n>>2]=l,r[i>>2]=0,o=e,s=0):l=a,(0|(a=(0|s)<(0|(a=(0|l)<(0|o)?l:o))?s:a))<=0||(r[t>>2]=o-a,r[n>>2]=l-a,r[i>>2]=s-a)}function gt(t){var e,n,i,s=0,a=0,o=0,l=0;l=0|r[(t|=0)>>2],o=((s=0|r[(n=t+4|0)>>2])<<1)+l|0,l=(a=0|r[(i=t+8|0)>>2])+(l<<1)|0,r[t>>2]=l,r[n>>2]=o,s=(a<<1)+s|0,r[i>>2]=s,a=o-l|0,(0|l)<0?(s=s-l|0,r[n>>2]=a,r[i>>2]=s,r[t>>2]=0,l=0):a=o,(0|a)<0&&(l=l-a|0,r[t>>2]=l,s=s-a|0,r[i>>2]=s,r[n>>2]=0,a=0),e=l-s|0,o=a-s|0,(0|s)<0?(r[t>>2]=e,r[n>>2]=o,r[i>>2]=0,l=e,s=0):o=a,(0|(a=(0|s)<(0|(a=(0|o)<(0|l)?o:l))?s:a))<=0||(r[t>>2]=l-a,r[n>>2]=o-a,r[i>>2]=s-a)}function yt(t,e){e|=0;var n,i,s,a=0,o=0,l=0;return s=(0|(i=(0|r[(t|=0)>>2])-(0|r[e>>2])|0))<0,n=(0|(o=(0|r[t+4>>2])-(0|r[e+4>>2])-(s?i:0)|0))<0,e=(e=(t=(0|(l=(s?0-i|0:0)+(0|r[t+8>>2])-(0|r[e+8>>2])+(n?0-o|0:0)|0))<0)?0:l)-((o=(0|(t=(0|e)<(0|(t=(0|(a=(n?0:o)-(t?l:0)|0))<(0|(l=(s?0:i)-(n?o:0)-(t?l:0)|0))?a:l))?e:t))>0)?t:0)|0,a=a-(o?t:0)|0,0|((0|(t=(0|(t=l-(o?t:0)|0))>-1?t:0-t|0))>(0|(e=(0|(a=(0|a)>-1?a:0-a|0))>(0|(e=(0|e)>-1?e:0-e|0))?a:e))?t:e)}function vt(t,e){e|=0;var n;n=0|r[(t|=0)+8>>2],r[e>>2]=(0|r[t>>2])-n,r[e+4>>2]=(0|r[t+4>>2])-n}function _t(t,e){e|=0;var n,i,s,a=0,o=0,l=0;o=0|r[(t|=0)>>2],r[e>>2]=o,l=0|r[t+4>>2],r[(i=e+4|0)>>2]=l,r[(s=e+8|0)>>2]=0,t=(a=(0|l)<(0|o))?o:l,a=a?l:o;do{if((0|a)<0){if((0|t)>0){if((-2147483648|t)<(0|a)&-2147483648!=(0|a)&(2147483647-t|0)>=(0|a))break;return 0|(t=1)}if(-2147483648==(0|a)|(-2147483648-t|0)>(0|a))return 0|(e=1);if((0|t)>-1){if((-2147483648|t)<(0|a))break;return 0|(t=1)}if(!((-2147483648^t)<(0|a)))break;return 0|(t=1)}}while(0);return t=l-o|0,(0|o)<0?(a=0-o|0,r[i>>2]=t,r[s>>2]=a,r[e>>2]=0,o=0):(t=l,a=0),(0|t)<0&&(o=o-t|0,r[e>>2]=o,a=a-t|0,r[s>>2]=a,r[i>>2]=0,t=0),n=o-a|0,l=t-a|0,(0|a)<0?(r[e>>2]=n,r[i>>2]=l,r[s>>2]=0,t=l,l=n,a=0):l=o,(0|(o=(0|a)<(0|(o=(0|t)<(0|l)?t:l))?a:o))<=0||(r[e>>2]=l-o,r[i>>2]=t-o,r[s>>2]=a-o),0|(e=0)}function xt(t){var e,n,i,s;n=(s=0|r[(e=(t|=0)+8|0)>>2])-(0|r[t>>2])|0,r[t>>2]=n,t=(0|r[(i=t+4|0)>>2])-s|0,r[i>>2]=t,r[e>>2]=0-(t+n)}function bt(t){var e,n,i=0,s=0,a=0,o=0,l=0;i=0-(s=0|r[(t|=0)>>2])|0,r[t>>2]=i,r[(e=t+8|0)>>2]=0,o=(a=0|r[(n=t+4|0)>>2])+s|0,(0|s)>0?(r[n>>2]=o,r[e>>2]=s,r[t>>2]=0,i=0,a=o):s=0,(0|a)<0?(l=i-a|0,r[t>>2]=l,s=s-a|0,r[e>>2]=s,r[n>>2]=0,o=l-s|0,i=0-s|0,(0|s)<0?(r[t>>2]=o,r[n>>2]=i,r[e>>2]=0,a=i,s=0):(a=0,o=l)):o=i,(0|(i=(0|s)<(0|(i=(0|a)<(0|o)?a:o))?s:i))<=0||(r[t>>2]=o-i,r[n>>2]=a-i,r[e>>2]=s-i)}function St(t,e,n){n|=0;var i,s,a=0,o=0;return s=D,D=D+16|0,i=s,o=-2130706433&(e|=0)|134217728,!0&268435456==(2013265920&e)?(a=0|qe(0|(t|=0),0|e,56),w(),a=0|function(t,e,n){t|=0,e|=0,n|=0;var i=0,s=0,a=0;if(a=D,D=D+16|0,s=a,i=0|Ot(t,e),(n+-1|0)>>>0>5)return D=a,0|(s=-1);if(i=!!(0|i),1==(0|n)&i)return D=a,0|(s=-1);do{if(!(0|ve(t,e,s))){if(i){i=(5+(0|r[21936+(n<<2)>>2])-(0|r[s>>2])|0)%5|0;break}i=(6+(0|r[21968+(n<<2)>>2])-(0|r[s>>2])|0)%6|0;break}i=-1}while(0);return s=i,D=a,0|s}(t,o,7&a),-1==(0|a)?(r[n>>2]=0,D=s,0|(o=6)):(0|Wt(t,o,i)&&T(23313,22484,282,22499),e=0|qe(0|t,0|e,52),w(),e&=15,0|Ot(t,o)?Et(i,e,a,2,n):Pt(i,e,a,2,n),D=s,0|(o=0))):(D=s,0|(o=6))}function Mt(t,e,n,i){e|=0,i|=0;var a,o=0,l=0,u=0,h=0;if(a=D,D=D+16|0,function(t,e,n){t|=0,e|=0,n|=0;var i=0,a=0,o=0;o=D,D=D+32|0,a=o,function(t,e){t|=0,e|=0;var n=0,i=0,r=0;n=+s[t>>3],i=+A(+n),n=+d(+n),s[e+16>>3]=n,n=+s[t+8>>3],r=i*+A(+n),s[e>>3]=r,n=i*+d(+n),s[e+8>>3]=n}(t,a),r[e>>2]=0,s[n>>3]=5,i=+ye(16400,a),i<+s[n>>3]&&(r[e>>2]=0,s[n>>3]=i);i=+ye(16424,a),i<+s[n>>3]&&(r[e>>2]=1,s[n>>3]=i);i=+ye(16448,a),i<+s[n>>3]&&(r[e>>2]=2,s[n>>3]=i);i=+ye(16472,a),i<+s[n>>3]&&(r[e>>2]=3,s[n>>3]=i);i=+ye(16496,a),i<+s[n>>3]&&(r[e>>2]=4,s[n>>3]=i);i=+ye(16520,a),i<+s[n>>3]&&(r[e>>2]=5,s[n>>3]=i);i=+ye(16544,a),i<+s[n>>3]&&(r[e>>2]=6,s[n>>3]=i);i=+ye(16568,a),i<+s[n>>3]&&(r[e>>2]=7,s[n>>3]=i);i=+ye(16592,a),i<+s[n>>3]&&(r[e>>2]=8,s[n>>3]=i);i=+ye(16616,a),i<+s[n>>3]&&(r[e>>2]=9,s[n>>3]=i);i=+ye(16640,a),i<+s[n>>3]&&(r[e>>2]=10,s[n>>3]=i);i=+ye(16664,a),i<+s[n>>3]&&(r[e>>2]=11,s[n>>3]=i);i=+ye(16688,a),i<+s[n>>3]&&(r[e>>2]=12,s[n>>3]=i);i=+ye(16712,a),i<+s[n>>3]&&(r[e>>2]=13,s[n>>3]=i);i=+ye(16736,a),i<+s[n>>3]&&(r[e>>2]=14,s[n>>3]=i);i=+ye(16760,a),i<+s[n>>3]&&(r[e>>2]=15,s[n>>3]=i);i=+ye(16784,a),i<+s[n>>3]&&(r[e>>2]=16,s[n>>3]=i);i=+ye(16808,a),i<+s[n>>3]&&(r[e>>2]=17,s[n>>3]=i);i=+ye(16832,a),i<+s[n>>3]&&(r[e>>2]=18,s[n>>3]=i);if(i=+ye(16856,a),!(i<+s[n>>3]))return void(D=o);r[e>>2]=19,s[n>>3]=i,D=o}(t|=0,n|=0,h=a),(l=+f(+(1-.5*+s[h>>3])))<1e-16)return r[i>>2]=0,r[i+4>>2]=0,r[i+8>>2]=0,r[i+12>>2]=0,void(D=a);if(h=0|r[n>>2],o=+Kt((o=+s[15920+(24*h|0)>>3])-+Kt(+function(t,e){t|=0,e|=0;var n=0,i=0,r=0,a=0,o=0;return a=+s[e>>3],i=+A(+a),r=+s[e+8>>3]-+s[t+8>>3],o=i*+d(+r),n=+s[t>>3],+ +y(+o,+(+d(+a)*+A(+n)-+A(+r)*(i*+d(+n))))}(15600+(h<<4)|0,t))),u=0|Vt(e)?+Kt(o+-.3334731722518321):o,o=+p(+l)/.381966011250105,(0|e)>0){t=0;do{o*=2.6457513110645907,t=t+1|0}while((0|t)!=(0|e))}l=+A(+u)*o,s[i>>3]=l,u=+d(+u)*o,s[i+8>>3]=u,D=a}function wt(t,e,n,i,a){e|=0,n|=0,i|=0,a|=0;var o=0,l=0;if(o=+function(t){t|=0;var e=0,n=0;return n=+s[t>>3],e=+s[t+8>>3],+ +h(+(n*n+e*e))}(t|=0),o<1e-16)return e=15600+(e<<4)|0,r[a>>2]=r[e>>2],r[a+4>>2]=r[e+4>>2],r[a+8>>2]=r[e+8>>2],void(r[a+12>>2]=r[e+12>>2]);if(l=+y(+ +s[t+8>>3],+ +s[t>>3]),(0|n)>0){t=0;do{o/=2.6457513110645907,t=t+1|0}while((0|t)!=(0|n))}i?(o/=3,n=!(0|Vt(n)),o=+g(.381966011250105*(n?o:o/2.6457513110645907))):(o=+g(.381966011250105*o),0|Vt(n)&&(l=+Kt(l+.3334731722518321))),function(t,e,n,i){t|=0,e=+e,n=+n,i|=0;var a=0,o=0,l=0,h=0;if(n<1e-16)return r[i>>2]=r[t>>2],r[i+4>>2]=r[t+4>>2],r[i+8>>2]=r[t+8>>2],void(r[i+12>>2]=r[t+12>>2]);o=e<0?e+6.283185307179586:e,o=e>=6.283185307179586?o+-6.283185307179586:o;do{if(!(o<1e-16)){if(a=+u(+(o+-3.141592653589793))<1e-16,e=+s[t>>3],a){e-=n,s[i>>3]=e,a=i;break}if(l=+A(+n),n=+d(+n),e=l*+d(+e)+ +A(+o)*(n*+A(+e)),e=+m(+((e=e>1?1:e)<-1?-1:e)),s[i>>3]=e,+u(+(e+-1.5707963267948966))<1e-16)return s[i>>3]=1.5707963267948966,void(s[i+8>>3]=0);if(+u(+(e+1.5707963267948966))<1e-16)return s[i>>3]=-1.5707963267948966,void(s[i+8>>3]=0);if(h=+A(+e),o=n*+d(+o)/h,n=+s[t>>3],e=(l-+d(+e)*+d(+n))/+A(+n)/h,l=o>1?1:o,e=e>1?1:e,(e=+s[t+8>>3]+ +y(+(l<-1?-1:l),+(e<-1?-1:e)))>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);return void(s[i+8>>3]=e)}e=+s[t>>3]+n,s[i>>3]=e,a=i}while(0);if(+u(+(e+-1.5707963267948966))<1e-16)return s[a>>3]=1.5707963267948966,void(s[i+8>>3]=0);if(+u(+(e+1.5707963267948966))<1e-16)return s[a>>3]=-1.5707963267948966,void(s[i+8>>3]=0);if(e=+s[t+8>>3],e>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);s[i+8>>3]=e}(15600+(e<<4)|0,+Kt(+s[15920+(24*e|0)>>3]-l),o,a)}function Tt(t,e,n){e|=0,n|=0;var i,s;i=D,D=D+16|0,tt((t|=0)+4|0,s=i),wt(s,0|r[t>>2],e,0,n),D=i}function Et(t,e,n,i,a){t|=0,e|=0,n|=0,i|=0,a|=0;var o,l,u,h,c,A,d,p,f,m,g,y,v,_,x,b,S,M,w,E,C,R,N=0,P=0,I=0,L=0,B=0,U=0;if(R=D,D=D+272|0,L=R+240|0,w=R,E=R+224|0,C=R+208|0,g=R+176|0,y=R+160|0,v=R+192|0,_=R+144|0,x=R+128|0,b=R+112|0,S=R+96|0,M=R+80|0,r[(N=R+256|0)>>2]=e,r[L>>2]=r[t>>2],r[L+4>>2]=r[t+4>>2],r[L+8>>2]=r[t+8>>2],r[L+12>>2]=r[t+12>>2],Ct(L,N,w),r[a>>2]=0,(0|(L=i+n+(5==(0|i)&1)|0))<=(0|n))D=R;else{l=E+4|0,u=g+4|0,h=n+5|0,c=16880+((o=0|r[N>>2])<<2)|0,A=16960+(o<<2)|0,d=x+8|0,p=b+8|0,f=S+8|0,m=C+4|0,I=n;t:for(;;){P=w+((0|I)%5<<4)|0,r[C>>2]=r[P>>2],r[C+4>>2]=r[P+4>>2],r[C+8>>2]=r[P+8>>2],r[C+12>>2]=r[P+12>>2];do{}while(2==(0|Rt(C,o,0,1)));if((0|I)>(0|n)&!!(0|Vt(e))){if(r[g>>2]=r[C>>2],r[g+4>>2]=r[C+4>>2],r[g+8>>2]=r[C+8>>2],r[g+12>>2]=r[C+12>>2],tt(l,y),i=0|r[g>>2],N=0|r[17040+(80*i|0)+(r[E>>2]<<2)>>2],r[g>>2]=r[18640+(80*i|0)+(20*N|0)>>2],(0|(P=0|r[18640+(80*i|0)+(20*N|0)+16>>2]))>0){t=0;do{At(u),t=t+1|0}while((0|t)<(0|P))}switch(P=18640+(80*i|0)+(20*N|0)+4|0,r[v>>2]=r[P>>2],r[v+4>>2]=r[P+4>>2],r[v+8>>2]=r[P+8>>2],it(v,3*(0|r[c>>2])|0),et(u,v,u),J(u),tt(u,_),B=+(0|r[A>>2]),s[x>>3]=3*B,s[d>>3]=0,U=-1.5*B,s[b>>3]=U,s[p>>3]=2.598076211353316*B,s[S>>3]=U,s[f>>3]=-2.598076211353316*B,0|r[17040+(80*(0|r[g>>2])|0)+(r[C>>2]<<2)>>2]){case 1:t=b,i=x;break;case 3:t=S,i=b;break;case 2:t=x,i=S;break;default:t=12;break t}me(y,_,i,t,M),wt(M,0|r[g>>2],o,1,a+8+(r[a>>2]<<4)|0),r[a>>2]=1+(0|r[a>>2])}if((0|I)<(0|h)&&(tt(m,g),wt(g,0|r[C>>2],o,1,a+8+(r[a>>2]<<4)|0),r[a>>2]=1+(0|r[a>>2])),r[E>>2]=r[C>>2],r[E+4>>2]=r[C+4>>2],r[E+8>>2]=r[C+8>>2],r[E+12>>2]=r[C+12>>2],(0|(I=I+1|0))>=(0|L)){t=3;break}}3!=(0|t)?12==(0|t)&&T(22522,22569,571,22579):D=R}}function Ct(t,e,n){t|=0,e|=0,n|=0;var i,s=0,a=0,o=0,l=0,u=0;i=D,D=D+128|0,a=i,l=20240,u=(o=s=i+64|0)+60|0;do{r[o>>2]=r[l>>2],o=o+4|0,l=l+4|0}while((0|o)<(0|u));l=20304,u=(o=a)+60|0;do{r[o>>2]=r[l>>2],o=o+4|0,l=l+4|0}while((0|o)<(0|u));s=(u=!(0|Vt(0|r[e>>2])))?s:a,mt(a=t+4|0),gt(a),0|Vt(0|r[e>>2])&&(ht(a),r[e>>2]=1+(0|r[e>>2])),r[n>>2]=r[t>>2],et(a,s,e=n+4|0),J(e),r[n+16>>2]=r[t>>2],et(a,s+12|0,e=n+20|0),J(e),r[n+32>>2]=r[t>>2],et(a,s+24|0,e=n+36|0),J(e),r[n+48>>2]=r[t>>2],et(a,s+36|0,e=n+52|0),J(e),r[n+64>>2]=r[t>>2],et(a,s+48|0,n=n+68|0),J(n),D=i}function Rt(t,e,n,i){n|=0,i|=0;var s,a,o,l,u,h,c=0,A=0,d=0,p=0,f=0;if(h=D,D=D+32|0,u=h+12|0,a=h,f=(t|=0)+4|0,p=0|r[16960+((e|=0)<<2)>>2],p=(l=!!(0|i))?3*p|0:p,c=0|r[f>>2],s=0|r[(o=t+8|0)>>2],l){if((0|(c=s+c+(i=0|r[(A=t+12|0)>>2])|0))==(0|p))return D=h,0|(f=1);d=A}else c=s+c+(i=0|r[(d=t+12|0)>>2])|0;if((0|c)<=(0|p))return D=h,0|(f=0);do{if((0|i)>0){if(i=0|r[t>>2],(0|s)>0){A=18640+(80*i|0)+60|0,i=t;break}i=18640+(80*i|0)+40|0,n?(Z(u,p,0,0),nt(f,u,a),dt(a),et(a,u,f),A=i,i=t):(A=i,i=t)}else A=18640+(80*(0|r[t>>2])|0)+20|0,i=t}while(0);if(r[i>>2]=r[A>>2],(0|r[(c=A+16|0)>>2])>0){i=0;do{At(f),i=i+1|0}while((0|i)<(0|r[c>>2]))}return t=A+4|0,r[u>>2]=r[t>>2],r[u+4>>2]=r[t+4>>2],r[u+8>>2]=r[t+8>>2],e=0|r[16880+(e<<2)>>2],it(u,l?3*e|0:e),et(f,u,f),J(f),i=l&&((0|r[o>>2])+(0|r[f>>2])+(0|r[d>>2])|0)==(0|p)?1:2,D=h,0|(f=i)}function Nt(t,e){t|=0,e|=0;var n=0;do{n=0|Rt(t,e,0,1)}while(2==(0|n));return 0|n}function Pt(t,e,n,i,a){t|=0,e|=0,n|=0,i|=0,a|=0;var o,l,u,h,c,A,d,p,f,m,g,y,v,_,x,b,S,M,w=0,E=0,C=0,R=0,N=0;if(M=D,D=D+240|0,_=M+208|0,x=M,b=M+192|0,S=M+176|0,f=M+160|0,m=M+144|0,g=M+128|0,y=M+112|0,v=M+96|0,r[(w=M+224|0)>>2]=e,r[_>>2]=r[t>>2],r[_+4>>2]=r[t+4>>2],r[_+8>>2]=r[t+8>>2],r[_+12>>2]=r[t+12>>2],Dt(_,w,x),r[a>>2]=0,(0|(p=i+n+(6==(0|i)&1)|0))<=(0|n))D=M;else{l=n+6|0,u=16960+((o=0|r[w>>2])<<2)|0,h=m+8|0,c=g+8|0,A=y+8|0,d=b+4|0,E=0,C=n,i=-1;t:for(;;){if(t=x+((w=(0|C)%6|0)<<4)|0,r[b>>2]=r[t>>2],r[b+4>>2]=r[t+4>>2],r[b+8>>2]=r[t+8>>2],r[b+12>>2]=r[t+12>>2],t=E,E=0|Rt(b,o,0,1),(0|C)>(0|n)&!!(0|Vt(e))&&(1!=(0|t)&&(0|r[b>>2])!=(0|i))){switch(tt(x+((w+5|0)%6<<4)+4|0,S),tt(x+(w<<4)+4|0,f),R=+(0|r[u>>2]),s[m>>3]=3*R,s[h>>3]=0,N=-1.5*R,s[g>>3]=N,s[c>>3]=2.598076211353316*R,s[y>>3]=N,s[A>>3]=-2.598076211353316*R,w=0|r[_>>2],0|r[17040+(80*w|0)+(((0|i)==(0|w)?r[b>>2]:i)<<2)>>2]){case 1:t=g,i=m;break;case 3:t=y,i=g;break;case 2:t=m,i=y;break;default:t=8;break t}me(S,f,i,t,v),0|ge(S,v)||0|ge(f,v)||(wt(v,0|r[_>>2],o,1,a+8+(r[a>>2]<<4)|0),r[a>>2]=1+(0|r[a>>2]))}if((0|C)<(0|l)&&(tt(d,S),wt(S,0|r[b>>2],o,1,a+8+(r[a>>2]<<4)|0),r[a>>2]=1+(0|r[a>>2])),(0|(C=C+1|0))>=(0|p)){t=3;break}i=0|r[b>>2]}3!=(0|t)?8==(0|t)&&T(22606,22569,736,22651):D=M}}function Dt(t,e,n){t|=0,e|=0,n|=0;var i,s=0,a=0,o=0,l=0,u=0;i=D,D=D+160|0,a=i,l=20368,u=(o=s=i+80|0)+72|0;do{r[o>>2]=r[l>>2],o=o+4|0,l=l+4|0}while((0|o)<(0|u));l=20448,u=(o=a)+72|0;do{r[o>>2]=r[l>>2],o=o+4|0,l=l+4|0}while((0|o)<(0|u));s=(u=!(0|Vt(0|r[e>>2])))?s:a,mt(a=t+4|0),gt(a),0|Vt(0|r[e>>2])&&(ht(a),r[e>>2]=1+(0|r[e>>2])),r[n>>2]=r[t>>2],et(a,s,e=n+4|0),J(e),r[n+16>>2]=r[t>>2],et(a,s+12|0,e=n+20|0),J(e),r[n+32>>2]=r[t>>2],et(a,s+24|0,e=n+36|0),J(e),r[n+48>>2]=r[t>>2],et(a,s+36|0,e=n+52|0),J(e),r[n+64>>2]=r[t>>2],et(a,s+48|0,e=n+68|0),J(e),r[n+80>>2]=r[t>>2],et(a,s+60|0,n=n+84|0),J(n),D=i}function It(t,e){return e=0|qe(0|(t|=0),0|(e|=0),45),w(),127&e}function Lt(t,e){var n=0,i=0,r=0,s=0,a=0,o=0;if(!(!0&134217728==(-16777216&(e|=0))))return 0|(e=0);if(a=0|qe(0|(t|=0),0|e,45),w(),(a&=127)>>>0>121)return 0|(e=0);n=0|qe(0|t,0|e,52),w(),n&=15;do{if(0|n){for(r=1,i=0;;){if(s=0|qe(0|t,0|e,3*(15-r|0)|0),w(),!!(0|(s&=7))&(1^i)){if(1==(0|s)&!!(0|z(a))){o=0,i=13;break}i=1}if(7==(0|s)){o=0,i=13;break}if(!(r>>>0<n>>>0)){i=9;break}r=r+1|0}if(9==(0|i)){if(15!=(0|n))break;return 0|(o=1)}if(13==(0|i))return 0|o}}while(0);for(;;){if(o=0|qe(0|t,0|e,3*(14-n|0)|0),w(),!(!0&!(7&~o))){o=0,i=13;break}if(!(n>>>0<14)){o=1,i=13;break}n=n+1|0}return 13==(0|i)?0|o:0}function Bt(t,e,n,i){n|=0,i|=0;var s=0,a=0;if(a=0|qe(0|(t|=0),0|(e|=0),52),w(),n>>>0>15)return 0|(i=4);if((0|(a&=15))<(0|n))return 0|(i=12);if((0|a)==(0|n))return r[i>>2]=t,r[i+4>>2]=e,0|(i=0);if(s=0|Ge(0|n,0,52),s|=t,t=w()|-15728641&e,(0|a)>(0|n))do{e=0|Ge(7,0,3*(14-n|0)|0),n=n+1|0,s|=e,t=w()|t}while((0|n)<(0|a));return r[i>>2]=s,r[i+4>>2]=t,0|(i=0)}function Ut(t,e,n,i){n|=0,i|=0;var s=0,a=0,o=0;if(a=0|qe(0|(t|=0),0|(e|=0),52),w(),!((0|n)<16&(0|(a&=15))<=(0|n)))return 0|(i=4);s=n-a|0,n=0|qe(0|t,0|e,45),w();t:do{if(0|z(127&n)){e:do{if(0|a){for(n=1;!((o=0|Ge(7,0,3*(15-n|0)|0))&t)&!(w()&e);){if(!(n>>>0<a>>>0))break e;n=n+1|0}n=0|ce(7,0,s,((0|s)<0)<<31>>31),s=0|w();break t}}while(0);n=0|De(0|(n=0|Oe(0|(n=0|ce(7,0,s,((0|s)<0)<<31>>31)),0|w(),5,0)),0|w(),-5,-1),n=0|De(0|(n=0|Ue(0|n,0|w(),6,0)),0|w(),1,0),s=0|w()}else n=0|ce(7,0,s,((0|s)<0)<<31>>31),s=0|w()}while(0);return r[(o=i)>>2]=n,r[o+4>>2]=s,0|(o=0)}function Ot(t,e){var n=0,i=0,r=0;if(r=0|qe(0|(t|=0),0|(e|=0),45),w(),!(0|z(127&r)))return 0|(r=0);r=0|qe(0|t,0|e,52),w(),r&=15;t:do{if(r)for(i=1;;){if(n=0|qe(0|t,0|e,3*(15-i|0)|0),w(),0|(n&=7))break t;if(!(i>>>0<r>>>0)){n=0;break}i=i+1|0}else n=0}while(0);return 0|(r=1&!(0|n))}function Ft(t,e){var n=0,i=0,r=0;if(r=0|qe(0|(t|=0),0|(e|=0),52),w(),!(r&=15))return 0|(r=0);for(i=1;;){if(n=0|qe(0|t,0|e,3*(15-i|0)|0),w(),0|(n&=7)){i=5;break}if(!(i>>>0<r>>>0)){n=0,i=5;break}i=i+1|0}return 5==(0|i)?0|n:0}function kt(t,e){var n=0,i=0,r=0,s=0,a=0,o=0,l=0;if(l=0|qe(0|(t|=0),0|(e|=0),52),w(),!(l&=15))return l=t,M(0|(o=e)),0|l;for(o=1,n=0;;){i=0|Ge(7,0,0|(s=3*(15-o|0)|0)),r=0|w(),a=0|qe(0|t,0|e,0|s),w(),t=(s=0|Ge(0|pt(7&a),0,0|s))|t&~i,e=(a=0|w())|e&~r;t:do{if(!n)if(!(s&i)&!(a&r))n=0;else if(i=0|qe(0|t,0|e,52),w(),i&=15){n=1;e:for(;;){switch(a=0|qe(0|t,0|e,3*(15-n|0)|0),w(),7&a){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<i>>>0)){n=1;break t}n=n+1|0}for(n=1;;){if(r=0|qe(0|t,0|e,0|(a=3*(15-n|0)|0)),w(),s=0|Ge(7,0,0|a),e&=~w(),t=t&~s|(a=0|Ge(0|pt(7&r),0,0|a)),e|=w(),!(n>>>0<i>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(o>>>0<l>>>0))break;o=o+1|0}return M(0|e),0|t}function zt(t,e){var n=0,i=0,r=0,s=0,a=0;if(i=0|qe(0|(t|=0),0|(e|=0),52),w(),!(i&=15))return i=t,M(0|(n=e)),0|i;for(n=1;a=0|qe(0|t,0|e,0|(s=3*(15-n|0)|0)),w(),r=0|Ge(7,0,0|s),e&=~w(),t=(s=0|Ge(0|pt(7&a),0,0|s))|t&~r,e=w()|e,n>>>0<i>>>0;)n=n+1|0;return M(0|e),0|t}function qt(t,e){var n=0,i=0,r=0,s=0,a=0,o=0,l=0;if(l=0|qe(0|(t|=0),0|(e|=0),52),w(),!(l&=15))return l=t,M(0|(o=e)),0|l;for(o=1,n=0;;){i=0|Ge(7,0,0|(s=3*(15-o|0)|0)),r=0|w(),a=0|qe(0|t,0|e,0|s),w(),t=(s=0|Ge(0|ft(7&a),0,0|s))|t&~i,e=(a=0|w())|e&~r;t:do{if(!n)if(!(s&i)&!(a&r))n=0;else if(i=0|qe(0|t,0|e,52),w(),i&=15){n=1;e:for(;;){switch(a=0|qe(0|t,0|e,3*(15-n|0)|0),w(),7&a){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<i>>>0)){n=1;break t}n=n+1|0}for(n=1;;){if(s=0|Ge(7,0,0|(r=3*(15-n|0)|0)),a=e&~w(),e=0|qe(0|t,0|e,0|r),w(),t=t&~s|(e=0|Ge(0|ft(7&e),0,0|r)),e=a|w(),!(n>>>0<i>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(o>>>0<l>>>0))break;o=o+1|0}return M(0|e),0|t}function Gt(t,e){var n=0,i=0,r=0,s=0,a=0;if(i=0|qe(0|(t|=0),0|(e|=0),52),w(),!(i&=15))return i=t,M(0|(n=e)),0|i;for(n=1;s=0|Ge(7,0,0|(a=3*(15-n|0)|0)),r=e&~w(),e=0|qe(0|t,0|e,0|a),w(),t=(e=0|Ge(0|ft(7&e),0,0|a))|t&~s,e=w()|r,n>>>0<i>>>0;)n=n+1|0;return M(0|e),0|t}function Vt(t){return(0|(t|=0))%2|0}function Ht(t,e,n){n|=0;var i,s=0;return i=D,D=D+16|0,s=i,(e|=0)>>>0>15?(D=i,0|(s=4)):2146435072&~r[(t|=0)+4>>2]&&2146435072&~r[t+8+4>>2]?(function(t,e,n){var i,r;i=D,D=D+16|0,Mt(t|=0,e|=0,n|=0,r=i),K(r,n+4|0),D=i}(t,e,s),e=0|function(t,e){t|=0;var n,i=0,s=0,a=0,o=0,l=0,u=0,h=0,c=0;if(n=D,D=D+64|0,u=n+40|0,s=n+24|0,a=n+12|0,o=n,Ge(0|(e|=0),0,52),i=134225919|w(),!e)return(0|r[t+4>>2])>2||(0|r[t+8>>2])>2||(0|r[t+12>>2])>2?(u=0,M(0|(l=0)),D=n,0|u):(Ge(0|G(t),0,45),l=w()|i,u=-1,M(0|l),D=n,0|u);if(r[u>>2]=r[t>>2],r[u+4>>2]=r[t+4>>2],r[u+8>>2]=r[t+8>>2],r[u+12>>2]=r[t+12>>2],l=u+4|0,(0|e)>0)for(t=-1;r[s>>2]=r[l>>2],r[s+4>>2]=r[l+4>>2],r[s+8>>2]=r[l+8>>2],1&e?(ot(l),r[a>>2]=r[l>>2],r[a+4>>2]=r[l+4>>2],r[a+8>>2]=r[l+8>>2],ut(a)):(lt(l),r[a>>2]=r[l>>2],r[a+4>>2]=r[l+4>>2],r[a+8>>2]=r[l+8>>2],ht(a)),nt(s,a,o),J(o),h=0|Ge(7,0,0|(c=3*(15-e|0)|0)),i&=~w(),t=(c=0|Ge(0|rt(o),0,0|c))|t&~h,i=w()|i,(0|e)>1;)e=e+-1|0;else t=-1;t:do{if((0|r[l>>2])<=2&&(0|r[u+8>>2])<=2&&(0|r[u+12>>2])<=2){if(e=0|Ge(0|(s=0|G(u)),0,45),e|=t,t=w()|-1040385&i,o=0|V(u),!(0|z(s))){if((0|o)<=0)break;for(a=0;;){if(s=0|qe(0|e,0|t,52),w(),s&=15)for(i=1;u=0|qe(0|e,0|t,0|(c=3*(15-i|0)|0)),w(),h=0|Ge(7,0,0|c),t&=~w(),e=e&~h|(c=0|Ge(0|pt(7&u),0,0|c)),t|=w(),i>>>0<s>>>0;)i=i+1|0;if((0|(a=a+1|0))==(0|o))break t}}a=0|qe(0|e,0|t,52),w(),a&=15;e:do{if(a){i=1;n:for(;;){switch(c=0|qe(0|e,0|t,3*(15-i|0)|0),w(),7&c){case 1:break n;case 0:break;default:break e}if(!(i>>>0<a>>>0))break e;i=i+1|0}if(0|H(s,0|r[u>>2]))for(i=1;h=0|Ge(7,0,0|(u=3*(15-i|0)|0)),c=t&~w(),t=0|qe(0|e,0|t,0|u),w(),e=e&~h|(t=0|Ge(0|ft(7&t),0,0|u)),t=c|w(),i>>>0<a>>>0;)i=i+1|0;else for(i=1;u=0|qe(0|e,0|t,0|(c=3*(15-i|0)|0)),w(),h=0|Ge(7,0,0|c),t&=~w(),e=e&~h|(c=0|Ge(0|pt(7&u),0,0|c)),t|=w(),i>>>0<a>>>0;)i=i+1|0}}while(0);if((0|o)>0){i=0;do{e=0|kt(e,t),t=0|w(),i=i+1|0}while((0|i)!=(0|o))}}else e=0,t=0}while(0);return c=e,M(0|(h=t)),D=n,0|c}(s,e),s=0|w(),r[n>>2]=e,r[n+4>>2]=s,!(0|e)&!(0|s)&&T(23313,22674,786,22697),D=i,0|(s=0)):(D=i,0|(s=3))}function jt(t,e,n){var i,s=0,a=0,o=0;if(i=(n|=0)+4|0,a=0|qe(0|(t|=0),0|(e|=0),52),w(),a&=15,o=0|qe(0|t,0|e,45),w(),s=!(0|a),0|z(127&o)){if(s)return 0|(o=1);s=1}else{if(s)return 0|(o=0);s=0|r[i>>2]||0|r[n+8>>2]?1:1&!!(0|r[n+12>>2])}for(n=1;1&n?ut(i):ht(i),o=0|qe(0|t,0|e,3*(15-n|0)|0),w(),ct(i,7&o),n>>>0<a>>>0;)n=n+1|0;return 0|s}function Wt(t,e,n){n|=0;var i,s,a=0,o=0,l=0,u=0,h=0,c=0;if(s=D,D=D+16|0,i=s,c=0|qe(0|(t|=0),0|(e|=0),45),w(),(c&=127)>>>0>121)return r[n>>2]=0,r[n+4>>2]=0,r[n+8>>2]=0,r[n+12>>2]=0,D=s,0|(c=5);t:do{if(0|z(c)&&(l=0|qe(0|t,0|e,52),w(),0|(l&=15))){a=1;e:for(;;){switch(h=0|qe(0|t,0|e,3*(15-a|0)|0),w(),7&h){case 5:break e;case 0:break;default:a=e;break t}if(!(a>>>0<l>>>0)){a=e;break t}a=a+1|0}for(o=1,a=e;u=0|Ge(7,0,0|(e=3*(15-o|0)|0)),h=a&~w(),a=0|qe(0|t,0|a,0|e),w(),t=t&~u|(a=0|Ge(0|ft(7&a),0,0|e)),a=h|w(),o>>>0<l>>>0;)o=o+1|0}else a=e}while(0);if(h=7696+(28*c|0)|0,r[n>>2]=r[h>>2],r[n+4>>2]=r[h+4>>2],r[n+8>>2]=r[h+8>>2],r[n+12>>2]=r[h+12>>2],!(0|jt(t,a,n)))return D=s,0|(c=0);if(u=n+4|0,r[i>>2]=r[u>>2],r[i+4>>2]=r[u+4>>2],r[i+8>>2]=r[u+8>>2],l=0|qe(0|t,0|a,52),w(),h=15&l,1&l?(ht(u),l=h+1|0):l=h,0|z(c)){t:do{if(h)for(e=1;;){if(o=0|qe(0|t,0|a,3*(15-e|0)|0),w(),0|(o&=7)){a=o;break t}if(!(e>>>0<h>>>0)){a=0;break}e=e+1|0}else a=0}while(0);a=4==(0|a)&1}else a=0;if(0|Rt(n,l,a,0)){if(0|z(c))do{}while(0|Rt(n,l,0,0));(0|l)!=(0|h)&<(u)}else(0|l)!=(0|h)&&(r[u>>2]=r[i>>2],r[u+4>>2]=r[i+4>>2],r[u+8>>2]=r[i+8>>2]);return D=s,0|(c=0)}function Xt(t,e,n){n|=0;var i,r,s=0;return r=D,D=D+16|0,0|(s=0|Wt(t|=0,e|=0,i=r))?(D=r,0|s):(s=0|qe(0|t,0|e,52),w(),Tt(i,15&s,n),D=r,0|(s=0))}function Yt(t,e,n){n|=0;var i,r=0,s=0,a=0;if(i=D,D=D+16|0,0|(r=0|Wt(t|=0,e|=0,a=i)))return D=i,0|(a=r);r=0|qe(0|t,0|e,45),w(),r=!(0|z(127&r)),s=0|qe(0|t,0|e,52),w(),s&=15;t:do{if(!r){if(0|s)for(r=1;;){if(!(!((0|Ge(7,0,3*(15-r|0)|0))&t)&!(w()&e)))break t;if(!(r>>>0<s>>>0))break;r=r+1|0}return Et(a,s,0,5,n),D=i,0|0}}while(0);return Pt(a,s,0,6,n),D=i,0|0}function Qt(t,e){e|=0;var n=0,i=0,s=0,a=0,o=0,l=0,u=0;if((t|=0)>>>0>15)return 0|(l=4);if(Ge(0|t,0,52),l=134225919|w(),!t){n=0,i=0;do{0|z(i)&&(Ge(0|i,0,45),o=l|w(),r[(t=e+(n<<3)|0)>>2]=-1,r[t+4>>2]=o,n=n+1|0),i=i+1|0}while(122!=(0|i));return 0|(n=0)}n=0,o=0;do{if(0|z(o)){for(Ge(0|o,0,45),i=1,s=-1,a=l|w();s&=~(u=0|Ge(7,0,3*(15-i|0)|0)),a&=~w(),(0|i)!=(0|t);)i=i+1|0;r[(u=e+(n<<3)|0)>>2]=s,r[u+4>>2]=a,n=n+1|0}o=o+1|0}while(122!=(0|o));return 0|(n=0)}function $t(t,e,n,i){t|=0,i|=0;var s=0,a=0;s=0|qe(0|(e|=0),0|(n|=0),52),w(),!(0|e)&!(0|n)|(0|i)>15|(0|(s&=15))>(0|i)?(i=-1,s=-1,e=0,n=0):(a=0|function(t,e,n,i){return t|=0,e|=0,(0|(i|=0))<(0|(n|=0))?(i=t,M(0|(n=e)),0|i):(n=0|Ge(-1,-1,3+(3*(i-n|0)|0)|0),i=0|Ge(0|~n,0|~w(),3*(15-i|0)|0),n=~w()&e,i=~i&t,M(0|n),0|i)}(e,n,s+1|0,i),n=-15728641&w(),e=0|Ge(0|i,0,52),i=(a=!(0|Ot(e|=a,n|=w())))?-1:i),r[(a=t)>>2]=e,r[a+4>>2]=n,r[t+8>>2]=s,r[t+12>>2]=i}function Zt(t){var e,n=0,i=0,s=0,a=0,o=0,l=0,u=0,h=0;if(!(!(0|(n=0|r[(i=t|=0)>>2]))&!(0|(i=0|r[i+4>>2]))||(s=0|qe(0|n,0|i,52),w(),n=0|De(0|(u=0|Ge(1,0,3*(15^(s&=15))|0)),0|w(),0|n,0|i),i=0|w(),r[(u=t)>>2]=n,r[u+4>>2]=i,(0|s)<(0|(l=0|r[(u=t+8|0)>>2]))))){for(e=t+12|0,o=s;;){if((0|o)==(0|l)){s=5;break}if(h=(0|o)==(0|r[e>>2]),s=0|qe(0|n,0|i,0|(a=3*(15-o|0)|0)),w(),h&1==(0|(s&=7))&!0){s=7;break}if(!(7==(0|s)&!0)){s=10;break}if(n=0|De(0|n,0|i,0|(h=0|Ge(1,0,0|a)),0|w()),i=0|w(),r[(h=t)>>2]=n,r[h+4>>2]=i,!((0|o)>(0|l))){s=10;break}o=o+-1|0}if(5==(0|s))return r[(h=t)>>2]=0,r[h+4>>2]=0,r[u>>2]=-1,void(r[e>>2]=-1);if(7==(0|s))return l=0|De(0|n,0|i,0|(l=0|Ge(1,0,0|a)),0|w()),u=0|w(),r[(h=t)>>2]=l,r[h+4>>2]=u,void(r[e>>2]=o+-1)}}function Kt(t){var e;return e=(t=+t)<0?t+6.283185307179586:t,+(t>=6.283185307179586?e+-6.283185307179586:e)}function Jt(t,e){return e|=0,+u(+(+s[(t|=0)>>3]-+s[e>>3]))<17453292519943298e-27?0|(e=+u(+(+s[t+8>>3]-+s[e+8>>3]))<17453292519943298e-27):0|(e=0)}function te(t,e){t|=0;var n,i,r,a=0;return i=+s[(e|=0)>>3],n=+s[t>>3],a=(r=+d(.5*(i-n)))*r+(a=+d(.5*(+s[e+8>>3]-+s[t+8>>3])))*(+A(+i)*+A(+n)*a),2*+y(+ +h(+a),+ +h(+(1-a)))*6371.007180918475}function ee(t,e){e|=0;var n=0;return(t|=0)>>>0>15?0|(e=4):(n=0|Oe(0|(n=0|ce(7,0,t,((0|t)<0)<<31>>31)),0|w(),120,0),t=0|w(),r[e>>2]=2|n,r[e+4>>2]=t,0|(e=0))}function ne(t,e,n){t|=0,n|=0;var i,r,a,o,l=0,u=0,c=0,f=0,m=0,v=0;return v=+s[(e|=0)>>3],a=+s[t>>3],m=+d(.5*(v-a)),c=+s[e+8>>3],r=+s[t+8>>3],f=+d(.5*(c-r)),i=+A(+a),o=+A(+v),f=2*+y(+ +h(+(f=m*m+f*(o*i*f))),+ +h(+(1-f))),m=+s[n>>3],v=+d(.5*(m-v)),l=+s[n+8>>3],c=+d(.5*(l-c)),u=+A(+m),c=2*+y(+ +h(+(c=v*v+c*(o*u*c))),+ +h(+(1-c))),m=+d(.5*(a-m)),l=+d(.5*(r-l)),l=2*+y(+ +h(+(l=m*m+l*(i*u*l))),+ +h(+(1-l))),4*+g(+ +h(+ +p(.5*(u=.5*(f+c+l)))*+p(.5*(u-f))*+p(.5*(u-c))*+p(.5*(u-l))))}function ie(t,e,n){n|=0;var i,a,o,l=0,u=0;if(o=D,D=D+192|0,a=o,0|(u=0|Xt(t|=0,e|=0,i=o+168|0)))return D=o,0|(n=u);if(0|Yt(t,e,a)&&T(23313,22742,386,22751),(0|(e=0|r[a>>2]))>0){if(l=+ne(a+8|0,a+8+((1!=(0|e)&1)<<4)|0,i)+0,1!=(0|e)){t=1;do{l+=+ne(a+8+((u=t)<<4)|0,a+8+((0|(t=t+1|0))%(0|e)<<4)|0,i)}while((0|t)<(0|e))}}else l=0;return s[n>>3]=l,D=o,0|(n=0)}function re(t){t|=0;var e,n,i=0;return(e=0|Pe(1,12))||T(22832,22787,49,22845),0|(i=0|r[(n=t+4|0)>>2])?(r[(i=i+8|0)>>2]=e,r[n>>2]=e,0|e):(0|r[t>>2]&&T(22862,22787,61,22885),r[(i=t)>>2]=e,r[n>>2]=e,0|e)}function se(t,e){t|=0,e|=0;var n,i;return(i=0|Re(24))||T(22899,22787,78,22913),r[i>>2]=r[e>>2],r[i+4>>2]=r[e+4>>2],r[i+8>>2]=r[e+8>>2],r[i+12>>2]=r[e+12>>2],r[i+16>>2]=0,0|(n=0|r[(e=t+4|0)>>2])?(r[n+16>>2]=i,r[e>>2]=i,0|i):(0|r[t>>2]&&T(22928,22787,82,22913),r[t>>2]=i,r[e>>2]=i,0|i)}function ae(t){var e=0,n=0,i=0,s=0;if(t|=0)for(i=1;;){if(0|(e=0|r[t>>2]))do{if(0|(n=0|r[e>>2]))do{s=n,n=0|r[n+16>>2],Ne(s)}while(0|n);s=e,e=0|r[e+8>>2],Ne(s)}while(0|e);if(e=t,t=0|r[t+8>>2],i||Ne(e),!t)break;i=0}}function oe(t){var e,n,i=0,a=0,o=0,l=0,h=0,c=0,A=0,d=0,p=0,f=0,m=0,g=0,y=0,v=0,_=0,x=0,b=0,S=0,M=0,w=0,E=0,C=0,R=0,N=0,P=0,D=0,I=0,L=0,B=0,U=0;if(0|r[(l=(t|=0)+8|0)>>2])return 0|(U=1);if(!(o=0|r[t>>2]))return 0|(U=0);i=o,a=0;do{a=a+1|0,i=0|r[i+8>>2]}while(0|i);if(a>>>0<2)return 0|(U=0);(n=0|Re(a<<2))||T(22948,22787,317,22967),(e=0|Re(a<<5))||T(22989,22787,321,22967),r[t>>2]=0,r[(C=t+4|0)>>2]=0,r[l>>2]=0,a=0,L=0,E=0,m=0;t:for(;;){if(f=0|r[o>>2]){h=0,c=f;do{if(d=+s[c+8>>3],i=c,c=0|r[c+16>>2],A=+s[(l=(p=!(0|c))?f:c)+8>>3],+u(+(d-A))>3.141592653589793){U=14;break}h+=(A-d)*(+s[i>>3]+ +s[l>>3])}while(!p);if(14==(0|U)){U=0,h=0,i=f;do{w=+s[i+8>>3],D=0|r[(I=i+16|0)>>2],M=+s[(D=0|D?D:f)+8>>3],h+=(+s[i>>3]+ +s[D>>3])*((M<0?M+6.283185307179586:M)-(w<0?w+6.283185307179586:w)),i=0|r[(0|i?I:o)>>2]}while(0|i)}h>0?(r[n+(L<<2)>>2]=o,L=L+1|0,l=E,i=m):U=19}else U=19;if(19==(0|U)){U=0;do{if(!a){if(m){l=C,c=m+8|0,i=o,a=t;break}if(0|r[t>>2]){U=27;break t}l=C,c=t,i=o,a=t;break}if(0|r[(i=a+8|0)>>2]){U=21;break t}if(!(a=0|Pe(1,12))){U=23;break t}r[i>>2]=a,l=a+4|0,c=a,i=m}while(0);if(r[c>>2]=o,r[l>>2]=o,c=e+(E<<5)|0,p=0|r[o>>2]){for(s[(f=e+(E<<5)+8|0)>>3]=17976931348623157e292,s[(m=e+(E<<5)+24|0)>>3]=17976931348623157e292,s[c>>3]=-17976931348623157e292,s[(g=e+(E<<5)+16|0)>>3]=-17976931348623157e292,b=17976931348623157e292,S=-17976931348623157e292,l=0,y=p,d=17976931348623157e292,_=17976931348623157e292,x=-17976931348623157e292,A=-17976931348623157e292;h=+s[y>>3],w=+s[y+8>>3],y=0|r[y+16>>2],M=+s[((v=!(0|y))?p:y)+8>>3],h<d&&(s[f>>3]=h,d=h),w<_&&(s[m>>3]=w,_=w),h>x?s[c>>3]=h:h=x,w>A&&(s[g>>3]=w,A=w),b=w>0&w<b?w:b,S=w<0&w>S?w:S,l|=+u(+(w-M))>3.141592653589793,!v;)x=h;l&&(s[g>>3]=S,s[m>>3]=b)}else r[c>>2]=0,r[c+4>>2]=0,r[c+8>>2]=0,r[c+12>>2]=0,r[c+16>>2]=0,r[c+20>>2]=0,r[c+24>>2]=0,r[c+28>>2]=0;l=E+1|0}if(o=0|r[(I=o+8|0)>>2],r[I>>2]=0,!o){U=45;break}E=l,m=i}if(21==(0|U))T(22765,22787,35,22799);else if(23==(0|U))T(22819,22787,37,22799);else if(27==(0|U))T(22862,22787,61,22885);else if(45==(0|U)){t:do{if((0|L)>0){for(I=!(0|l),P=l<<2,D=!(0|t),N=0,i=0;;){if(R=0|r[n+(N<<2)>>2],I)U=73;else{if(!(E=0|Re(P))){U=50;break}if(!(C=0|Re(P))){U=52;break}e:do{if(D)a=0;else{for(l=0,a=0,c=t;o=e+(l<<5)|0,0|le(0|r[c>>2],o,0|r[R>>2])?(r[E+(a<<2)>>2]=c,r[C+(a<<2)>>2]=o,v=a+1|0):v=a,c=0|r[c+8>>2];)l=l+1|0,a=v;if((0|v)>0)if(o=0|r[E>>2],1==(0|v))a=o;else for(g=0,y=-1,a=o,m=o;;){for(p=0|r[m>>2],o=0,c=0;f=(0|(l=0|r[r[E+(c<<2)>>2]>>2]))==(0|p)?o:o+(1&le(l,0|r[C+(c<<2)>>2],0|r[p>>2]))|0,(0|(c=c+1|0))!=(0|v);)o=f;if(a=(l=(0|f)>(0|y))?m:a,(0|(o=g+1|0))==(0|v))break e;g=o,y=l?f:y,m=0|r[E+(o<<2)>>2]}else a=0}}while(0);if(Ne(E),Ne(C),a){if(o=0|r[(l=a+4|0)>>2])a=o+8|0;else if(0|r[a>>2]){U=70;break}r[a>>2]=R,r[l>>2]=R}else U=73}if(73==(0|U)){if(U=0,0|(i=0|r[R>>2]))do{C=i,i=0|r[i+16>>2],Ne(C)}while(0|i);Ne(R),i=1}if((0|(N=N+1|0))>=(0|L)){B=i;break t}}50==(0|U)?T(23004,22787,249,23023):52==(0|U)?T(23042,22787,252,23023):70==(0|U)&&T(22862,22787,61,22885)}else B=0}while(0);return Ne(n),Ne(e),0|(U=B)}return 0}function le(t,e,n){t|=0;var i=0,a=0,o=0,l=0,u=0,h=0,c=0,A=0;if(!(0|Y(e|=0,n|=0)))return 0|(t=0);if(e=0|X(e),i=+s[n>>3],a=e&(a=+s[n+8>>3])<0?a+6.283185307179586:a,!(t=0|r[t>>2]))return 0|(t=0);if(e){e=0,c=a,n=t;t:for(;;){for(;l=+s[n>>3],a=+s[n+8>>3],A=0|r[(n=n+16|0)>>2],o=+s[(A=0|A?A:t)>>3],u=+s[A+8>>3],l>o?(h=l,l=u):(h=o,o=l,l=a,a=u),(i=i==o|i==h?i+2220446049250313e-31:i)<o|i>h;)if(!(n=0|r[n>>2])){n=22;break t}if(((h=(u=l<0?l+6.283185307179586:l)+(i-o)/(h-o)*((l=a<0?a+6.283185307179586:a)-u))<0?h+6.283185307179586:h)>(c=u==c|l==c?c+-2220446049250313e-31:c)&&(e^=1),!(n=0|r[n>>2])){n=22;break}}if(22==(0|n))return 0|e}else{e=0,c=a,n=t;t:for(;;){for(;l=+s[n>>3],a=+s[n+8>>3],A=0|r[(n=n+16|0)>>2],o=+s[(A=0|A?A:t)>>3],u=+s[A+8>>3],l>o?(h=l,l=u):(h=o,o=l,l=a,a=u),(i=i==o|i==h?i+2220446049250313e-31:i)<o|i>h;)if(!(n=0|r[n>>2])){n=22;break t}if(l+(i-o)/(h-o)*(a-l)>(c=l==c|a==c?c+-2220446049250313e-31:c)&&(e^=1),!(n=0|r[n>>2])){n=22;break}}if(22==(0|n))return 0|e}return 0}function ue(t,e,n,s,a){n|=0,s|=0,a|=0;var o,l,u,h,c=0,A=0,d=0,p=0,f=0,m=0,g=0,y=0,v=0,_=0;if(h=D,D=D+32|0,_=h+16|0,u=h,c=0|qe(0|(t|=0),0|(e|=0),52),w(),c&=15,g=0|qe(0|n,0|s,52),w(),(0|c)!=(15&g))return D=h,0|(_=12);if(f=0|qe(0|t,0|e,45),w(),f&=127,m=0|qe(0|n,0|s,45),w(),f>>>0>121|(m&=127)>>>0>121)return D=h,0|(_=5);if(g=(0|f)!=(0|m)){if(7==(0|(d=0|W(f,m))))return D=h,0|(_=1);7==(0|(p=0|W(m,f)))?T(23066,23090,161,23100):(y=d,A=p)}else y=0,A=0;o=0|z(f),l=0|z(m),r[_>>2]=0,r[_+4>>2]=0,r[_+8>>2]=0,r[_+12>>2]=0;do{if(y){if(d=(0|(m=0|r[4272+(28*f|0)+(y<<2)>>2]))>0,l)if(d){f=0,p=n,d=s;do{p=0|qt(p,d),d=0|w(),1==(0|(A=0|ft(A)))&&(A=0|ft(1)),f=f+1|0}while((0|f)!=(0|m));m=A,f=p,p=d}else m=A,f=n,p=s;else if(d){f=0,p=n,d=s;do{p=0|Gt(p,d),d=0|w(),A=0|ft(A),f=f+1|0}while((0|f)!=(0|m));m=A,f=p,p=d}else m=A,f=n,p=s;if(jt(f,p,_),g||T(23115,23090,191,23100),(d=!!(0|o))&(A=!!(0|l))&&T(23142,23090,192,23100),d){if(7==(0|(A=0|Ft(t,e)))){c=5;break}if(0|i[21872+(7*A|0)+y|0]){c=1;break}f=p=0|r[21040+(28*A|0)+(y<<2)>>2]}else if(A){if(7==(0|(A=0|Ft(f,p)))){c=5;break}if(0|i[21872+(7*A|0)+m|0]){c=1;break}f=0,p=0|r[21040+(28*m|0)+(A<<2)>>2]}else f=0,p=0;if((f|p)<0)c=5;else{if((0|p)>0){d=_+4|0,A=0;do{dt(d),A=A+1|0}while((0|A)!=(0|p))}if(r[u>>2]=0,r[u+4>>2]=0,r[u+8>>2]=0,ct(u,y),0|c)for(;0|Vt(c)?ut(u):ht(u),(0|c)>1;)c=c+-1|0;if((0|f)>0){c=0;do{dt(u),c=c+1|0}while((0|c)!=(0|f))}et(v=_+4|0,u,v),J(v),v=51}}else if(jt(n,s,_),!!(0|o)&!!(0|l))if((0|m)!=(0|f)&&T(23173,23090,261,23100),7==(0|(A=0|Ft(t,e)))|7==(0|(c=0|Ft(n,s))))c=5;else if(0|i[21872+(7*A|0)+c|0])c=1;else if((0|(A=0|r[21040+(28*A|0)+(c<<2)>>2]))>0){d=_+4|0,c=0;do{dt(d),c=c+1|0}while((0|c)!=(0|A));v=51}else v=51;else v=51}while(0);return 51==(0|v)&&(c=_+4|0,r[a>>2]=r[c>>2],r[a+4>>2]=r[c+4>>2],r[a+8>>2]=r[c+8>>2],c=0),D=h,0|(_=c)}function he(t,e,n,i){n|=0,i|=0;var s,a,o,l=0,u=0,h=0,c=0,A=0,d=0,p=0,f=0,m=0,g=0,y=0,v=0,_=0;if(o=D,D=D+48|0,s=o+36|0,h=o+24|0,c=o+12|0,A=o,l=0|qe(0|(t|=0),0|(e|=0),52),w(),l&=15,p=0|qe(0|t,0|e,45),w(),(p&=127)>>>0>121)return D=o,0|(i=5);if(a=0|z(p),Ge(0|l,0,52),g=134225919|w(),r[(u=i)>>2]=-1,r[u+4>>2]=g,!l)return 7==(0|(l=0|rt(n)))||127==(0|(l=0|j(p,l)))?(D=o,0|(g=1)):(f=0|Ge(0|l,0,45),m=0|w(),m=-1040385&r[(p=i)+4>>2]|m,r[(g=i)>>2]=r[p>>2]|f,r[g+4>>2]=m,D=o,0|(g=0));for(r[s>>2]=r[n>>2],r[s+4>>2]=r[n+4>>2],r[s+8>>2]=r[n+8>>2],n=l;;){if(u=n,n=n+-1|0,r[h>>2]=r[s>>2],r[h+4>>2]=r[s+4>>2],r[h+8>>2]=r[s+8>>2],0|Vt(u)){if(0|(l=0|st(s))){n=13;break}r[c>>2]=r[s>>2],r[c+4>>2]=r[s+4>>2],r[c+8>>2]=r[s+8>>2],ut(c)}else{if(0|(l=0|at(s))){n=13;break}r[c>>2]=r[s>>2],r[c+4>>2]=r[s+4>>2],r[c+8>>2]=r[s+8>>2],ht(c)}if(nt(h,c,A),J(A),v=0|r[(l=i)>>2],l=0|r[l+4>>2],y=0|Ge(7,0,0|(_=3*(15-u|0)|0)),l&=~w(),_=0|Ge(0|rt(A),0,0|_),l=w()|l,r[(g=i)>>2]=_|v&~y,r[g+4>>2]=l,(0|u)<=1){n=14;break}}t:do{if(13!=(0|n)&&14==(0|n))if((0|r[s>>2])<=1&&(0|r[s+4>>2])<=1&&(0|r[s+8>>2])<=1){A=127==(0|(l=0|j(p,n=0|rt(s))))?0:0|z(l);e:do{if(n){if(a){if(7==(0|(l=0|Ft(t,e)))){l=5;break t}if((0|(u=0|r[21248+(28*l|0)+(n<<2)>>2]))>0){l=n,n=0;do{l=0|pt(l),n=n+1|0}while((0|n)!=(0|u))}else l=n;if(1==(0|l)){l=9;break t}127==(0|(n=0|j(p,l)))&&T(23200,23090,411,23230),0|z(n)?T(23245,23090,412,23230):(m=n,f=u,d=l)}else m=l,f=0,d=n;if((0|(c=0|r[4272+(28*p|0)+(d<<2)>>2]))<=-1&&T(23276,23090,419,23230),!A){if((0|f)<0){l=5;break t}if(0|f){l=0,n=0|r[(u=i)>>2],u=0|r[u+4>>2];do{n=0|zt(n,u),u=0|w(),r[(_=i)>>2]=n,r[_+4>>2]=u,l=l+1|0}while((0|l)<(0|f))}if((0|c)<=0){l=m,n=58;break}for(l=0,n=0|r[(u=i)>>2],u=0|r[u+4>>2];;)if(n=0|zt(n,u),u=0|w(),r[(_=i)>>2]=n,r[_+4>>2]=u,(0|(l=l+1|0))==(0|c)){l=m,n=58;break e}}if(7==(0|(h=0|W(m,p)))&&T(23066,23090,428,23230),n=0|r[(l=i)>>2],l=0|r[l+4>>2],(0|c)>0){u=0;do{n=0|zt(n,l),l=0|w(),r[(_=i)>>2]=n,r[_+4>>2]=l,u=u+1|0}while((0|u)!=(0|c))}if(7==(0|(l=0|Ft(n,l)))&&T(23313,23090,440,23230),n=0|q(m),(0|(n=0|r[(n?21664:21456)+(28*h|0)+(l<<2)>>2]))<0&&T(23313,23090,454,23230),n){l=0,u=0|r[(h=i)>>2],h=0|r[h+4>>2];do{u=0|kt(u,h),h=0|w(),r[(_=i)>>2]=u,r[_+4>>2]=h,l=l+1|0}while((0|l)<(0|n));l=m,n=58}else l=m,n=58}else if(!!(0|a)&!!(0|A)){if(7==(0|(n=0|Ft(t,e)))|7==(0|(u=0|Ft(0|r[(u=i)>>2],0|r[u+4>>2])))){l=5;break t}if((0|(u=0|r[21248+(28*n|0)+(u<<2)>>2]))<0){l=5;break t}if(u){n=0,h=0|r[(c=i)>>2],c=0|r[c+4>>2];do{h=0|zt(h,c),c=0|w(),r[(_=i)>>2]=h,r[_+4>>2]=c,n=n+1|0}while((0|n)<(0|u));n=58}else n=59}else n=58}while(0);if(58==(0|n)&&A&&(n=59),59==(0|n)&&1==(0|Ft(0|r[(_=i)>>2],0|r[_+4>>2]))){l=9;break}y=0|r[(_=i)>>2],_=-1040385&r[_+4>>2],v=0|Ge(0|l,0,45),_|=w(),r[(l=i)>>2]=y|v,r[l+4>>2]=_,l=0}else l=1}while(0);return D=o,0|(_=l)}function ce(t,e,n,i){t|=0,e|=0;var r=0,s=0,a=0;if(!(0|(n|=0))&!(0|(i|=0)))return s=1,M(0|(r=0)),0|s;s=t,r=e,t=1,e=0;do{t=0|Oe(0|((a=!0&!(1&n))?1:s),0|(a?0:r),0|t,0|e),e=0|w(),n=0|ze(0|n,0|i,1),i=0|w(),s=0|Oe(0|s,0|r,0|s,0|r),r=0|w()}while(!(!(0|n)&!(0|i)));return M(0|e),0|t}function Ae(t,e,n){t|=0;var i,a=0,o=0,l=0,u=0,h=0,c=0,A=0,d=0,p=0;if(!(0|Y(e|=0,n|=0)))return 0|(p=0);if(e=0|X(e),a=+s[n>>3],o=e&(o=+s[n+8>>3])<0?o+6.283185307179586:o,(0|(p=0|r[t>>2]))<=0)return 0|(p=0);if(i=0|r[t+4>>2],e){e=0,d=o,n=-1,t=0;t:for(;;){for(A=t;u=+s[i+(A<<4)>>3],o=+s[i+(A<<4)+8>>3],l=+s[i+((t=(n+2|0)%(0|p)|0)<<4)>>3],h=+s[i+(t<<4)+8>>3],u>l?(c=u,u=h):(c=l,l=u,u=o,o=h),(a=a==l|a==c?a+2220446049250313e-31:a)<l|a>c;){if((0|(n=A+1|0))>=(0|p)){n=22;break t}t=A,A=n,n=t}if(((c=(h=u<0?u+6.283185307179586:u)+(a-l)/(c-l)*((u=o<0?o+6.283185307179586:o)-h))<0?c+6.283185307179586:c)>(d=h==d|u==d?d+-2220446049250313e-31:d)&&(e^=1),(0|(t=A+1|0))>=(0|p)){n=22;break}n=A}if(22==(0|n))return 0|e}else{e=0,d=o,n=-1,t=0;t:for(;;){for(A=t;u=+s[i+(A<<4)>>3],o=+s[i+(A<<4)+8>>3],l=+s[i+((t=(n+2|0)%(0|p)|0)<<4)>>3],h=+s[i+(t<<4)+8>>3],u>l?(c=u,u=h):(c=l,l=u,u=o,o=h),(a=a==l|a==c?a+2220446049250313e-31:a)<l|a>c;){if((0|(n=A+1|0))>=(0|p)){n=22;break t}t=A,A=n,n=t}if(u+(a-l)/(c-l)*(o-u)>(d=u==d|o==d?d+-2220446049250313e-31:d)&&(e^=1),(0|(t=A+1|0))>=(0|p)){n=22;break}n=A}if(22==(0|n))return 0|e}return 0}function de(t,e){e|=0;var n,i,a,o,l,h=0,c=0,A=0,d=0,p=0,f=0,m=0,g=0,y=0,v=0,_=0,x=0;if(!(i=0|r[(t|=0)>>2]))return r[e>>2]=0,r[e+4>>2]=0,r[e+8>>2]=0,r[e+12>>2]=0,r[e+16>>2]=0,r[e+20>>2]=0,r[e+24>>2]=0,void(r[e+28>>2]=0);if(s[(a=e+8|0)>>3]=17976931348623157e292,s[(o=e+24|0)>>3]=17976931348623157e292,s[e>>3]=-17976931348623157e292,s[(l=e+16|0)>>3]=-17976931348623157e292,!((0|i)<=0)){for(n=0|r[t+4>>2],g=17976931348623157e292,y=-17976931348623157e292,v=0,t=-1,d=17976931348623157e292,p=17976931348623157e292,m=-17976931348623157e292,c=-17976931348623157e292,_=0;h=+s[n+(_<<4)>>3],f=+s[n+(_<<4)+8>>3],A=+s[n+(((0|(t=t+2|0))==(0|i)?0:t)<<4)+8>>3],h<d&&(s[a>>3]=h,d=h),f<p&&(s[o>>3]=f,p=f),h>m?s[e>>3]=h:h=m,f>c&&(s[l>>3]=f,c=f),g=f>0&f<g?f:g,y=f<0&f>y?f:y,v|=+u(+(f-A))>3.141592653589793,(0|(t=_+1|0))!=(0|i);)x=_,m=h,_=t,t=x;v&&(s[l>>3]=y,s[o>>3]=g)}}function pe(t,e){e|=0;var n,i=0,a=0,o=0,l=0,h=0,c=0,A=0,d=0,p=0,f=0,m=0,g=0,y=0,v=0,_=0,x=0,b=0,S=0,M=0,w=0,T=0;if(y=0|r[(t|=0)>>2]){if(s[(v=e+8|0)>>3]=17976931348623157e292,s[(_=e+24|0)>>3]=17976931348623157e292,s[e>>3]=-17976931348623157e292,s[(x=e+16|0)>>3]=-17976931348623157e292,(0|y)>0){for(o=0|r[t+4>>2],m=17976931348623157e292,g=-17976931348623157e292,a=0,i=-1,A=17976931348623157e292,d=17976931348623157e292,f=-17976931348623157e292,h=-17976931348623157e292,b=0;l=+s[o+(b<<4)>>3],p=+s[o+(b<<4)+8>>3],c=+s[o+(((0|(w=i+2|0))==(0|y)?0:w)<<4)+8>>3],l<A&&(s[v>>3]=l,A=l),p<d&&(s[_>>3]=p,d=p),l>f?s[e>>3]=l:l=f,p>h&&(s[x>>3]=p,h=p),m=p>0&p<m?p:m,g=p<0&p>g?p:g,a|=+u(+(p-c))>3.141592653589793,(0|(i=b+1|0))!=(0|y);)w=b,f=l,b=i,i=w;a&&(s[x>>3]=g,s[_>>3]=m)}}else r[e>>2]=0,r[e+4>>2]=0,r[e+8>>2]=0,r[e+12>>2]=0,r[e+16>>2]=0,r[e+20>>2]=0,r[e+24>>2]=0,r[e+28>>2]=0;if(!((0|(i=0|r[(w=t+8|0)>>2]))<=0)){n=t+12|0,M=0;do{if(o=0|r[n>>2],a=M,_=e+((M=M+1|0)<<5)|0,x=0|r[o+(a<<3)>>2]){if(s[(b=e+(M<<5)+8|0)>>3]=17976931348623157e292,s[(t=e+(M<<5)+24|0)>>3]=17976931348623157e292,s[_>>3]=-17976931348623157e292,s[(S=e+(M<<5)+16|0)>>3]=-17976931348623157e292,(0|x)>0){for(y=0|r[o+(a<<3)+4>>2],m=17976931348623157e292,g=-17976931348623157e292,o=0,a=-1,v=0,A=17976931348623157e292,d=17976931348623157e292,p=-17976931348623157e292,h=-17976931348623157e292;l=+s[y+(v<<4)>>3],f=+s[y+(v<<4)+8>>3],c=+s[y+(((0|(a=a+2|0))==(0|x)?0:a)<<4)+8>>3],l<A&&(s[b>>3]=l,A=l),f<d&&(s[t>>3]=f,d=f),l>p?s[_>>3]=l:l=p,f>h&&(s[S>>3]=f,h=f),m=f>0&f<m?f:m,g=f<0&f>g?f:g,o|=+u(+(f-c))>3.141592653589793,(0|(a=v+1|0))!=(0|x);)T=v,v=a,p=l,a=T;o&&(s[S>>3]=g,s[t>>3]=m)}}else r[_>>2]=0,r[_+4>>2]=0,r[_+8>>2]=0,r[_+12>>2]=0,r[_+16>>2]=0,r[_+20>>2]=0,r[_+24>>2]=0,r[_+28>>2]=0,i=0|r[w>>2]}while((0|M)<(0|i))}}function fe(t,e,n){var i=0,s=0,a=0;if(!(0|Ae(t|=0,e|=0,n|=0)))return 0|(s=0);if((0|r[(s=t+8|0)>>2])<=0)return 0|(s=1);for(i=t+12|0,t=0;;){if(a=t,t=t+1|0,0|Ae((0|r[i>>2])+(a<<3)|0,e+(t<<5)|0,n)){t=0,i=6;break}if((0|t)>=(0|r[s>>2])){t=1,i=6;break}}return 6==(0|i)?0|t:0}function me(t,e,n,i,r){e|=0,n|=0,i|=0,r|=0;var a,o,l,u,h,c,A,d=0;u=+s[(t|=0)>>3],l=+s[e>>3]-u,o=+s[t+8>>3],a=+s[e+8>>3]-o,c=+s[n>>3],d=((d=+s[i>>3]-c)*(o-(A=+s[n+8>>3]))-(u-c)*(h=+s[i+8>>3]-A))/(l*h-a*d),s[r>>3]=u+l*d,s[r+8>>3]=o+a*d}function ge(t,e){return e|=0,+u(+(+s[(t|=0)>>3]-+s[e>>3]))<1.1920928955078125e-7?0|(e=+u(+(+s[t+8>>3]-+s[e+8>>3]))<1.1920928955078125e-7):0|(e=0)}function ye(t,e){e|=0;var n,i,r;return+((r=+s[(t|=0)>>3]-+s[e>>3])*r+(i=+s[t+8>>3]-+s[e+8>>3])*i+(n=+s[t+16>>3]-+s[e+16>>3])*n)}function ve(t,e,n){n|=0;var i,s,a,o,l=0,u=0,h=0;if(o=D,D=D+32|0,h=o,0|(l=0|Wt(t|=0,e|=0,s=o+16|0)))return D=o,0|(n=l);i=0|It(t,e),a=0|Ft(t,e),function(t,e){t=7696+(28*(t|=0)|0)|0,r[(e|=0)>>2]=r[t>>2],r[e+4>>2]=r[t+4>>2],r[e+8>>2]=r[t+8>>2],r[e+12>>2]=r[t+12>>2]}(i,h),l=0|function(t,e){t|=0;var n=0,i=0;if((e|=0)>>>0>20)return-1;do{if((0|r[11120+(216*e|0)>>2])!=(0|t))if((0|r[11120+(216*e|0)+8>>2])!=(0|t))if((0|r[11120+(216*e|0)+16>>2])!=(0|t))if((0|r[11120+(216*e|0)+24>>2])!=(0|t))if((0|r[11120+(216*e|0)+32>>2])!=(0|t))if((0|r[11120+(216*e|0)+40>>2])!=(0|t))if((0|r[11120+(216*e|0)+48>>2])!=(0|t))if((0|r[11120+(216*e|0)+56>>2])!=(0|t))if((0|r[11120+(216*e|0)+64>>2])!=(0|t))if((0|r[11120+(216*e|0)+72>>2])!=(0|t))if((0|r[11120+(216*e|0)+80>>2])!=(0|t))if((0|r[11120+(216*e|0)+88>>2])!=(0|t))if((0|r[11120+(216*e|0)+96>>2])!=(0|t))if((0|r[11120+(216*e|0)+104>>2])!=(0|t))if((0|r[11120+(216*e|0)+112>>2])!=(0|t))if((0|r[11120+(216*e|0)+120>>2])!=(0|t))if((0|r[11120+(216*e|0)+128>>2])!=(0|t)){if((0|r[11120+(216*e|0)+136>>2])!=(0|t)){if((0|r[11120+(216*e|0)+144>>2])==(0|t)){t=0,n=2,i=0;break}if((0|r[11120+(216*e|0)+152>>2])==(0|t)){t=0,n=2,i=1;break}if((0|r[11120+(216*e|0)+160>>2])==(0|t)){t=0,n=2,i=2;break}if((0|r[11120+(216*e|0)+168>>2])==(0|t)){t=1,n=2,i=0;break}if((0|r[11120+(216*e|0)+176>>2])==(0|t)){t=1,n=2,i=1;break}if((0|r[11120+(216*e|0)+184>>2])==(0|t)){t=1,n=2,i=2;break}if((0|r[11120+(216*e|0)+192>>2])==(0|t)){t=2,n=2,i=0;break}if((0|r[11120+(216*e|0)+200>>2])==(0|t)){t=2,n=2,i=1;break}if((0|r[11120+(216*e|0)+208>>2])==(0|t)){t=2,n=2,i=2;break}return-1}t=2,n=1,i=2}else t=2,n=1,i=1;else t=2,n=1,i=0;else t=1,n=1,i=2;else t=1,n=1,i=1;else t=1,n=1,i=0;else t=0,n=1,i=2;else t=0,n=1,i=1;else t=0,n=1,i=0;else t=2,n=0,i=2;else t=2,n=0,i=1;else t=2,n=0,i=0;else t=1,n=0,i=2;else t=1,n=0,i=1;else t=1,n=0,i=0;else t=0,n=0,i=2;else t=0,n=0,i=1;else t=0,n=0,i=0}while(0);return 0|r[11120+(216*e|0)+(72*n|0)+(24*t|0)+(i<<3)+4>>2]}(i,0|r[s>>2]);t:do{if(0|z(i)){switch(0|i){case 4:t=0;break;case 14:t=1;break;case 24:t=2;break;case 38:t=3;break;case 49:t=4;break;case 58:t=5;break;case 63:t=6;break;case 72:t=7;break;case 83:t=8;break;case 97:t=9;break;case 107:t=10;break;case 117:t=11;break;default:l=1;break t}if(u=0|r[22e3+(24*t|0)+8>>2],e=0|r[22e3+(24*t|0)+16>>2],(0|(t=0|r[s>>2]))!=(0|r[h>>2])&&(h=0|q(i))|(0|(t=0|r[s>>2]))==(0|e)&&(l=(l+1|0)%6|0),3==(0|a)&(0|t)==(0|e)){l=(l+5|0)%6|0,u=22;break}5==(0|a)&(0|t)==(0|u)?(l=(l+1|0)%6|0,u=22):u=22}else u=22}while(0);return 22==(0|u)&&(r[n>>2]=l,l=0),D=o,0|(n=l)}function _e(t,e,n,i){n|=0,i|=0;var s,a,o,l,u,h=0,c=0,A=0,d=0,p=0,f=0,m=0,g=0,y=0,v=0,_=0;if(u=D,D=D+32|0,_=u+24|0,l=u+20|0,o=u+8|0,a=u+16|0,s=u,p=(p=!(0|Ot(t|=0,e|=0)))?6:5,m=0|qe(0|t,0|e,52),w(),p>>>0<=n>>>0)return D=u,0|(i=2);!(g=!(0|(m&=15)))&&!((y=0|Ge(7,0,3*(15^m)|0))&t)&!(w()&e)?h=n:c=4;t:do{if(4==(0|c)){if((0|((h=!!(0|Ot(t,e)))?4:5))<(0|n))return D=u,0|(i=1);if(0|ve(t,e,_))return D=u,0|(i=1);if(c=(0|r[_>>2])+n|0,7==(0|(y=0|r[(h=h?22288+((0|c)%5<<2)|0:22320+((0|c)%6<<2)|0)>>2])))return D=u,0|(i=1);r[l>>2]=0,h=0|O(t,e,y,l,o);do{if(!h){if(f=0|r[(d=o)>>2],c=(A=(d=0|r[d+4>>2])>>>0<e>>>0|(0|d)==(0|e)&f>>>0<t>>>0)?f:t,A=A?d:e,!g&&!(f&(g=0|Ge(7,0,3*(15^m)|0)))&!(d&w()))h=n;else{if(d=(n+-1+p|0)%(0|p)|0,h=0|Ot(t,e),(0|d)<0&&T(23313,23315,245,23324),(0|((p=!!(0|h))?4:5))<(0|d)&&T(23313,23315,245,23324),0|ve(t,e,_)&&T(23313,23315,245,23324),h=(0|r[_>>2])+d|0,7==(0|(d=0|r[(h=p?22288+((0|h)%5<<2)|0:22320+((0|h)%6<<2)|0)>>2]))&&T(23313,23315,245,23324),r[a>>2]=0,0|(h=0|O(t,e,d,a,s)))break;p=0|r[(f=s)>>2],f=0|r[f+4>>2];do{if(f>>>0<A>>>0|(0|f)==(0|A)&p>>>0<c>>>0){if(c=0|Ot(p,f)?0|F(p,f,t,e):0|r[22384+(((0|r[a>>2])+(0|r[22352+(d<<2)>>2])|0)%6<<2)>>2],h=0|Ot(p,f),(c+-1|0)>>>0>5){h=-1,c=p,A=f;break}if(1==(0|c)&(h=!!(0|h))){h=-1,c=p,A=f;break}do{if(!(0|ve(p,f,_))){if(h){h=(5+(0|r[21936+(c<<2)>>2])-(0|r[_>>2])|0)%5|0;break}h=(6+(0|r[21968+(c<<2)>>2])-(0|r[_>>2])|0)%6|0;break}h=-1}while(0);c=p,A=f}else h=n}while(0);f=0|r[(d=o)>>2],d=0|r[d+4>>2]}if((0|c)==(0|f)&(0|A)==(0|d)){if(t=(p=!!(0|Ot(f,d)))?0|F(f,d,t,e):0|r[22384+(((0|r[l>>2])+(0|r[22352+(y<<2)>>2])|0)%6<<2)>>2],h=0|Ot(f,d),(t+-1|0)>>>0<=5&&!(1==(0|t)&(v=!!(0|h))))do{if(!(0|ve(f,d,_))){if(v){h=(5+(0|r[21936+(t<<2)>>2])-(0|r[_>>2])|0)%5|0;break}h=(6+(0|r[21968+(t<<2)>>2])-(0|r[_>>2])|0)%6|0;break}h=-1}while(0);else h=-1;h=6==(0|(h=h+1|0))|p&5==(0|h)?0:h}e=A,t=c;break t}}while(0);return D=u,0|(i=h)}}while(0);return v=0|Ge(0|h,0,56),_=w()|-2130706433&e|536870912,r[i>>2]=v|t,r[i+4>>2]=_,D=u,0|(i=0)}function xe(t,e,n){t|=0,n|=0;var i=0;(0|(e|=0))>0?(i=0|Pe(e,4),r[t>>2]=i,i||T(23337,23360,40,23374)):r[t>>2]=0,r[t+4>>2]=e,r[t+8>>2]=0,r[t+12>>2]=n}function be(t){var e,n,i,a=0,o=0,l=0,h=0;e=(t|=0)+4|0,n=t+12|0,i=t+8|0;t:for(;;){for(o=0|r[e>>2],a=0;;){if((0|a)>=(0|o))break t;if(l=0|r[t>>2],h=0|r[l+(a<<2)>>2])break;a=a+1|0}a=l+(~~(+u(+ +c(10,+ +(15-(0|r[n>>2])|0))*(+s[h>>3]+ +s[h+8>>3]))%+(0|o))>>>0<<2)|0,o=0|r[a>>2];e:do{if(0|o){if(l=h+32|0,(0|o)==(0|h))r[a>>2]=r[l>>2];else{if(!(a=0|r[(o=o+32|0)>>2]))break;for(;(0|a)!=(0|h);)if(!(a=0|r[(o=a+32|0)>>2]))break e;r[o>>2]=r[l>>2]}Ne(h),r[i>>2]=(0|r[i>>2])-1}}while(0)}Ne(0|r[t>>2])}function Se(t){var e,n=0,i=0;for(e=0|r[(t|=0)+4>>2],i=0;;){if((0|i)>=(0|e)){n=0,i=4;break}if(n=0|r[(0|r[t>>2])+(i<<2)>>2]){i=4;break}i=i+1|0}return 4==(0|i)?0|n:0}function Me(t,e){e|=0;var n=0,i=0,a=0,o=0;if(n=~~(+u(+ +c(10,+ +(15-(0|r[(t|=0)+12>>2])|0))*(+s[e>>3]+ +s[e+8>>3]))%+(0|r[t+4>>2]))>>>0,n=(0|r[t>>2])+(n<<2)|0,!(i=0|r[n>>2]))return 0|(o=1);o=e+32|0;do{if((0|i)!=(0|e)){if(!(n=0|r[i+32>>2]))return 0|(o=1);for(a=n;;){if((0|a)==(0|e)){a=8;break}if(!(n=0|r[a+32>>2])){n=1,a=10;break}i=a,a=n}if(8==(0|a)){r[i+32>>2]=r[o>>2];break}if(10==(0|a))return 0|n}else r[n>>2]=r[o>>2]}while(0);return Ne(e),r[(o=t+8|0)>>2]=(0|r[o>>2])-1,0|(o=0)}function we(t,e,n){t|=0,e|=0,n|=0;var i,a=0,o=0,l=0;(i=0|Re(40))||T(23390,23360,98,23403),r[i>>2]=r[e>>2],r[i+4>>2]=r[e+4>>2],r[i+8>>2]=r[e+8>>2],r[i+12>>2]=r[e+12>>2],r[(o=i+16|0)>>2]=r[n>>2],r[o+4>>2]=r[n+4>>2],r[o+8>>2]=r[n+8>>2],r[o+12>>2]=r[n+12>>2],r[i+32>>2]=0,o=~~(+u(+ +c(10,+ +(15-(0|r[t+12>>2])|0))*(+s[e>>3]+ +s[e+8>>3]))%+(0|r[t+4>>2]))>>>0,o=(0|r[t>>2])+(o<<2)|0,a=0|r[o>>2];do{if(a){for(;!(0|Jt(a,e)&&0|Jt(a+16|0,n));)if(o=0|r[a+32>>2],!(0|r[(a=0|o?o:a)+32>>2])){l=10;break}if(10==(0|l)){r[a+32>>2]=i;break}return Ne(i),0|(l=a)}r[o>>2]=i}while(0);return r[(l=t+8|0)>>2]=1+(0|r[l>>2]),0|(l=i)}function Te(t,e,n){e|=0,n|=0;var i=0,a=0;if(a=~~(+u(+ +c(10,+ +(15-(0|r[(t|=0)+12>>2])|0))*(+s[e>>3]+ +s[e+8>>3]))%+(0|r[t+4>>2]))>>>0,!(a=0|r[(0|r[t>>2])+(a<<2)>>2]))return 0|(n=0);if(!n){for(t=a;;){if(0|Jt(t,e)){i=10;break}if(!(t=0|r[t+32>>2])){t=0,i=10;break}}if(10==(0|i))return 0|t}for(t=a;;){if(0|Jt(t,e)&&0|Jt(t+16|0,n)){i=10;break}if(!(t=0|r[t+32>>2])){t=0,i=10;break}}return 10==(0|i)?0|t:0}function Ee(t,e){e|=0;var n=0;if(n=~~(+u(+ +c(10,+ +(15-(0|r[(t|=0)+12>>2])|0))*(+s[e>>3]+ +s[e+8>>3]))%+(0|r[t+4>>2]))>>>0,!(t=0|r[(0|r[t>>2])+(n<<2)>>2]))return 0|(n=0);for(;;){if(0|Jt(t,e)){e=5;break}if(!(t=0|r[t+32>>2])){t=0,e=5;break}}return 5==(0|e)?0|t:0}function Ce(t){return 0|+function(t){return+ +Ye(+(t=+t))}(t=+t)}function Re(t){t|=0;var e,n=0,i=0,s=0,a=0,o=0,l=0,u=0,h=0,c=0,A=0,d=0,p=0,f=0,m=0,g=0,y=0,v=0,_=0,x=0,b=0;e=D,D=D+16|0,p=e;do{if(t>>>0<245){if(t=(c=t>>>0<11?16:t+11&-8)>>>3,3&(i=(d=0|r[5857])>>>t))return s=0|r[(i=(t=23468+((n=(1&i^1)+t|0)<<1<<2)|0)+8|0)>>2],(0|(o=0|r[(a=s+8|0)>>2]))==(0|t)?r[5857]=d&~(1<<n):(r[o+12>>2]=t,r[i>>2]=o),b=n<<3,r[s+4>>2]=3|b,r[(b=s+b+4|0)>>2]=1|r[b>>2],D=e,0|(b=a);if(c>>>0>(A=0|r[5859])>>>0){if(0|i)return n=((n=i<<t&((n=2<<t)|0-n))&0-n)-1|0,o=0|r[(t=(n=23468+((s=((i=(n>>>=u=n>>>12&16)>>>5&8)|u|(o=(n>>>=i)>>>2&4)|(t=(n>>>=o)>>>1&2)|(s=(n>>>=t)>>>1&1))+(n>>>s)|0)<<1<<2)|0)+8|0)>>2],(0|(i=0|r[(u=o+8|0)>>2]))==(0|n)?(t=d&~(1<<s),r[5857]=t):(r[i+12>>2]=n,r[t>>2]=i,t=d),l=(b=s<<3)-c|0,r[o+4>>2]=3|c,r[(a=o+c|0)+4>>2]=1|l,r[o+b>>2]=l,0|A&&(s=0|r[5862],i=23468+((n=A>>>3)<<1<<2)|0,t&(n=1<<n)?n=0|r[(t=i+8|0)>>2]:(r[5857]=t|n,n=i,t=i+8|0),r[t>>2]=s,r[n+12>>2]=s,r[s+8>>2]=n,r[s+12>>2]=i),r[5859]=l,r[5862]=a,D=e,0|(b=u);if(o=0|r[5858]){for(i=(o&0-o)-1|0,i=h=0|r[23732+(((s=(i>>>=a=i>>>12&16)>>>5&8)|a|(l=(i>>>=s)>>>2&4)|(u=(i>>>=l)>>>1&2)|(h=(i>>>=u)>>>1&1))+(i>>>h)<<2)>>2],u=h,h=(-8&r[h+4>>2])-c|0;(t=0|r[i+16>>2])||(t=0|r[i+20>>2]);)i=t,u=(a=(l=(-8&r[t+4>>2])-c|0)>>>0<h>>>0)?t:u,h=a?l:h;if((l=u+c|0)>>>0>u>>>0){a=0|r[u+24>>2],n=0|r[u+12>>2];do{if((0|n)==(0|u)){if(!(n=0|r[(t=u+20|0)>>2])&&!(n=0|r[(t=u+16|0)>>2])){i=0;break}for(;;)if(i=0|r[(s=n+20|0)>>2])n=i,t=s;else{if(!(i=0|r[(s=n+16|0)>>2]))break;n=i,t=s}r[t>>2]=0,i=n}else i=0|r[u+8>>2],r[i+12>>2]=n,r[n+8>>2]=i,i=n}while(0);do{if(0|a){if(n=0|r[u+28>>2],(0|u)==(0|r[(t=23732+(n<<2)|0)>>2])){if(r[t>>2]=i,!i){r[5858]=o&~(1<<n);break}}else if(r[((0|r[(b=a+16|0)>>2])==(0|u)?b:a+20)>>2]=i,!i)break;r[i+24>>2]=a,0|(n=0|r[u+16>>2])&&(r[i+16>>2]=n,r[n+24>>2]=i),0|(n=0|r[u+20>>2])&&(r[i+20>>2]=n,r[n+24>>2]=i)}}while(0);return h>>>0<16?(b=h+c|0,r[u+4>>2]=3|b,r[(b=u+b+4|0)>>2]=1|r[b>>2]):(r[u+4>>2]=3|c,r[l+4>>2]=1|h,r[l+h>>2]=h,0|A&&(s=0|r[5862],i=23468+((n=A>>>3)<<1<<2)|0,(n=1<<n)&d?n=0|r[(t=i+8|0)>>2]:(r[5857]=n|d,n=i,t=i+8|0),r[t>>2]=s,r[n+12>>2]=s,r[s+8>>2]=n,r[s+12>>2]=i),r[5859]=h,r[5862]=l),D=e,0|(b=u+8|0)}d=c}else d=c}else d=c}else if(t>>>0<=4294967231)if(c=-8&(t=t+11|0),s=0|r[5858]){a=0-c|0,h=(t>>>=8)?c>>>0>16777215?31:c>>>((h=14-((u=((g=t<<(d=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|d|(h=((g<<=u)+245760|0)>>>16&2))+(g<<h>>>15)|0)+7|0)&1|h<<1:0,i=0|r[23732+(h<<2)>>2];t:do{if(i)for(t=0,u=c<<(31==(0|h)?0:25-(h>>>1)),o=0;;){if((l=(-8&r[i+4>>2])-c|0)>>>0<a>>>0){if(!l){t=i,a=0,g=65;break t}t=i,a=l}if(o=!(0|(g=0|r[i+20>>2]))|(0|g)==(0|(i=0|r[i+16+(u>>>31<<2)>>2]))?o:g,!i){i=o,g=61;break}u<<=1}else i=0,t=0,g=61}while(0);if(61==(0|g)){if(!(0|i)&!(0|t)){if(!(t=((t=2<<h)|0-t)&s)){d=c;break}d=(t&0-t)-1|0,t=0,i=0|r[23732+(((o=(d>>>=l=d>>>12&16)>>>5&8)|l|(u=(d>>>=o)>>>2&4)|(h=(d>>>=u)>>>1&2)|(i=(d>>>=h)>>>1&1))+(d>>>i)<<2)>>2]}i?g=65:(u=t,l=a)}if(65==(0|g))for(o=i;;){if(a=(i=(d=(-8&r[o+4>>2])-c|0)>>>0<a>>>0)?d:a,t=i?o:t,(i=0|r[o+16>>2])||(i=0|r[o+20>>2]),!i){u=t,l=a;break}o=i}if(0|u&&l>>>0<((0|r[5859])-c|0)>>>0&&(A=u+c|0)>>>0>u>>>0){o=0|r[u+24>>2],n=0|r[u+12>>2];do{if((0|n)==(0|u)){if(!(n=0|r[(t=u+20|0)>>2])&&!(n=0|r[(t=u+16|0)>>2])){n=0;break}for(;;)if(i=0|r[(a=n+20|0)>>2])n=i,t=a;else{if(!(i=0|r[(a=n+16|0)>>2]))break;n=i,t=a}r[t>>2]=0}else b=0|r[u+8>>2],r[b+12>>2]=n,r[n+8>>2]=b}while(0);do{if(o){if(t=0|r[u+28>>2],(0|u)==(0|r[(i=23732+(t<<2)|0)>>2])){if(r[i>>2]=n,!n){s&=~(1<<t),r[5858]=s;break}}else if(r[((0|r[(b=o+16|0)>>2])==(0|u)?b:o+20)>>2]=n,!n)break;r[n+24>>2]=o,0|(t=0|r[u+16>>2])&&(r[n+16>>2]=t,r[t+24>>2]=n),(t=0|r[u+20>>2])&&(r[n+20>>2]=t,r[t+24>>2]=n)}}while(0);t:do{if(l>>>0<16)b=l+c|0,r[u+4>>2]=3|b,r[(b=u+b+4|0)>>2]=1|r[b>>2];else{if(r[u+4>>2]=3|c,r[A+4>>2]=1|l,r[A+l>>2]=l,n=l>>>3,l>>>0<256){i=23468+(n<<1<<2)|0,(t=0|r[5857])&(n=1<<n)?n=0|r[(t=i+8|0)>>2]:(r[5857]=t|n,n=i,t=i+8|0),r[t>>2]=A,r[n+12>>2]=A,r[A+8>>2]=n,r[A+12>>2]=i;break}if(n=23732+((i=(n=l>>>8)?l>>>0>16777215?31:l>>>((i=14-((_=((b=n<<(x=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|x|(i=((b<<=_)+245760|0)>>>16&2))+(b<<i>>>15)|0)+7|0)&1|i<<1:0)<<2)|0,r[A+28>>2]=i,r[(t=A+16|0)+4>>2]=0,r[t>>2]=0,!(s&(t=1<<i))){r[5858]=s|t,r[n>>2]=A,r[A+24>>2]=n,r[A+12>>2]=A,r[A+8>>2]=A;break}n=0|r[n>>2];e:do{if((-8&r[n+4>>2])!=(0|l)){for(s=l<<(31==(0|i)?0:25-(i>>>1));t=0|r[(i=n+16+(s>>>31<<2)|0)>>2];){if((-8&r[t+4>>2])==(0|l)){n=t;break e}s<<=1,n=t}r[i>>2]=A,r[A+24>>2]=n,r[A+12>>2]=A,r[A+8>>2]=A;break t}}while(0);b=0|r[(x=n+8|0)>>2],r[b+12>>2]=A,r[x>>2]=A,r[A+8>>2]=b,r[A+12>>2]=n,r[A+24>>2]=0}}while(0);return D=e,0|(b=u+8|0)}d=c}else d=c;else d=-1}while(0);if((i=0|r[5859])>>>0>=d>>>0)return n=i-d|0,t=0|r[5862],n>>>0>15?(b=t+d|0,r[5862]=b,r[5859]=n,r[b+4>>2]=1|n,r[t+i>>2]=n,r[t+4>>2]=3|d):(r[5859]=0,r[5862]=0,r[t+4>>2]=3|i,r[(b=t+i+4|0)>>2]=1|r[b>>2]),D=e,0|(b=t+8|0);if((l=0|r[5860])>>>0>d>>>0)return _=l-d|0,r[5860]=_,x=(b=0|r[5863])+d|0,r[5863]=x,r[x+4>>2]=1|_,r[b+4>>2]=3|d,D=e,0|(b=b+8|0);if(0|r[5975]?t=0|r[5977]:(r[5977]=4096,r[5976]=4096,r[5978]=-1,r[5979]=-1,r[5980]=0,r[5968]=0,r[5975]=-16&p^1431655768,t=4096),u=d+48|0,(c=(o=t+(h=d+47|0)|0)&(a=0-t|0))>>>0<=d>>>0)return D=e,0|(b=0);if(0|(t=0|r[5967])&&(p=(A=0|r[5965])+c|0)>>>0<=A>>>0|p>>>0>t>>>0)return D=e,0|(b=0);t:do{if(4&r[5968])n=0,g=143;else{i=0|r[5863];e:do{if(i){for(s=23876;!((p=0|r[s>>2])>>>0<=i>>>0&&(p+(0|r[s+4>>2])|0)>>>0>i>>>0);){if(!(t=0|r[s+8>>2])){g=128;break e}s=t}if((n=o-l&a)>>>0<2147483647)if((0|(t=0|Qe(0|n)))==((0|r[s>>2])+(0|r[s+4>>2])|0)){if(-1!=(0|t)){l=n,o=t,g=145;break t}}else s=t,g=136;else n=0}else g=128}while(0);do{if(128==(0|g))if(-1!=(0|(i=0|Qe(0)))&&(n=i,m=(n=((m=(f=0|r[5976])+-1|0)&n?(m+n&0-f)-n|0:0)+c|0)+(f=0|r[5965])|0,n>>>0>d>>>0&n>>>0<2147483647)){if(0|(p=0|r[5967])&&m>>>0<=f>>>0|m>>>0>p>>>0){n=0;break}if((0|(t=0|Qe(0|n)))==(0|i)){l=n,o=i,g=145;break t}s=t,g=136}else n=0}while(0);do{if(136==(0|g)){if(i=0-n|0,!(u>>>0>n>>>0&n>>>0<2147483647&-1!=(0|s))){if(-1==(0|s)){n=0;break}l=n,o=s,g=145;break t}if((t=h-n+(t=0|r[5977])&0-t)>>>0>=2147483647){l=n,o=s,g=145;break t}if(-1==(0|Qe(0|t))){Qe(0|i),n=0;break}l=t+n|0,o=s,g=145;break t}}while(0);r[5968]=4|r[5968],g=143}}while(0);if(143==(0|g)&&c>>>0<2147483647&&!(-1==(0|(_=0|Qe(0|c)))|1^(v=(y=(m=0|Qe(0))-_|0)>>>0>(d+40|0)>>>0)|_>>>0<m>>>0&-1!=(0|_)&-1!=(0|m)^1)&&(l=v?y:n,o=_,g=145),145==(0|g)){n=(0|r[5965])+l|0,r[5965]=n,n>>>0>(0|r[5966])>>>0&&(r[5966]=n),h=0|r[5863];t:do{if(h){for(n=23876;;){if((0|o)==((t=0|r[n>>2])+(i=0|r[n+4>>2])|0)){g=154;break}if(!(s=0|r[n+8>>2]))break;n=s}if(!(154!=(0|g)||(x=n+4|0,8&r[n+12>>2]))&&o>>>0>h>>>0&t>>>0<=h>>>0){r[x>>2]=i+l,x=h+(_=7&(_=h+8|0)?0-_&7:0)|0,_=(b=(0|r[5860])+l|0)-_|0,r[5863]=x,r[5860]=_,r[x+4>>2]=1|_,r[h+b+4>>2]=40,r[5864]=r[5979];break}for(o>>>0<(0|r[5861])>>>0&&(r[5861]=o),i=o+l|0,n=23876;;){if((0|r[n>>2])==(0|i)){g=162;break}if(!(t=0|r[n+8>>2]))break;n=t}if(162==(0|g)&&!(8&r[n+12>>2])){r[n>>2]=o,r[(A=n+4|0)>>2]=(0|r[A>>2])+l,c=(A=o+(7&(A=o+8|0)?0-A&7:0)|0)+d|0,u=(n=i+(7&(n=i+8|0)?0-n&7:0)|0)-A-d|0,r[A+4>>2]=3|d;e:do{if((0|h)==(0|n))b=(0|r[5860])+u|0,r[5860]=b,r[5863]=c,r[c+4>>2]=1|b;else{if((0|r[5862])==(0|n)){b=(0|r[5859])+u|0,r[5859]=b,r[5862]=c,r[c+4>>2]=1|b,r[c+b>>2]=b;break}if(1==(3&(t=0|r[n+4>>2]))){l=-8&t,s=t>>>3;n:do{if(t>>>0<256){if(t=0|r[n+8>>2],(0|(i=0|r[n+12>>2]))==(0|t)){r[5857]=r[5857]&~(1<<s);break}r[t+12>>2]=i,r[i+8>>2]=t;break}o=0|r[n+24>>2],t=0|r[n+12>>2];do{if((0|t)==(0|n)){if(t=0|r[(s=(i=n+16|0)+4|0)>>2])i=s;else if(!(t=0|r[i>>2])){t=0;break}for(;;)if(s=0|r[(a=t+20|0)>>2])t=s,i=a;else{if(!(s=0|r[(a=t+16|0)>>2]))break;t=s,i=a}r[i>>2]=0}else b=0|r[n+8>>2],r[b+12>>2]=t,r[t+8>>2]=b}while(0);if(!o)break;s=23732+((i=0|r[n+28>>2])<<2)|0;do{if((0|r[s>>2])==(0|n)){if(r[s>>2]=t,0|t)break;r[5858]=r[5858]&~(1<<i);break n}if(r[((0|r[(b=o+16|0)>>2])==(0|n)?b:o+20)>>2]=t,!t)break n}while(0);if(r[t+24>>2]=o,0|(s=0|r[(i=n+16|0)>>2])&&(r[t+16>>2]=s,r[s+24>>2]=t),!(i=0|r[i+4>>2]))break;r[t+20>>2]=i,r[i+24>>2]=t}while(0);n=n+l|0,a=l+u|0}else a=u;if(r[(n=n+4|0)>>2]=-2&r[n>>2],r[c+4>>2]=1|a,r[c+a>>2]=a,n=a>>>3,a>>>0<256){i=23468+(n<<1<<2)|0,(t=0|r[5857])&(n=1<<n)?n=0|r[(t=i+8|0)>>2]:(r[5857]=t|n,n=i,t=i+8|0),r[t>>2]=c,r[n+12>>2]=c,r[c+8>>2]=n,r[c+12>>2]=i;break}n=a>>>8;do{if(n){if(a>>>0>16777215){s=31;break}s=a>>>((s=14-((_=((b=n<<(x=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|x|(s=((b<<=_)+245760|0)>>>16&2))+(b<<s>>>15)|0)+7|0)&1|s<<1}else s=0}while(0);if(n=23732+(s<<2)|0,r[c+28>>2]=s,r[(t=c+16|0)+4>>2]=0,r[t>>2]=0,!((t=0|r[5858])&(i=1<<s))){r[5858]=t|i,r[n>>2]=c,r[c+24>>2]=n,r[c+12>>2]=c,r[c+8>>2]=c;break}n=0|r[n>>2];n:do{if((-8&r[n+4>>2])!=(0|a)){for(s=a<<(31==(0|s)?0:25-(s>>>1));t=0|r[(i=n+16+(s>>>31<<2)|0)>>2];){if((-8&r[t+4>>2])==(0|a)){n=t;break n}s<<=1,n=t}r[i>>2]=c,r[c+24>>2]=n,r[c+12>>2]=c,r[c+8>>2]=c;break e}}while(0);b=0|r[(x=n+8|0)>>2],r[b+12>>2]=c,r[x>>2]=c,r[c+8>>2]=b,r[c+12>>2]=n,r[c+24>>2]=0}}while(0);return D=e,0|(b=A+8|0)}for(n=23876;!((t=0|r[n>>2])>>>0<=h>>>0&&(b=t+(0|r[n+4>>2])|0)>>>0>h>>>0);)n=0|r[n+8>>2];n=(t=(t=(a=b+-47|0)+(7&(t=a+8|0)?0-t&7:0)|0)>>>0<(a=h+16|0)>>>0?h:t)+8|0,x=o+(_=7&(_=o+8|0)?0-_&7:0)|0,_=(i=l+-40|0)-_|0,r[5863]=x,r[5860]=_,r[x+4>>2]=1|_,r[o+i+4>>2]=40,r[5864]=r[5979],r[(i=t+4|0)>>2]=27,r[n>>2]=r[5969],r[n+4>>2]=r[5970],r[n+8>>2]=r[5971],r[n+12>>2]=r[5972],r[5969]=o,r[5970]=l,r[5972]=0,r[5971]=n,n=t+24|0;do{x=n,r[(n=n+4|0)>>2]=7}while((x+8|0)>>>0<b>>>0);if((0|t)!=(0|h)){if(o=t-h|0,r[i>>2]=-2&r[i>>2],r[h+4>>2]=1|o,r[t>>2]=o,n=o>>>3,o>>>0<256){i=23468+(n<<1<<2)|0,(t=0|r[5857])&(n=1<<n)?n=0|r[(t=i+8|0)>>2]:(r[5857]=t|n,n=i,t=i+8|0),r[t>>2]=h,r[n+12>>2]=h,r[h+8>>2]=n,r[h+12>>2]=i;break}if(i=23732+((s=(n=o>>>8)?o>>>0>16777215?31:o>>>((s=14-((_=((b=n<<(x=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|x|(s=((b<<=_)+245760|0)>>>16&2))+(b<<s>>>15)|0)+7|0)&1|s<<1:0)<<2)|0,r[h+28>>2]=s,r[h+20>>2]=0,r[a>>2]=0,!((n=0|r[5858])&(t=1<<s))){r[5858]=n|t,r[i>>2]=h,r[h+24>>2]=i,r[h+12>>2]=h,r[h+8>>2]=h;break}n=0|r[i>>2];e:do{if((-8&r[n+4>>2])!=(0|o)){for(s=o<<(31==(0|s)?0:25-(s>>>1));t=0|r[(i=n+16+(s>>>31<<2)|0)>>2];){if((-8&r[t+4>>2])==(0|o)){n=t;break e}s<<=1,n=t}r[i>>2]=h,r[h+24>>2]=n,r[h+12>>2]=h,r[h+8>>2]=h;break t}}while(0);b=0|r[(x=n+8|0)>>2],r[b+12>>2]=h,r[x>>2]=h,r[h+8>>2]=b,r[h+12>>2]=n,r[h+24>>2]=0}}else!(0|(b=0|r[5861]))|o>>>0<b>>>0&&(r[5861]=o),r[5969]=o,r[5970]=l,r[5972]=0,r[5866]=r[5975],r[5865]=-1,r[5870]=23468,r[5869]=23468,r[5872]=23476,r[5871]=23476,r[5874]=23484,r[5873]=23484,r[5876]=23492,r[5875]=23492,r[5878]=23500,r[5877]=23500,r[5880]=23508,r[5879]=23508,r[5882]=23516,r[5881]=23516,r[5884]=23524,r[5883]=23524,r[5886]=23532,r[5885]=23532,r[5888]=23540,r[5887]=23540,r[5890]=23548,r[5889]=23548,r[5892]=23556,r[5891]=23556,r[5894]=23564,r[5893]=23564,r[5896]=23572,r[5895]=23572,r[5898]=23580,r[5897]=23580,r[5900]=23588,r[5899]=23588,r[5902]=23596,r[5901]=23596,r[5904]=23604,r[5903]=23604,r[5906]=23612,r[5905]=23612,r[5908]=23620,r[5907]=23620,r[5910]=23628,r[5909]=23628,r[5912]=23636,r[5911]=23636,r[5914]=23644,r[5913]=23644,r[5916]=23652,r[5915]=23652,r[5918]=23660,r[5917]=23660,r[5920]=23668,r[5919]=23668,r[5922]=23676,r[5921]=23676,r[5924]=23684,r[5923]=23684,r[5926]=23692,r[5925]=23692,r[5928]=23700,r[5927]=23700,r[5930]=23708,r[5929]=23708,r[5932]=23716,r[5931]=23716,x=o+(_=7&(_=o+8|0)?0-_&7:0)|0,_=(b=l+-40|0)-_|0,r[5863]=x,r[5860]=_,r[x+4>>2]=1|_,r[o+b+4>>2]=40,r[5864]=r[5979]}while(0);if((n=0|r[5860])>>>0>d>>>0)return _=n-d|0,r[5860]=_,x=(b=0|r[5863])+d|0,r[5863]=x,r[x+4>>2]=1|_,r[b+4>>2]=3|d,D=e,0|(b=b+8|0)}return r[(b=23424)>>2]=12,D=e,0|(b=0)}function Ne(t){var e=0,n=0,i=0,s=0,a=0,o=0,l=0,u=0;if(t|=0){n=t+-8|0,s=0|r[5861],u=n+(e=-8&(t=0|r[t+-4>>2]))|0;do{if(1&t)l=n,o=n;else{if(i=0|r[n>>2],!(3&t))return;if(a=i+e|0,(o=n+(0-i)|0)>>>0<s>>>0)return;if((0|r[5862])==(0|o)){if(3&~(e=0|r[(t=u+4|0)>>2])){l=o,e=a;break}return r[5859]=a,r[t>>2]=-2&e,r[o+4>>2]=1|a,void(r[o+a>>2]=a)}if(n=i>>>3,i>>>0<256){if(t=0|r[o+8>>2],(0|(e=0|r[o+12>>2]))==(0|t)){r[5857]=r[5857]&~(1<<n),l=o,e=a;break}r[t+12>>2]=e,r[e+8>>2]=t,l=o,e=a;break}s=0|r[o+24>>2],t=0|r[o+12>>2];do{if((0|t)==(0|o)){if(t=0|r[(n=(e=o+16|0)+4|0)>>2])e=n;else if(!(t=0|r[e>>2])){t=0;break}for(;;)if(n=0|r[(i=t+20|0)>>2])t=n,e=i;else{if(!(n=0|r[(i=t+16|0)>>2]))break;t=n,e=i}r[e>>2]=0}else l=0|r[o+8>>2],r[l+12>>2]=t,r[t+8>>2]=l}while(0);if(s){if(e=0|r[o+28>>2],(0|r[(n=23732+(e<<2)|0)>>2])==(0|o)){if(r[n>>2]=t,!t){r[5858]=r[5858]&~(1<<e),l=o,e=a;break}}else if(r[((0|r[(l=s+16|0)>>2])==(0|o)?l:s+20)>>2]=t,!t){l=o,e=a;break}r[t+24>>2]=s,0|(n=0|r[(e=o+16|0)>>2])&&(r[t+16>>2]=n,r[n+24>>2]=t),(e=0|r[e+4>>2])?(r[t+20>>2]=e,r[e+24>>2]=t,l=o,e=a):(l=o,e=a)}else l=o,e=a}}while(0);if(!(o>>>0>=u>>>0)&&1&(i=0|r[(t=u+4|0)>>2])){if(2&i)r[t>>2]=-2&i,r[l+4>>2]=1|e,r[o+e>>2]=e,s=e;else{if((0|r[5863])==(0|u)){if(u=(0|r[5860])+e|0,r[5860]=u,r[5863]=l,r[l+4>>2]=1|u,(0|l)!=(0|r[5862]))return;return r[5862]=0,void(r[5859]=0)}if((0|r[5862])==(0|u))return u=(0|r[5859])+e|0,r[5859]=u,r[5862]=o,r[l+4>>2]=1|u,void(r[o+u>>2]=u);s=(-8&i)+e|0,n=i>>>3;do{if(i>>>0<256){if(e=0|r[u+8>>2],(0|(t=0|r[u+12>>2]))==(0|e)){r[5857]=r[5857]&~(1<<n);break}r[e+12>>2]=t,r[t+8>>2]=e;break}a=0|r[u+24>>2],t=0|r[u+12>>2];do{if((0|t)==(0|u)){if(t=0|r[(n=(e=u+16|0)+4|0)>>2])e=n;else if(!(t=0|r[e>>2])){n=0;break}for(;;)if(n=0|r[(i=t+20|0)>>2])t=n,e=i;else{if(!(n=0|r[(i=t+16|0)>>2]))break;t=n,e=i}r[e>>2]=0,n=t}else n=0|r[u+8>>2],r[n+12>>2]=t,r[t+8>>2]=n,n=t}while(0);if(0|a){if(t=0|r[u+28>>2],(0|r[(e=23732+(t<<2)|0)>>2])==(0|u)){if(r[e>>2]=n,!n){r[5858]=r[5858]&~(1<<t);break}}else if(r[((0|r[(i=a+16|0)>>2])==(0|u)?i:a+20)>>2]=n,!n)break;r[n+24>>2]=a,0|(e=0|r[(t=u+16|0)>>2])&&(r[n+16>>2]=e,r[e+24>>2]=n),0|(t=0|r[t+4>>2])&&(r[n+20>>2]=t,r[t+24>>2]=n)}}while(0);if(r[l+4>>2]=1|s,r[o+s>>2]=s,(0|l)==(0|r[5862]))return void(r[5859]=s)}if(t=s>>>3,s>>>0<256)return n=23468+(t<<1<<2)|0,(e=0|r[5857])&(t=1<<t)?t=0|r[(e=n+8|0)>>2]:(r[5857]=e|t,t=n,e=n+8|0),r[e>>2]=l,r[t+12>>2]=l,r[l+8>>2]=t,void(r[l+12>>2]=n);t=23732+((i=(t=s>>>8)?s>>>0>16777215?31:s>>>((i=14-((a=((u=t<<(o=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|o|(i=((u<<=a)+245760|0)>>>16&2))+(u<<i>>>15)|0)+7|0)&1|i<<1:0)<<2)|0,r[l+28>>2]=i,r[l+20>>2]=0,r[l+16>>2]=0,e=0|r[5858],n=1<<i;t:do{if(e&n){t=0|r[t>>2];e:do{if((-8&r[t+4>>2])!=(0|s)){for(i=s<<(31==(0|i)?0:25-(i>>>1));e=0|r[(n=t+16+(i>>>31<<2)|0)>>2];){if((-8&r[e+4>>2])==(0|s)){t=e;break e}i<<=1,t=e}r[n>>2]=l,r[l+24>>2]=t,r[l+12>>2]=l,r[l+8>>2]=l;break t}}while(0);u=0|r[(o=t+8|0)>>2],r[u+12>>2]=l,r[o>>2]=l,r[l+8>>2]=u,r[l+12>>2]=t,r[l+24>>2]=0}else r[5858]=e|n,r[t>>2]=l,r[l+24>>2]=t,r[l+12>>2]=l,r[l+8>>2]=l}while(0);if(u=(0|r[5865])-1|0,r[5865]=u,!(0|u)){for(t=23884;t=0|r[t>>2];)t=t+8|0;r[5865]=-1}}}}function Pe(t,e){e|=0;var n=0;return(t|=0)?(n=0|_(e,t),(e|t)>>>0>65535&&(n=((n>>>0)/(t>>>0)|0)==(0|e)?n:-1)):n=0,(t=0|Re(n))&&3&r[t+-4>>2]?(Xe(0|t,0,0|n),0|t):0|t}function De(t,e,n,i){return 0|(M((e|=0)+(i|=0)+((n=(t|=0)+(n|=0)>>>0)>>>0<t>>>0|0)>>>0|0),n)}function Ie(t,e,n,i){return 0|(M(0|(i=(e|=0)-(i|=0)-((n|=0)>>>0>(t|=0)>>>0|0)>>>0)),t-n>>>0)}function Le(t){return 0|((t|=0)?31-(0|S(t^t-1)):32)}function Be(t,e,n,i,s){s|=0;var a=0,o=0,l=0,u=0,h=0,c=0,A=0,d=0,p=0,f=0;if(c=t|=0,o=n|=0,l=d=i|=0,!(h=u=e|=0))return a=!!(0|s),l?a?(r[s>>2]=0|t,r[s+4>>2]=0,s=0,0|(M(0|(d=0)),s)):(s=0,0|(M(0|(d=0)),s)):(a&&(r[s>>2]=(c>>>0)%(o>>>0),r[s+4>>2]=0),s=(c>>>0)/(o>>>0)>>>0,0|(M(0|(d=0)),s));a=!(0|l);do{if(o){if(!a){if((a=(0|S(0|l))-(0|S(0|h))|0)>>>0<=31){o=A=a+1|0,t=c>>>(A>>>0)&(e=a-31>>31)|h<<(l=31-a|0),e&=h>>>(A>>>0),a=0,l=c<<l;break}return s?(r[s>>2]=0|t,r[s+4>>2]=0|u,s=0,0|(M(0|(d=0)),s)):(s=0,0|(M(0|(d=0)),s))}if((a=o-1|0)&o){o=l=33+(0|S(0|o))-(0|S(0|h))|0,t=(A=32-l|0)-1>>31&h>>>((p=l-32|0)>>>0)|(h<<A|c>>>(l>>>0))&(e=p>>31),e&=h>>>(l>>>0),a=c<<(f=64-l|0)&(u=A>>31),l=(h<<f|c>>>(p>>>0))&u|c<<A&l-33>>31;break}return 0|s&&(r[s>>2]=a&c,r[s+4>>2]=0),1==(0|o)?(f=0|t,0|(M(0|(p=0|u)),f)):(p=h>>>((f=0|Le(0|o))>>>0)|0,f=h<<32-f|c>>>(f>>>0),0|(M(0|p),f))}if(a)return 0|s&&(r[s>>2]=(h>>>0)%(o>>>0),r[s+4>>2]=0),f=(h>>>0)/(o>>>0)>>>0,0|(M(0|(p=0)),f);if(!c)return 0|s&&(r[s>>2]=0,r[s+4>>2]=(h>>>0)%(l>>>0)),f=(h>>>0)/(l>>>0)>>>0,0|(M(0|(p=0)),f);if(!((a=l-1|0)&l))return 0|s&&(r[s>>2]=0|t,r[s+4>>2]=a&h),p=0,f=h>>>((0|Le(0|l))>>>0),0|(M(0|p),f);if((a=(0|S(0|l))-(0|S(0|h))|0)>>>0<=30){o=e=a+1|0,t=h<<(l=31-a|0)|c>>>(e>>>0),e=h>>>(e>>>0),a=0,l=c<<l;break}return s?(r[s>>2]=0|t,r[s+4>>2]=0|u,f=0,0|(M(0|(p=0)),f)):(f=0,0|(M(0|(p=0)),f))}while(0);if(o){h=0|De(0|(A=0|n),0|(c=0|d),-1,-1),n=0|w(),u=l,l=0;do{i=u,u=a>>>31|u<<1,a=l|a<<1,Ie(0|h,0|n,0|(i=t<<1|i>>>31),0|(d=t>>>31|e<<1)),l=1&(p=(f=0|w())>>31|((0|f)<0?-1:0)<<1),t=0|Ie(0|i,0|d,p&A,(((0|f)<0?-1:0)>>31|((0|f)<0?-1:0)<<1)&c),e=0|w(),o=o-1|0}while(0|o);h=u,u=0}else h=l,u=0,l=0;return o=0,0|s&&(r[s>>2]=t,r[s+4>>2]=e),f=a<<1&-2|l,0|(M(0|(p=(0|a)>>>31|(h|o)<<1|u)),f)}function Ue(t,e,n,i){n|=0;var r,s,a,o,l;return s=(i|=0)>>31|((0|i)<0?-1:0)<<1,r=((0|i)<0?-1:0)>>31|((0|i)<0?-1:0)<<1,a=0|Ie((l=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(t|=0),(o=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e,0|l,0|o),t=s^l,e=r^o,0|Ie(Be(a,0|w(),0|Ie(s^n,r^i,0|s,0|r),0|w(),0)^t,w()^e,0|t,0|e)}function Oe(t,e,n,i){e|=0,i|=0;var r,s;return n=0|function(t,e){var n,i,r,s=0;return t=((n=0|_(s=65535&(e|=0),r=65535&(t|=0)))>>>16)+(0|_(s,i=t>>>16))|0,e=0|_(s=e>>>16,r),0|(M((t>>>16)+(0|_(s,i))+(((65535&t)+e|0)>>>16)|0),t+e<<16|65535&n)}(r=t|=0,s=n|=0),t=0|w(),0|(M((0|_(e,s))+(0|_(i,r))+t|0),n)}function Fe(t,e,n,i){n|=0;var s,a,o,l,u,h;return s=D,D=D+16|0,l=0|s,h=(i|=0)>>31|((0|i)<0?-1:0)<<1,u=((0|i)<0?-1:0)>>31|((0|i)<0?-1:0)<<1,Be(t=0|Ie((o=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(t|=0),(a=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e,0|o,0|a),e=0|w(),0|Ie(h^n,u^i,0|h,0|u),0|w(),l),i=0|Ie(r[l>>2]^o,r[l+4>>2]^a,0|o,0|a),n=0|w(),D=s,0|(M(0|n),i)}function ke(t,e,n,i){var s,a;return a=D,D=D+16|0,Be(t|=0,e|=0,n|=0,i|=0,s=0|a),D=a,0|(M(0|r[s+4>>2]),r[s>>2])}function ze(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(M(e>>n),t>>>n|(e&(1<<n)-1)<<32-n):(M(0|((0|e)<0?-1:0)),e>>n-32)}function qe(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(M(e>>>n|0),t>>>n|(e&(1<<n)-1)<<32-n):(M(0),e>>>n-32|0)}function Ge(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(M(e<<n|(t&(1<<n)-1<<32-n)>>>32-n),t<<n):(M(t<<n-32),0)}function Ve(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+b(+t,+e)}function He(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+x(+t,+e)}function je(t){return(t=+t)>=0?+l(t+.5):+v(t-.5)}function We(t,e,n){t|=0,e|=0;var s,a,o=0;if((0|(n|=0))>=8192)return R(0|t,0|e,0|n),0|t;if(a=0|t,s=t+n|0,(3&t)==(3&e)){for(;3&t;){if(!n)return 0|a;i[t|0]=0|i[e|0],t=t+1|0,e=e+1|0,n=n-1|0}for(o=(n=-4&s)-64|0;(0|t)<=(0|o);)r[t>>2]=r[e>>2],r[t+4>>2]=r[e+4>>2],r[t+8>>2]=r[e+8>>2],r[t+12>>2]=r[e+12>>2],r[t+16>>2]=r[e+16>>2],r[t+20>>2]=r[e+20>>2],r[t+24>>2]=r[e+24>>2],r[t+28>>2]=r[e+28>>2],r[t+32>>2]=r[e+32>>2],r[t+36>>2]=r[e+36>>2],r[t+40>>2]=r[e+40>>2],r[t+44>>2]=r[e+44>>2],r[t+48>>2]=r[e+48>>2],r[t+52>>2]=r[e+52>>2],r[t+56>>2]=r[e+56>>2],r[t+60>>2]=r[e+60>>2],t=t+64|0,e=e+64|0;for(;(0|t)<(0|n);)r[t>>2]=r[e>>2],t=t+4|0,e=e+4|0}else for(n=s-4|0;(0|t)<(0|n);)i[t|0]=0|i[e|0],i[t+1|0]=0|i[e+1|0],i[t+2|0]=0|i[e+2|0],i[t+3|0]=0|i[e+3|0],t=t+4|0,e=e+4|0;for(;(0|t)<(0|s);)i[t|0]=0|i[e|0],t=t+1|0,e=e+1|0;return 0|a}function Xe(t,e,n){e|=0;var s,a=0,o=0,l=0;if(s=(t|=0)+(n|=0)|0,e&=255,(0|n)>=67){for(;3&t;)i[t|0]=e,t=t+1|0;for(l=e|e<<8|e<<16|e<<24,o=(a=-4&s)-64|0;(0|t)<=(0|o);)r[t>>2]=l,r[t+4>>2]=l,r[t+8>>2]=l,r[t+12>>2]=l,r[t+16>>2]=l,r[t+20>>2]=l,r[t+24>>2]=l,r[t+28>>2]=l,r[t+32>>2]=l,r[t+36>>2]=l,r[t+40>>2]=l,r[t+44>>2]=l,r[t+48>>2]=l,r[t+52>>2]=l,r[t+56>>2]=l,r[t+60>>2]=l,t=t+64|0;for(;(0|t)<(0|a);)r[t>>2]=l,t=t+4|0}for(;(0|t)<(0|s);)i[t|0]=e,t=t+1|0;return s-n|0}function Ye(t){return(t=+t)>=0?+l(t+.5):+v(t-.5)}function Qe(t){t|=0;var e,n,i;return i=0|C(),(0|t)>0&(0|(e=(n=0|r[o>>2])+t|0))<(0|n)|(0|e)<0?(P(0|e),E(12),-1):(0|e)>(0|i)&&!(0|N(0|e))?(E(12),-1):(r[o>>2]=e,0|n)}return{___divdi3:Ue,___muldi3:Oe,___remdi3:Fe,___uremdi3:ke,_areNeighborCells:function(t,e,n,i,s){s|=0;var a,o,l,u=0,h=0,c=0,A=0;if(l=D,D=D+64|0,o=l,a=l+56|0,!(!0&134217728==(2013265920&(e|=0))&!0&134217728==(2013265920&(i|=0))))return D=l,0|(s=5);if((0|(t|=0))==(0|(n|=0))&(0|e)==(0|i))return r[s>>2]=0,D=l,0|(s=0);if(h=0|qe(0|t,0|e,52),w(),h&=15,A=0|qe(0|n,0|i,52),w(),(0|h)!=(15&A))return D=l,0|(s=12);if(u=h+-1|0,h>>>0>1){Bt(t,e,u,o),Bt(n,i,u,a),c=0|r[(A=o)>>2],A=0|r[A+4>>2];t:do{if((0|c)==(0|r[a>>2])&&(0|A)==(0|r[a+4>>2])){u=0|qe(0|t,0|e,0|(h=3*(15^h)|0)),w(),u&=7,h=0|qe(0|n,0|i,0|h),w(),h&=7;do{if(!(0|u)|!(0|h))r[s>>2]=1,u=0;else if(7==(0|u))u=5;else{if(1==(0|u)|1==(0|h)&&0|Ot(c,A)){u=5;break}if((0|r[15536+(u<<2)>>2])!=(0|h)&&(0|r[15568+(u<<2)>>2])!=(0|h))break t;r[s>>2]=1,u=0}}while(0);return D=l,0|(s=u)}}while(0)}h=(u=o)+56|0;do{r[u>>2]=0,u=u+4|0}while((0|u)<(0|h));return I(t,e,1,o),u=(0|r[(e=o)>>2])==(0|n)&&(0|r[e+4>>2])==(0|i)||(0|r[(e=o+8|0)>>2])==(0|n)&&(0|r[e+4>>2])==(0|i)||(0|r[(e=o+16|0)>>2])==(0|n)&&(0|r[e+4>>2])==(0|i)||(0|r[(e=o+24|0)>>2])==(0|n)&&(0|r[e+4>>2])==(0|i)||(0|r[(e=o+32|0)>>2])==(0|n)&&(0|r[e+4>>2])==(0|i)||(0|r[(e=o+40|0)>>2])==(0|n)&&(0|r[e+4>>2])==(0|i)?1:1&((0|r[(u=o+48|0)>>2])==(0|n)?(0|r[u+4>>2])==(0|i):0),r[s>>2]=u,D=l,0|(s=0)},_bitshift64Ashr:ze,_bitshift64Lshr:qe,_bitshift64Shl:Ge,_calloc:Pe,_cellAreaKm2:function(t,e,n){return 0|(t=0|ie(t|=0,e|=0,n|=0))||(s[n>>3]=6371.007180918475*+s[n>>3]*6371.007180918475),0|t},_cellAreaM2:function(t,e,n){return 0|(t=0|ie(t|=0,e|=0,n|=0))||(s[n>>3]=6371.007180918475*+s[n>>3]*6371.007180918475*1e3*1e3),0|t},_cellAreaRads2:ie,_cellToBoundary:Yt,_cellToCenterChild:function(t,e,n,i){n|=0,i|=0;var s=0;return s=0|qe(0|(t|=0),0|(e|=0),52),w(),(0|n)<16&(0|(s&=15))<=(0|n)?((0|s)<(0|n)&&(s=0|Ge(-1,-1,3+(3*(n+-1-s|0)|0)|0),s=0|Ge(0|~s,0|~w(),3*(15-n|0)|0),e=~w()&e,t&=~s),s=0|Ge(0|n,0,52),n=-15728641&e|w(),r[i>>2]=t|s,r[i+4>>2]=n,0|(i=0)):0|(i=4)},_cellToChildPos:function(t,e,n,i){n|=0,i|=0;var s,a=0,o=0,l=0,u=0,h=0,c=0,A=0,d=0,p=0,f=0,m=0,g=0,y=0,v=0;if(s=D,D=D+16|0,y=s,v=0|qe(0|(t|=0),0|(e|=0),52),w(),v&=15,n>>>0>15)return D=s,0|(v=4);if((0|v)<(0|n))return D=s,0|(v=12);if((0|v)!=(0|n))if(o=0|Ge(0|n,0,52),o|=t,u=w()|-15728641&e,(0|v)>(0|n)){h=n;do{g=0|Ge(7,0,3*(14-h|0)|0),h=h+1|0,o|=g,u=w()|u}while((0|h)<(0|v));g=o}else g=o;else g=t,u=e;m=0|qe(0|g,0|u,45),w();t:do{if(0|z(127&m)){if(h=0|qe(0|g,0|u,52),w(),0|(h&=15))for(o=1;;){if(!(!((m=0|Ge(7,0,3*(15-o|0)|0))&g)&!(w()&u))){c=33;break t}if(!(o>>>0<h>>>0))break;o=o+1|0}if(r[(m=i)>>2]=0,r[m+4>>2]=0,(0|v)>(0|n)){for(m=-15728641&e,f=v;;){if(p=f,(f=f+-1|0)>>>0>15|(0|v)<(0|f)){c=19;break}if((0|v)!=(0|f))if(o=0|Ge(0|f,0,52),o|=t,h=w()|m,(0|v)<(0|p))d=o;else{c=f;do{d=0|Ge(7,0,3*(14-c|0)|0),c=c+1|0,o|=d,h=w()|h}while((0|c)<(0|v));d=o}else d=t,h=e;if(A=0|qe(0|d,0|h,45),w(),0|z(127&A)){A=0|qe(0|d,0|h,52),w(),A&=15;e:do{if(A)for(c=1;;){if(o=0|qe(0|d,0|h,3*(15-c|0)|0),w(),0|(o&=7))break e;if(!(c>>>0<A>>>0)){o=0;break}c=c+1|0}else o=0}while(0);o=1&!(0|o)}else o=0;if(h=0|qe(0|t,0|e,3*(15-p|0)|0),w(),7==(0|(h&=7))){a=5,c=42;break}if(1==(0|h)&(o=!!(0|o))){a=5,c=42;break}if(0|(d=h+((!!(0|h)&o)<<31>>31)|0)&&(c=0|ce(7,0,c=v-p|0,((0|c)<0)<<31>>31),A=0|w(),o?(o=0|De(0|(o=0|Oe(0|c,0|A,5,0)),0|w(),-5,-1),o=0|De(0|(o=0|Ue(0|o,0|w(),6,0)),0|w(),1,0),h=0|w()):(o=c,h=A),p=0|De(0|o,0|h,0|(p=0|Oe(0|c,0|A,0|(p=d+-1|0),((0|p)<0)<<31>>31)),0|w()),A=0|De(0|p,0|(d=0|w()),0|r[(A=i)>>2],0|r[A+4>>2]),d=0|w(),r[(p=i)>>2]=A,r[p+4>>2]=d),(0|f)<=(0|n)){c=37;break}}if(19==(0|c))T(23313,22674,1099,22710);else{if(37==(0|c)){a=0|r[(l=i)+4>>2],l=0|r[l>>2];break}if(42==(0|c))return D=s,0|a}}else a=0,l=0}else c=33}while(0);t:do{if(33==(0|c)){if(r[(m=i)>>2]=0,r[m+4>>2]=0,(0|v)>(0|n)){for(o=v;;){if(a=0|qe(0|t,0|e,3*(15-o|0)|0),w(),7==(0|(a&=7))){a=5;break}if(a=0|Oe(0|(l=0|ce(7,0,l=v-o|0,((0|l)<0)<<31>>31)),0|w(),0|a,0),l=0|w(),l=0|De(0|r[(m=i)>>2],0|r[m+4>>2],0|a,0|l),a=0|w(),r[(m=i)>>2]=l,r[m+4>>2]=a,(0|(o=o+-1|0))<=(0|n))break t}return D=s,0|a}a=0,l=0}}while(0);return 0|Ut(g,u,v,y)&&T(23313,22674,1063,22725),((0|a)>-1|-1==(0|a)&l>>>0>4294967295)&((0|(y=0|r[(v=y)+4>>2]))>(0|a)|((0|y)==(0|a)?(0|r[v>>2])>>>0>l>>>0:0))?(D=s,0|(v=0)):(T(23313,22674,1139,22710),0)},_cellToChildren:function(t,e,n,i){i|=0;var s,a,o=0,l=0;if(a=D,D=D+16|0,$t(s=a,t|=0,e|=0,n|=0),!(0|(t=0|r[(e=s)>>2]))&!(0|(e=0|r[e+4>>2])))return D=a,0;o=0,n=0;do{r[(l=i+(o<<3)|0)>>2]=t,r[l+4>>2]=e,o=0|De(0|o,0|n,1,0),n=0|w(),Zt(s),t=0|r[(l=s)>>2],e=0|r[l+4>>2]}while(!(!(0|t)&!(0|e)));return D=a,0},_cellToChildrenSize:Ut,_cellToLatLng:Xt,_cellToLocalIj:function(t,e,n,i,r,s){var a,o;return t|=0,e|=0,n|=0,i|=0,s|=0,o=D,D=D+16|0,a=o,(r|=0)?t=15:(t=0|ue(t,e,n,i,a))||(vt(a,s),t=0),D=o,0|t},_cellToParent:Bt,_cellToVertex:_e,_cellToVertexes:function(t,e,n){n|=0;var i,s=0,a=0;return a=!(0|Ot(t|=0,e|=0)),i=!(0|(s=0|_e(t,e,0,n))),a?i?0|(s=0|_e(t,e,1,n+8|0))||0|(s=0|_e(t,e,2,n+16|0))||0|(s=0|_e(t,e,3,n+24|0))||(s=0|_e(t,e,4,n+32|0))?0|(a=s):0|_e(t,e,5,n+40|0):0|(a=s):i?0|(s=0|_e(t,e,1,n+8|0))||0|(s=0|_e(t,e,2,n+16|0))||0|(s=0|_e(t,e,3,n+24|0))||0|(s=0|_e(t,e,4,n+32|0))?0|(a=s):(r[(a=n+40|0)>>2]=0,r[a+4>>2]=0,0|(a=0)):0|(a=s)},_cellsToDirectedEdge:function(t,e,n,i,s){return s|=0,7==(0|(n=0|F(t|=0,e|=0,n|=0,i|=0)))?0|(s=11):(i=0|Ge(0|n,0,56),e=-2130706433&e|w()|268435456,r[s>>2]=t|i,r[s+4>>2]=e,0|(s=0))},_cellsToLinkedMultiPolygon:function(t,e,n){n|=0;var i,s,a,o=0;if(a=D,D=D+32|0,i=a,t=0|function(t,e,n){t|=0,n|=0;var i,s,a=0,o=0,l=0,u=0,h=0,c=0;if(s=D,D=D+176|0,i=s,(0|(e|=0))<1)return xe(n,0,0),D=s,0;for(h=0|qe(0|r[(h=t)>>2],0|r[h+4>>2],52),w(),xe(n,(0|e)>6?e:6,15&h),h=0;!(0|(a=0|Yt(0|r[(a=t+(h<<3)|0)>>2],0|r[a+4>>2],i)));){if((0|(a=0|r[i>>2]))>0){u=0;do{l=i+8+(u<<4)|0,(o=0|Te(n,a=i+8+((0|(u=u+1|0))%(0|a)<<4)|0,l))?Me(n,o):we(n,l,a),a=0|r[i>>2]}while((0|u)<(0|a))}if((0|(h=h+1|0))>=(0|e)){a=0,c=13;break}}return 13==(0|c)?(D=s,0|a):(be(n),D=s,0|(c=a))}(t|=0,e|=0,s=a+16|0),0|t)return D=a,0|(n=t);if(r[n>>2]=0,r[n+4>>2]=0,r[n+8>>2]=0,0|(t=0|Se(s)))do{e=0|re(n);do{se(e,t),o=t+16|0,r[i>>2]=r[o>>2],r[i+4>>2]=r[o+4>>2],r[i+8>>2]=r[o+8>>2],r[i+12>>2]=r[o+12>>2],Me(s,t),t=0|Ee(s,i)}while(0|t);t=0|Se(s)}while(0|t);return be(s),(t=0|oe(n))?(ae(n),D=a,0|(o=t)):(D=a,0|(o=0))},_childPosToCell:function(t,e,n,i,s,a){t|=0,e|=0,a|=0;var o,l=0,u=0,h=0,c=0,A=0,d=0,p=0,f=0,m=0;if(o=D,D=D+16|0,l=o,(s|=0)>>>0>15)return D=o,0|(a=4);if(u=0|qe(0|(n|=0),0|(i|=0),52),w(),(0|(u&=15))>(0|s))return D=o,0|(a=12);if(0|Ut(n,i,s,l)&&T(23313,22674,1063,22725),!(((0|e)>-1|-1==(0|e)&t>>>0>4294967295)&((0|(c=0|r[(A=l)+4>>2]))>(0|e)|((0|c)==(0|e)?(0|r[A>>2])>>>0>t>>>0:0))))return D=o,0|(a=2);A=s-u|0,s=0|Ge(0|s,0,52),h=w()|-15728641&i,r[(c=a)>>2]=s|n,r[c+4>>2]=h,c=0|qe(0|n,0|i,45),w();t:do{if(0|z(127&c)){if(0|u)for(l=1;;){if(!(!((c=0|Ge(7,0,3*(15-l|0)|0))&n)&!(w()&i)))break t;if(!(l>>>0<u>>>0))break;l=l+1|0}if((0|A)<1)return D=o,0|(a=0);for(c=15^u,i=-1,h=1,l=1;;){u=0|ce(7,0,u=A-h|0,((0|u)<0)<<31>>31),n=0|w();do{if(l){if(l=0|Ue(0|(l=0|De(0|(l=0|Oe(0|u,0|n,5,0)),0|w(),-5,-1)),0|w(),6,0),(0|e)>(0|(s=0|w()))|(0|e)==(0|s)&t>>>0>l>>>0){e=0|Ie(0|(e=0|De(0|t,0|e,-1,-1)),0|w(),0|l,0|s),l=0|w(),f=0|r[(d=a)>>2],d=0|r[d+4>>2],p=0|Ge(7,0,0|(m=3*(c+i|0)|0)),d&=~w(),m=0|Ge(0|(s=0|De(0|(i=0|Ue(0|e,0|l,0|u,0|n)),0|(t=0|w()),2,0)),0|w(),0|m),d=w()|d,r[(s=a)>>2]=m|f&~p,r[s+4>>2]=d,t=0|Ie(0|e,0|l,0|(t=0|Oe(0|i,0|t,0|u,0|n)),0|w()),l=0,e=0|w();break}p=0|r[(m=a)>>2],m=0|r[m+4>>2],f=0|Ge(7,0,3*(c+i|0)|0),m&=~w(),r[(l=a)>>2]=p&~f,r[l+4>>2]=m,l=1;break}s=0|r[(p=a)>>2],p=0|r[p+4>>2],d=0|Ge(7,0,0|(i=3*(c+i|0)|0)),p&=~w(),i=0|Ge(0|(m=0|Ue(0|t,0|e,0|u,0|n)),0|(l=0|w()),0|i),p=w()|p,r[(f=a)>>2]=i|s&~d,r[f+4>>2]=p,t=0|Ie(0|t,0|e,0|(l=0|Oe(0|m,0|l,0|u,0|n)),0|w()),l=0,e=0|w()}while(0);if(!((0|A)>(0|h))){e=0;break}i=~h,h=h+1|0}return D=o,0|e}}while(0);if((0|A)<1)return D=o,0|(m=0);for(s=15^u,l=1;;){if(f=0|ce(7,0,f=A-l|0,((0|f)<0)<<31>>31),m=0|w(),n=0|r[(h=a)>>2],h=0|r[h+4>>2],i=0|Ge(7,0,0|(u=3*(s-l|0)|0)),h&=~w(),u=0|Ge(0|(d=0|Ue(0|t,0|e,0|f,0|m)),0|(p=0|w()),0|u),h=w()|h,r[(c=a)>>2]=u|n&~i,r[c+4>>2]=h,t=0|Ie(0|t,0|e,0|(m=0|Oe(0|d,0|p,0|f,0|m)),0|w()),e=0|w(),(0|A)<=(0|l)){e=0;break}l=l+1|0}return D=o,0|e},_compactCells:function(t,e,n,i){e|=0;var s,a=0,o=0,l=0,u=0,h=0,c=0,A=0,d=0,p=0,f=0,m=0,g=0,y=0,v=0,_=0,x=0,b=0,S=0,M=0,E=0;if(!(0|(n|=0))&!(0|(i|=0)))return 0|(M=0);if(o=0|r[(a=t|=0)>>2],!0&!(15728640&(a=0|r[a+4>>2]))){if(!((0|i)>0|!(0|i)&n>>>0>0))return 0|(M=0);if(r[(M=e)>>2]=o,r[M+4>>2]=a,1==(0|n)&!(0|i))return 0|(M=0);a=1;do{S=0|r[(b=t+(a<<3)|0)+4>>2],r[(M=e+(a<<3)|0)>>2]=r[b>>2],r[M+4>>2]=S,a=a+1|0}while(0<(0|i)|!(0|i)&a>>>0<n>>>0);return 0|(a=0)}if(!(S=0|Re(s=n<<3)))return 0|(M=13);if(We(0|S,0|t,0|s),!(b=0|Pe(n,8)))return Ne(S),0|(M=13);t:do{if(0|n){e:for(;;){_=0|qe(0|(v=0|r[(a=S)>>2]),0|(a=0|r[a+4>>2]),52),w(),x=(_&=15)+-1|0,y=(0|n)>0;n:do{if(!!(0|_)&y){if(f=((0|n)<0)<<31>>31,m=0|Ge(0|x,0,52),g=0|w(),x>>>0>15){if(!(!(0|v)&!(0|a))){M=17;break e}for(o=0;;){if((0|(o=o+1|0))>=(0|n))break n;if(!(!(0|(g=0|r[(i=S+(o<<3)|0)>>2]))&!(0|(i=0|r[i+4>>2])))){a=i,M=17;break e}}}for(o=0,t=v,i=a;;){if(!(!(0|t)&!(0|i))){if(!(!0&!(117440512&i))){M=22;break e}if(u=0|qe(0|t,0|i,52),w(),(0|(u&=15))<(0|x)){a=12,M=28;break e}if((0|u)!=(0|x)&&(t|=m,i=-15728641&i|g,u>>>0>=_>>>0)){l=x;do{p=0|Ge(7,0,3*(14-l|0)|0),l=l+1|0,t|=p,i=w()|i}while(l>>>0<u>>>0)}if(l=0|ke(0|t,0|i,0|n,0|f),w(),!(0|(h=0|r[(u=c=b+(l<<3)|0)>>2]))&!(0|(u=0|r[u+4>>2])))l=c;else for(p=0;;){if((0|p)>(0|n)){M=32;break e}if((0|h)==(0|t)&(-117440513&u)==(0|i)){A=0|qe(0|h,0|u,56),w(),d=(A&=7)+1|0,E=0|qe(0|h,0|u,45),w();i:do{if(0|z(127&E)){if(h=0|qe(0|h,0|u,52),w(),!(h&=15)){u=6;break}for(u=1;;){if(!(!((E=0|Ge(7,0,3*(15-u|0)|0))&t)&!(w()&i))){u=7;break i}if(!(u>>>0<h>>>0)){u=6;break}u=u+1|0}}else u=7}while(0);if((A+2|0)>>>0>u>>>0){M=42;break e}E=0|Ge(0|d,0,56),i=w()|-117440513&i,r[(d=c)>>2]=0,r[d+4>>2]=0,t|=E}else l=(l+1|0)%(0|n)|0;if(!(0|(h=0|r[(u=c=b+(l<<3)|0)>>2]))&!(0|(u=0|r[u+4>>2]))){l=c;break}p=p+1|0}r[(E=l)>>2]=t,r[E+4>>2]=i}if((0|(o=o+1|0))>=(0|n))break n;t=0|r[(i=S+(o<<3)|0)>>2],i=0|r[i+4>>2]}}}while(0);if((n+5|0)>>>0<11){M=85;break}if(!(g=0|Pe((0|n)/6|0,8))){M=49;break}n:do{if(y){p=0,d=0;do{if(!(!(0|(o=0|r[(i=u=b+(p<<3)|0)>>2]))&!(0|(i=0|r[i+4>>2])))){h=0|qe(0|o,0|i,56),w(),t=(h&=7)+1|0,c=-117440513&i,E=0|qe(0|o,0|i,45),w();i:do{if(0|z(127&E)){if(A=0|qe(0|o,0|i,52),w(),0|(A&=15))for(l=1;;){if(!(!(o&(E=0|Ge(7,0,3*(15-l|0)|0)))&!(c&w())))break i;if(!(l>>>0<A>>>0))break;l=l+1|0}o|=i=0|Ge(0|t,0,56),i=w()|c,r[(t=u)>>2]=o,r[t+4>>2]=i,t=h+2|0}}while(0);7==(0|t)&&(r[(E=g+(d<<3)|0)>>2]=o,r[E+4>>2]=-117440513&i,d=d+1|0)}p=p+1|0}while((0|p)!=(0|n));if(y){if(p=((0|n)<0)<<31>>31,f=0|Ge(0|x,0,52),m=0|w(),x>>>0>15){if(!(!(0|v)&!(0|a))){a=4,M=84;break e}for(a=0;;){if((0|(a=a+1|0))>=(0|n)){o=0,a=d;break n}if(!(!(0|r[(E=S+(a<<3)|0)>>2])&!(0|r[E+4>>2]))){a=4,M=84;break e}}}for(A=0,o=0,c=v;;){do{if(!(!(0|c)&!(0|a))){if(u=0|qe(0|c,0|a,52),w(),(0|(u&=15))<(0|x)){a=12,M=84;break e}do{if((0|u)==(0|x))i=c,u=a;else{if(i=c|f,t=-15728641&a|m,u>>>0<_>>>0){u=t;break}l=x;do{E=0|Ge(7,0,3*(14-l|0)|0),l=l+1|0,i|=E,t=w()|t}while(l>>>0<u>>>0);u=t}}while(0);for(l=0|ke(0|i,0|u,0|n,0|p),w(),t=0;;){if((0|t)>(0|n)){M=77;break e}if((-117440513&(h=0|r[(E=b+(l<<3)|0)+4>>2]))==(0|u)&&(0|r[E>>2])==(0|i)){M=79;break}if((0|r[(E=b+((l=(l+1|0)%(0|n)|0)<<3)|0)>>2])==(0|i)&&(0|r[E+4>>2])==(0|u))break;t=t+1|0}if(79==(0|M)&&(M=0,!0&100663296==(117440512&h)))break;r[(E=e+(o<<3)|0)>>2]=c,r[E+4>>2]=a,o=o+1|0}}while(0);if((0|(a=A+1|0))>=(0|n)){a=d;break n}A=a,c=0|r[(E=S+(a<<3)|0)>>2],a=0|r[E+4>>2]}}else o=0,a=d}else o=0,a=0}while(0);if(Xe(0|b,0,0|s),We(0|S,0|g,a<<3),Ne(g),!a)break t;e=e+(o<<3)|0,n=a}if(17==(0|M))!0&!(117440512&a)?(a=4,M=28):M=22;else if(32==(0|M))T(23313,22674,362,22684);else{if(42==(0|M))return Ne(S),Ne(b),0|(E=10);if(49==(0|M))return Ne(S),Ne(b),0|(E=13);if(77==(0|M))T(23313,22674,462,22684);else{if(84==(0|M))return Ne(g),Ne(S),Ne(b),0|(E=a);if(85==(0|M)){We(0|e,0|S,n<<3);break}}}if(22==(0|M))return Ne(S),Ne(b),0|(E=5);if(28==(0|M))return Ne(S),Ne(b),0|(E=a)}}while(0);return Ne(S),Ne(b),0|(E=0)},_destroyLinkedMultiPolygon:ae,_directedEdgeToBoundary:St,_directedEdgeToCells:function(t,e,n){t|=0;var i,s,a,o=0;return i=D,D=D+16|0,o=i,!0&268435456==(2013265920&(e|=0))?(s=-2130706433&e|134217728,r[(a=n|=0)>>2]=t,r[a+4>>2]=s,r[o>>2]=0,e=0|qe(0|t,0|e,56),w(),o=0|O(t,s,7&e,o,n+8|0),D=i,0|o):(D=i,0|(o=6))},_edgeLengthKm:function(t,e,n){n|=0;var i,a=0,o=0,l=0,u=0,c=0,p=0,f=0;if(i=D,D=D+176|0,0|(t=0|St(t|=0,e|=0,u=i)))return u=t,l=+s[n>>3],l*=6371.007180918475,s[n>>3]=l,D=i,0|u;if(s[n>>3]=0,(0|(t=0|r[u>>2]))<=1)return u=0,l=0,l*=6371.007180918475,s[n>>3]=l,D=i,0|u;e=t+-1|0,t=0,a=+s[u+8>>3],o=+s[u+16>>3],l=0;do{p=a,a=+s[u+8+((t=t+1|0)<<4)>>3],f=+d(.5*(a-p)),c=o,o=+s[u+8+(t<<4)+8>>3],c=f*f+(c=+d(.5*(o-c)))*(+A(+p)*+A(+a)*c),l+=2*+y(+ +h(+c),+ +h(+(1-c)))}while((0|t)!=(0|e));return s[n>>3]=l,u=0,f=l,f*=6371.007180918475,s[n>>3]=f,D=i,0|u},_edgeLengthM:function(t,e,n){n|=0;var i,a=0,o=0,l=0,u=0,c=0,p=0,f=0;if(i=D,D=D+176|0,0|(t=0|St(t|=0,e|=0,u=i)))return u=t,l=+s[n>>3],l*=6371.007180918475,l*=1e3,s[n>>3]=l,D=i,0|u;if(s[n>>3]=0,(0|(t=0|r[u>>2]))<=1)return u=0,l=0,l*=6371.007180918475,l*=1e3,s[n>>3]=l,D=i,0|u;e=t+-1|0,t=0,a=+s[u+8>>3],o=+s[u+16>>3],l=0;do{p=a,a=+s[u+8+((t=t+1|0)<<4)>>3],f=+d(.5*(a-p)),c=o,o=+s[u+8+(t<<4)+8>>3],c=f*f+(c=+d(.5*(o-c)))*(+A(+p)*+A(+a)*c),l+=2*+y(+ +h(+c),+ +h(+(1-c)))}while((0|t)!=(0|e));return s[n>>3]=l,u=0,f=l,f*=6371.007180918475,f*=1e3,s[n>>3]=f,D=i,0|u},_edgeLengthRads:function(t,e,n){n|=0;var i,a=0,o=0,l=0,u=0,c=0,p=0,f=0;if(i=D,D=D+176|0,0|(t=0|St(t|=0,e|=0,u=i)))return D=i,0|(u=t);if(s[n>>3]=0,(0|(t=0|r[u>>2]))<=1)return D=i,0|(u=0);e=t+-1|0,t=0,a=+s[u+8>>3],o=+s[u+16>>3],l=0;do{p=a,a=+s[u+8+((t=t+1|0)<<4)>>3],f=+d(.5*(a-p)),c=o,o=+s[u+8+(t<<4)+8>>3],c=f*f+(c=+d(.5*(o-c)))*(+A(+a)*+A(+p)*c),l+=2*+y(+ +h(+c),+ +h(+(1-c)))}while((0|t)<(0|e));return s[n>>3]=l,D=i,0|(u=0)},_emscripten_replace_memory:function(t){return i=new Int8Array(t),r=new Int32Array(t),s=new Float64Array(t),n=t,!0},_free:Ne,_getBaseCellNumber:It,_getDirectedEdgeDestination:function(t,e,n){t|=0,e|=0,n|=0;var i,s,a=0;return i=D,D=D+16|0,r[(a=i)>>2]=0,!0&268435456==(2013265920&e)?(s=0|qe(0|t,0|e,56),w(),a=0|O(t,-2130706433&e|134217728,7&s,a,n),D=i,0|a):(D=i,0|(a=6))},_getDirectedEdgeOrigin:function(t,e,n){return t|=0,n|=0,!0&268435456==(2013265920&(e|=0))?(r[n>>2]=t,r[n+4>>2]=-2130706433&e|134217728,0|(n=0)):0|(n=6)},_getHexagonAreaAvgKm2:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(s[e>>3]=+s[20528+(t<<3)>>3],0|(e=0))},_getHexagonAreaAvgM2:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(s[e>>3]=+s[20656+(t<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgKm:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(s[e>>3]=+s[20784+(t<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgM:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(s[e>>3]=+s[20912+(t<<3)>>3],0|(e=0))},_getIcosahedronFaces:function t(e,n,i){i|=0;var s,a=0,o=0,l=0,u=0,h=0,c=0,A=0,d=0;s=D,D=D+128|0,A=s+112|0,l=s+96|0,d=s,o=0|qe(0|(e|=0),0|(n|=0),52),w(),h=15&o,r[A>>2]=h,u=0|qe(0|e,0|n,45),w(),u&=127;t:do{if(0|z(u)){if(0|h)for(a=1;;){if(!(!((c=0|Ge(7,0,3*(15-a|0)|0))&e)&!(w()&n))){o=0;break t}if(!(a>>>0<h>>>0))break;a=a+1|0}if(!(1&o))return c=0|Ge(h+1|0,0,52),d=w()|-15728641&n,d=0|t((c|e)&~(A=0|Ge(7,0,3*(14-h|0)|0)),d&~w(),i),D=s,0|d;o=1}else o=0}while(0);if(!(a=0|Wt(e,n,l))){o?(Ct(l,A,d),c=5):(Dt(l,A,d),c=6);t:do{if(0|z(u))if(h)for(a=1;;){if(!(!((u=0|Ge(7,0,3*(15-a|0)|0))&e)&!(w()&n))){e=2;break t}if(!(a>>>0<h>>>0)){e=5;break}a=a+1|0}else e=5;else e=2}while(0);Xe(0|i,-1,e<<2);t:do{if(o)for(l=0;;){if(Nt(u=d+(l<<4)|0,0|r[A>>2]),u=0|r[u>>2],-1==(0|(h=0|r[i>>2]))|(0|h)==(0|u))a=i;else{o=0;do{if((o=o+1|0)>>>0>=e>>>0){a=1;break t}h=0|r[(a=i+(o<<2)|0)>>2]}while(!(-1==(0|h)|(0|h)==(0|u)))}if(r[a>>2]=u,(l=l+1|0)>>>0>=c>>>0){a=0;break}}else for(l=0;;){if(Rt(u=d+(l<<4)|0,0|r[A>>2],0,1),u=0|r[u>>2],-1==(0|(h=0|r[i>>2]))|(0|h)==(0|u))a=i;else{o=0;do{if((o=o+1|0)>>>0>=e>>>0){a=1;break t}h=0|r[(a=i+(o<<2)|0)>>2]}while(!(-1==(0|h)|(0|h)==(0|u)))}if(r[a>>2]=u,(l=l+1|0)>>>0>=c>>>0){a=0;break}}}while(0)}return D=s,0|(d=a)},_getNumCells:ee,_getPentagons:Qt,_getRes0Cells:function(t){t|=0;var e=0,n=0,i=0;e=0;do{Ge(0|e,0,45),i=134225919|w(),r[(n=t+(e<<3)|0)>>2]=-1,r[n+4>>2]=i,e=e+1|0}while(122!=(0|e));return 0},_getResolution:function(t,e){return e=0|qe(0|(t|=0),0|(e|=0),52),w(),15&e},_greatCircleDistanceKm:te,_greatCircleDistanceM:function(t,e){t|=0;var n,i,r,a=0;return i=+s[(e|=0)>>3],n=+s[t>>3],a=(r=+d(.5*(i-n)))*r+(a=+d(.5*(+s[e+8>>3]-+s[t+8>>3])))*(+A(+i)*+A(+n)*a),2*+y(+ +h(+a),+ +h(+(1-a)))*6371.007180918475*1e3},_greatCircleDistanceRads:function(t,e){t|=0;var n,i,r,a=0;return i=+s[(e|=0)>>3],n=+s[t>>3],a=(r=+d(.5*(i-n)))*r+(a=+d(.5*(+s[e+8>>3]-+s[t+8>>3])))*(+A(+i)*+A(+n)*a),2*+y(+ +h(+a),+ +h(+(1-a)))},_gridDisk:I,_gridDiskDistances:L,_gridDistance:function(t,e,n,i,s){n|=0,i|=0,s|=0;var a,o,l=0,u=0;return o=D,D=D+32|0,u=o,0|(a=0|ue(t|=0,e|=0,t,e,l=o+12|0))?(D=o,0|(u=a)):0|(t=0|ue(t,e,n,i,u))?(D=o,0|(u=t)):(l=0|yt(l,u),r[(u=s)>>2]=l,r[u+4>>2]=((0|l)<0)<<31>>31,D=o,0|(u=0))},_gridPathCells:function(t,e,n,i,s){n|=0,i|=0,s|=0;var a,o=0,l=0,h=0,c=0,A=0,d=0,p=0,f=0,m=0,g=0,y=0,v=0,_=0,x=0,b=0,S=0,M=0,E=0,C=0;if(a=D,D=D+48|0,h=a+12|0,E=a,!(o=0|ue(t|=0,e|=0,t,e,l=a+24|0))&&!(o=0|ue(t,e,n,i,h))){M=((0|(S=0|yt(l,h)))<0)<<31>>31,r[l>>2]=0,r[l+4>>2]=0,r[l+8>>2]=0,r[h>>2]=0,r[h+4>>2]=0,r[h+8>>2]=0,0|ue(t,e,t,e,l)&&T(23313,23090,691,23299),0|ue(t,e,n,i,h)&&T(23313,23090,696,23299),xt(l),xt(h),S?(g=+(0|S),b=l,i=p=0|r[l>>2],o=f=0|r[(_=l+4|0)>>2],n=m=0|r[(x=l+8|0)>>2],y=+((0|r[h>>2])-p|0)/g,v=+((0|r[h+4>>2])-f|0)/g,g=+((0|r[h+8>>2])-m|0)/g):(_=o=l+4|0,x=n=l+8|0,b=l,i=0|r[l>>2],o=0|r[o>>2],n=0|r[n>>2],y=0,v=0,g=0),r[E>>2]=i,r[(m=E+4|0)>>2]=o,r[(f=E+8|0)>>2]=n;t:do{if((0|S)<0)o=0;else for(d=0,p=0,o=i;;){C=y*(A=+(p>>>0)+4294967296*+(0|d))+ +(0|o),c=v*A+ +(0|r[_>>2]),A=g*A+ +(0|r[x>>2]),n=~~+je(+C),l=~~+je(+c),o=~~+je(+A),C=+u(+(+(0|n)-C)),c=+u(+(+(0|l)-c)),A=+u(+(+(0|o)-A));do{if(!(C>c&C>A)){if(h=0-n|0,c>A){i=h-o|0;break}i=l,o=h-l|0;break}n=0-(l+o)|0,i=l}while(0);if(r[E>>2]=n,r[m>>2]=i,r[f>>2]=o,bt(E),0|(o=0|he(t,e,E,s+(p<<3)|0)))break t;if(!((0|d)<(0|M)|(0|d)==(0|M)&p>>>0<S>>>0)){o=0;break t}o=0|De(0|p,0|d,1,0),d=h=0|w(),p=o,o=0|r[b>>2]}}while(0);return D=a,0|(E=o)}return D=a,0|(E=o)},_gridPathCellsSize:function(t,e,n,i,s){n|=0,i|=0,s|=0;var a,o=0,l=0,u=0;return a=D,D=D+32|0,u=a,(o=0|ue(t|=0,e|=0,t,e,l=a+12|0))||(o=0|ue(t,e,n,i,u))?(D=a,0|(u=o)):(i=0|De(0|(i=0|yt(l,u)),((0|i)<0)<<31>>31,1,0),l=0|w(),r[(u=s)>>2]=i,r[u+4>>2]=l,D=a,0|(u=0))},_gridRingUnsafe:function(t,e,n,i){t|=0,e|=0,n|=0,i|=0;var s,a,o=0,l=0,u=0,h=0,c=0,A=0,d=0,p=0,f=0;if(a=D,D=D+16|0,f=a+8|0,r[(p=s=a)>>2]=t,r[p+4>>2]=e,!n)return r[(f=i)>>2]=t,r[f+4>>2]=e,D=a,0|(f=0);r[f>>2]=0;t:do{if(0|Ot(t,e))t=9;else{if(l=(0|n)>0){o=0,p=t;do{if(0|(t=0|O(p,e,4,f,s)))break t;if(o=o+1|0,0|Ot(p=0|r[(e=s)>>2],e=0|r[e+4>>2])){t=9;break t}}while((0|o)<(0|n));if(r[(d=i)>>2]=p,r[d+4>>2]=e,d=n+-1|0,l){A=0,t=1;do{if(o=22384+(A<<2)|0,5==(0|A))for(u=0|r[o>>2],l=0,o=t;;){if(0|(t=0|O(0|r[(t=s)>>2],0|r[t+4>>2],u,f,s)))break t;if((0|l)!=(0|d)){if(h=0|r[(c=s)>>2],c=0|r[c+4>>2],r[(t=i+(o<<3)|0)>>2]=h,r[t+4>>2]=c,0|Ot(h,c)){t=9;break t}t=o+1|0}else t=o;if((0|(l=l+1|0))>=(0|n))break;o=t}else for(u=s,c=0|r[o>>2],h=0,o=t,l=0|r[u>>2],u=0|r[u+4>>2];;){if(0|(t=0|O(l,u,c,f,s)))break t;if(l=0|r[(u=s)>>2],u=0|r[u+4>>2],r[(t=i+(o<<3)|0)>>2]=l,r[t+4>>2]=u,t=o+1|0,0|Ot(l,u)){t=9;break t}if((0|(h=h+1|0))>=(0|n))break;o=t}A=A+1|0}while(A>>>0<6);u=p,o=0|r[(t=s)>>2],l=e,t=0|r[t+4>>2]}else u=p,o=p,l=e,t=e}else r[(u=i)>>2]=t,r[u+4>>2]=e,u=t,o=t,l=e,t=e;t=(0|u)==(0|o)&(0|l)==(0|t)?0:9}}while(0);return D=a,0|(f=t)},_i64Add:De,_i64Subtract:Ie,_isPentagon:Ot,_isResClassIII:function(t,e){return e=0|qe(0|(t|=0),0|(e|=0),52),w(),1&e},_isValidCell:Lt,_isValidDirectedEdge:function(t,e){var n=0;switch(n=0|qe(0|(t|=0),0|(e|=0),56),w(),7&n){case 0:case 7:return 0|(n=0)}return n=-2130706433&e|134217728,!0&268435456==(2013265920&e)?!0&16777216==(117440512&e)&!!(0|Ot(t,n))?0|(n=0):0|(n=0|Lt(t,n)):0|(n=0)},_isValidVertex:function(t,e){t|=0;var n,i,s=0,a=0;return i=D,D=D+16|0,n=i,!0&536870912==(2013265920&(e|=0))&&0|Lt(t,s=-2130706433&e|134217728)?(a=0|qe(0|t,0|e,56),w(),s=(a=!(0|_e(t,s,7&a,n)))&((0|r[(s=n)>>2])==(0|t)?(0|r[s+4>>2])==(0|e):0)&1,D=i,0|s):(D=i,0|(s=0))},_latLngToCell:Ht,_llvm_maxnum_f64:Ve,_llvm_minnum_f64:He,_llvm_round_f64:je,_localIjToCell:function(t,e,n,i,r){var s,a;return t|=0,e|=0,n|=0,r|=0,a=D,D=D+16|0,s=a,(i|=0)?n=15:(n=0|_t(n,s))||(n=0|he(t,e,s,r)),D=a,0|n},_malloc:Re,_maxFaceCount:function(t,e,n){n|=0;var i=0,s=0;if(s=0|qe(0|(t|=0),0|(e|=0),45),w(),!(0|z(127&s)))return s=2,r[n>>2]=s,0;if(s=0|qe(0|t,0|e,52),w(),!(s&=15))return s=5,r[n>>2]=s,0;for(i=1;;){if(!(!((0|Ge(7,0,3*(15-i|0)|0))&t)&!(w()&e))){i=2,t=6;break}if(!(i>>>0<s>>>0)){i=5,t=6;break}i=i+1|0}return 6==(0|t)?(r[n>>2]=i,0):0},_maxGridDiskSize:function(t,e){e|=0;var n=0,i=0,s=0;return(0|(t|=0))<0?0|(e=2):(0|t)>13780509?0|(e=0|ee(15,e)):(s=0|Oe(0|t,0|(n=((0|t)<0)<<31>>31),3,0),i=0|w(),n=0|De(0|t,0|n,1,0),n=0|De(0|(n=0|Oe(0|s,0|i,0|n,0|w())),0|w(),1,0),t=0|w(),r[e>>2]=n,r[e+4>>2]=t,0|(e=0))},_maxPolygonToCellsSize:function(t,e,n,i){e|=0,i|=0;var s,a=0,o=0,l=0,u=0,h=0;if(s=D,D=D+48|0,a=s+16|0,o=s+8|0,l=s,0|(n|=0))return D=s,0|(l=15);if(u=0|r[(h=t|=0)+4>>2],r[(n=o)>>2]=r[h>>2],r[n+4>>2]=u,de(o,a),!(e=0|Q(a,e,l))){if(n=0|r[o>>2],(0|(o=0|r[t+8>>2]))>0){a=0|r[t+12>>2],e=0;do{n=(0|r[a+(e<<3)>>2])+n|0,e=e+1|0}while((0|e)<(0|o))}a=0|r[(e=l)>>2],(0|(e=0|r[e+4>>2]))<(0|(o=((0|n)<0)<<31>>31))|(0|e)==(0|o)&a>>>0<n>>>0?(r[(e=l)>>2]=n,r[e+4>>2]=o,e=o):n=a,u=0|De(0|n,0|e,12,0),h=0|w(),r[(e=l)>>2]=u,r[e+4>>2]=h,r[(e=i)>>2]=u,r[e+4>>2]=h,e=0}return D=s,0|(h=e)},_memcpy:We,_memset:Xe,_originToDirectedEdges:function(t,e,n){n|=0;var i,s=0;return i=!(0|Ot(t|=0,e|=0)),e&=-2130706433,r[(s=n)>>2]=i?t:0,r[s+4>>2]=i?285212672|e:0,r[(s=n+8|0)>>2]=t,r[s+4>>2]=301989888|e,r[(s=n+16|0)>>2]=t,r[s+4>>2]=318767104|e,r[(s=n+24|0)>>2]=t,r[s+4>>2]=335544320|e,r[(s=n+32|0)>>2]=t,r[s+4>>2]=352321536|e,r[(n=n+40|0)>>2]=t,r[n+4>>2]=369098752|e,0},_pentagonCount:function(){return 12},_polygonToCells:function(t,e,n,i){e|=0,i|=0;var s,a,o,l,u=0,h=0,c=0,A=0,d=0,p=0,f=0,m=0,g=0,y=0,v=0,_=0,x=0,b=0,S=0,M=0,T=0,E=0,C=0,R=0,N=0,P=0,I=0,L=0,O=0,F=0,z=0;if(l=D,D=D+112|0,s=l+80|0,d=l+72|0,a=l,o=l+56|0,0|(n|=0))return D=l,0|(z=15);if(!(z=0|Re(32+(r[(p=(t|=0)+8|0)>>2]<<5)|0)))return D=l,0|(z=13);if(pe(t,z),F=0|r[(O=t)+4>>2],r[(n=d)>>2]=r[O>>2],r[n+4>>2]=F,de(d,s),n=0|Q(s,e,a))O=0,F=0;else{if(n=0|r[d>>2],(0|(h=0|r[p>>2]))>0){c=0|r[t+12>>2],u=0;do{n=(0|r[c+(u<<3)>>2])+n|0,u=u+1|0}while((0|u)!=(0|h));u=n}else u=n;h=0|r[(n=a)>>2],(0|(n=0|r[n+4>>2]))<(0|(c=((0|u)<0)<<31>>31))|(0|n)==(0|c)&h>>>0<u>>>0?(r[(n=a)>>2]=u,r[n+4>>2]=c,n=c):u=h,O=0|De(0|u,0|n,12,0),F=0|w(),r[(n=a)>>2]=O,r[n+4>>2]=F,n=0}if(0|n)return Ne(z),D=l,0|(z=n);if(!(u=0|Pe(O,8)))return Ne(z),D=l,0|(z=13);if(!(A=0|Pe(O,8)))return Ne(z),Ne(u),D=l,0|(z=13);r[(I=s)>>2]=0,r[I+4>>2]=0,L=0|r[(I=t)+4>>2],r[(n=d)>>2]=r[I>>2],r[n+4>>2]=L,n=0|k(d,O,F,e,s,u,A);t:do{if(n)Ne(u),Ne(A),Ne(z);else{e:do{if((0|r[p>>2])>0){for(c=t+12|0,h=0;n=0|k((0|r[c>>2])+(h<<3)|0,O,F,e,s,u,A),h=h+1|0,!(0|n);)if((0|h)>=(0|r[p>>2]))break e;Ne(u),Ne(A),Ne(z);break t}}while(0);(0|F)>0|!(0|F)&O>>>0>0&&Xe(0|A,0,O<<3),I=0|r[(L=s)+4>>2];e:do{if((0|I)>0|!(0|I)&(0|r[L>>2])>>>0>0){R=u,N=A,P=u,I=A,L=u,n=u,T=u,E=A,C=A,u=A;n:for(;;){for(x=0,b=0,S=0,M=0,h=0,c=0;;){d=(A=a)+56|0;do{r[A>>2]=0,A=A+4|0}while((0|A)<(0|d));if(0|B(p=0|r[(e=R+(x<<3)|0)>>2],e=0|r[e+4>>2],1,a,0)){d=(A=a)+56|0;do{r[A>>2]=0,A=A+4|0}while((0|A)<(0|d));0|(A=0|Pe(7,4))&&(U(p,e,1,a,A,7,0,0),Ne(A))}for(_=0;;){y=0|r[(v=a+(_<<3)|0)>>2],v=0|r[v+4>>2];i:do{if(!(0|y)&!(0|v))A=h,d=c;else{if(f=0|ke(0|y,0|v,0|O,0|F),p=0|w(),!(!(0|(d=0|r[(e=A=i+(f<<3)|0)>>2]))&!(0|(e=0|r[e+4>>2])))){m=0,g=0;do{if((0|m)>(0|F)|(0|m)==(0|F)&g>>>0>O>>>0)break n;if((0|d)==(0|y)&(0|e)==(0|v)){A=h,d=c;break i}f=0|Fe(0|(A=0|De(0|f,0|p,1,0)),0|w(),0|O,0|F),p=0|w(),g=0|De(0|g,0|m,1,0),m=0|w(),d=0|r[(e=A=i+(f<<3)|0)>>2],e=0|r[e+4>>2]}while(!(!(0|d)&!(0|e)))}!(0|y)&!(0|v)?(A=h,d=c):(Xt(y,v,o),0|fe(t,z,o)&&(g=0|De(0|h,0|c,1,0),c=0|w(),r[(m=A)>>2]=y,r[m+4>>2]=v,r[(h=N+(h<<3)|0)>>2]=y,r[h+4>>2]=v,h=g),A=h,d=c)}}while(0);if((_=_+1|0)>>>0>=7)break;h=A,c=d}if(x=0|De(0|x,0|b,1,0),b=0|w(),S=0|De(0|S,0|M,1,0),M=0|w(),h=0|r[(c=s)>>2],!((0|M)<(0|(c=0|r[c+4>>2]))|(0|M)==(0|c)&S>>>0<h>>>0))break;h=A,c=d}if((0|c)>0|!(0|c)&h>>>0>0){h=0,c=0;do{r[(M=R+(h<<3)|0)>>2]=0,r[M+4>>2]=0,h=0|De(0|h,0|c,1,0),c=0|w(),S=0|r[(M=s)+4>>2]}while((0|c)<(0|S)|((0|c)==(0|S)?h>>>0<(0|r[M>>2])>>>0:0))}if(r[(M=s)>>2]=A,r[M+4>>2]=d,!((0|d)>0|!(0|d)&A>>>0>0))break e;_=u,x=C,b=L,S=E,M=N,u=T,C=n,E=P,T=_,n=x,L=I,I=b,P=S,N=R,R=M}Ne(P),Ne(I),Ne(z),n=1;break t}n=A}while(0);Ne(z),Ne(u),Ne(n),n=0}}while(0);return D=l,0|(z=n)},_readInt64AsDoubleFromPointer:function(t){return+(+((0|r[(t|=0)>>2])>>>0)+4294967296*+(0|r[t+4>>2]))},_res0CellCount:function(){return 122},_round:Ye,_sbrk:Qe,_sizeOfCellBoundary:function(){return 168},_sizeOfCoordIJ:function(){return 8},_sizeOfGeoLoop:function(){return 8},_sizeOfGeoPolygon:function(){return 16},_sizeOfH3Index:function(){return 8},_sizeOfLatLng:function(){return 16},_sizeOfLinkedGeoPolygon:function(){return 12},_uncompactCells:function(t,e,n,i,s,a,o){t|=0,i|=0,s|=0,a|=0;var l,u=0,h=0,c=0,A=0,d=0,p=0,f=0,m=0;if(l=D,D=D+16|0,m=l,!((0|(n|=0))>0|!(0|n)&(e|=0)>>>0>0))return D=l,0|(m=0);if((0|(o|=0))>=16)return D=l,0|(m=12);p=0,f=0,d=0,u=0;t:for(;;){if(A=0|qe(0|(h=0|r[(c=t+(p<<3)|0)>>2]),0|(c=0|r[c+4>>2]),52),w(),(15&A)>(0|o)){u=12,h=11;break}if($t(m,h,c,o),!(0|(c=0|r[(A=m)>>2]))&!(0|(A=0|r[A+4>>2])))h=d;else{h=d;do{if(!((0|u)<(0|a)|(0|u)==(0|a)&h>>>0<s>>>0)){h=10;break t}r[(d=i+(h<<3)|0)>>2]=c,r[d+4>>2]=A,h=0|De(0|h,0|u,1,0),u=0|w(),Zt(m),c=0|r[(d=m)>>2],A=0|r[d+4>>2]}while(!(!(0|c)&!(0|A)))}if(p=0|De(0|p,0|f,1,0),!((0|(f=0|w()))<(0|n)|(0|f)==(0|n)&p>>>0<e>>>0)){u=0,h=11;break}d=h}return 10==(0|h)?(D=l,0|(m=14)):11==(0|h)?(D=l,0|u):0},_uncompactCellsSize:function(t,e,n,i,s){t|=0,e|=0,n|=0,i|=0,s|=0;var a,o,l=0,u=0,h=0,c=0,A=0,d=0;o=D,D=D+16|0,a=o;t:do{if((0|n)>0|!(0|n)&e>>>0>0){for(A=0,u=0,l=0,d=0;;){if(!(!(0|(h=0|r[(c=t+(A<<3)|0)>>2]))&!(0|(c=0|r[c+4>>2]))||(c=!(0|Ut(h,c,i,a)),u=0|De(0|r[(h=a)>>2],0|r[h+4>>2],0|u,0|l),l=0|w(),c))){l=12;break}if(A=0|De(0|A,0|d,1,0),!((0|(d=0|w()))<(0|n)|(0|d)==(0|n)&A>>>0<e>>>0))break t}return D=o,0|l}u=0,l=0}while(0);return r[s>>2]=u,r[s+4>>2]=l,D=o,0|(s=0)},_vertexToLatLng:function(t,e,n){n|=0;var i,s,a,o,l=0,u=0;return o=D,D=D+192|0,s=o,a=o+168|0,l=0|qe(0|(t|=0),0|(e|=0),56),w(),l&=7,0|(i=0|Wt(t,u=-2130706433&e|134217728,a))?(D=o,0|(u=i)):(e=0|qe(0|t,0|e,52),w(),e&=15,0|Ot(t,u)?Et(a,e,l,1,s):Pt(a,e,l,1,s),u=s+8|0,r[n>>2]=r[u>>2],r[n+4>>2]=r[u+4>>2],r[n+8>>2]=r[u+8>>2],r[n+12>>2]=r[u+12>>2],D=o,0|(u=0))},establishStackSpace:function(t,e){D=t|=0},stackAlloc:function(t){var e;return e=D,D=(D=D+(t|=0)|0)+15&-16,0|e},stackRestore:function(t){D=t|=0},stackSave:function(){return 0|D}}}({Math:Math,Int8Array:Int8Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Float32Array:Float32Array,Float64Array:Float64Array},{a:gt,b:function(t){g=t},c:function(){return g},d:function(t,e,n,i){gt("Assertion failed: "+N(t)+", at: "+[e?N(e):"unknown filename",n,i?N(i):"unknown function"])},e:function(t){return n.___errno_location&&(T[n.___errno_location()>>2]=t),t},f:J,g:function(t,e,n){M.set(M.subarray(e,e+n),t)},h:function(t){var e=J(),n=16777216,i=2130706432;if(t>i)return!1;for(var r=Math.max(e,16777216);r<t;)r=r<=536870912?P(2*r,n):Math.min(P((3*r+2147483648)/4,n),i);return!!tt(r)},i:function(t){gt("OOM")},j:$,k:Z,l:tt,m:K,n:function(){var t=K();return n.extraStackTrace&&(t+="\n"+n.extraStackTrace()),Z(t)},o:24144,p:24128},b);n.___divdi3=rt.___divdi3,n.___muldi3=rt.___muldi3,n.___remdi3=rt.___remdi3,n.___uremdi3=rt.___uremdi3,n._areNeighborCells=rt._areNeighborCells,n._bitshift64Ashr=rt._bitshift64Ashr,n._bitshift64Lshr=rt._bitshift64Lshr,n._bitshift64Shl=rt._bitshift64Shl,n._calloc=rt._calloc,n._cellAreaKm2=rt._cellAreaKm2,n._cellAreaM2=rt._cellAreaM2,n._cellAreaRads2=rt._cellAreaRads2,n._cellToBoundary=rt._cellToBoundary,n._cellToCenterChild=rt._cellToCenterChild,n._cellToChildPos=rt._cellToChildPos,n._cellToChildren=rt._cellToChildren,n._cellToChildrenSize=rt._cellToChildrenSize,n._cellToLatLng=rt._cellToLatLng,n._cellToLocalIj=rt._cellToLocalIj,n._cellToParent=rt._cellToParent,n._cellToVertex=rt._cellToVertex,n._cellToVertexes=rt._cellToVertexes,n._cellsToDirectedEdge=rt._cellsToDirectedEdge,n._cellsToLinkedMultiPolygon=rt._cellsToLinkedMultiPolygon,n._childPosToCell=rt._childPosToCell,n._compactCells=rt._compactCells,n._destroyLinkedMultiPolygon=rt._destroyLinkedMultiPolygon,n._directedEdgeToBoundary=rt._directedEdgeToBoundary,n._directedEdgeToCells=rt._directedEdgeToCells,n._edgeLengthKm=rt._edgeLengthKm,n._edgeLengthM=rt._edgeLengthM,n._edgeLengthRads=rt._edgeLengthRads;var st=n._emscripten_replace_memory=rt._emscripten_replace_memory;n._free=rt._free,n._getBaseCellNumber=rt._getBaseCellNumber,n._getDirectedEdgeDestination=rt._getDirectedEdgeDestination,n._getDirectedEdgeOrigin=rt._getDirectedEdgeOrigin,n._getHexagonAreaAvgKm2=rt._getHexagonAreaAvgKm2,n._getHexagonAreaAvgM2=rt._getHexagonAreaAvgM2,n._getHexagonEdgeLengthAvgKm=rt._getHexagonEdgeLengthAvgKm,n._getHexagonEdgeLengthAvgM=rt._getHexagonEdgeLengthAvgM,n._getIcosahedronFaces=rt._getIcosahedronFaces,n._getNumCells=rt._getNumCells,n._getPentagons=rt._getPentagons,n._getRes0Cells=rt._getRes0Cells,n._getResolution=rt._getResolution,n._greatCircleDistanceKm=rt._greatCircleDistanceKm,n._greatCircleDistanceM=rt._greatCircleDistanceM,n._greatCircleDistanceRads=rt._greatCircleDistanceRads,n._gridDisk=rt._gridDisk,n._gridDiskDistances=rt._gridDiskDistances,n._gridDistance=rt._gridDistance,n._gridPathCells=rt._gridPathCells,n._gridPathCellsSize=rt._gridPathCellsSize,n._gridRingUnsafe=rt._gridRingUnsafe,n._i64Add=rt._i64Add,n._i64Subtract=rt._i64Subtract,n._isPentagon=rt._isPentagon,n._isResClassIII=rt._isResClassIII,n._isValidCell=rt._isValidCell,n._isValidDirectedEdge=rt._isValidDirectedEdge,n._isValidVertex=rt._isValidVertex,n._latLngToCell=rt._latLngToCell,n._llvm_maxnum_f64=rt._llvm_maxnum_f64,n._llvm_minnum_f64=rt._llvm_minnum_f64,n._llvm_round_f64=rt._llvm_round_f64,n._localIjToCell=rt._localIjToCell,n._malloc=rt._malloc,n._maxFaceCount=rt._maxFaceCount,n._maxGridDiskSize=rt._maxGridDiskSize,n._maxPolygonToCellsSize=rt._maxPolygonToCellsSize,n._memcpy=rt._memcpy,n._memset=rt._memset,n._originToDirectedEdges=rt._originToDirectedEdges,n._pentagonCount=rt._pentagonCount,n._polygonToCells=rt._polygonToCells,n._readInt64AsDoubleFromPointer=rt._readInt64AsDoubleFromPointer,n._res0CellCount=rt._res0CellCount,n._round=rt._round,n._sbrk=rt._sbrk,n._sizeOfCellBoundary=rt._sizeOfCellBoundary,n._sizeOfCoordIJ=rt._sizeOfCoordIJ,n._sizeOfGeoLoop=rt._sizeOfGeoLoop,n._sizeOfGeoPolygon=rt._sizeOfGeoPolygon,n._sizeOfH3Index=rt._sizeOfH3Index,n._sizeOfLatLng=rt._sizeOfLatLng,n._sizeOfLinkedGeoPolygon=rt._sizeOfLinkedGeoPolygon,n._uncompactCells=rt._uncompactCells,n._uncompactCellsSize=rt._uncompactCellsSize,n._vertexToLatLng=rt._vertexToLatLng,n.establishStackSpace=rt.establishStackSpace;var at,ot,lt=n.stackAlloc=rt.stackAlloc,ut=n.stackRestore=rt.stackRestore,ht=n.stackSave=rt.stackSave;if(n.asm=rt,n.cwrap=function(t,e,n,i){var r=(n=n||[]).every((function(t){return"number"===t}));return"string"!==e&&r&&!i?_(t):function(){return x(t,e,n,arguments)}},n.setValue=function(t,e,n,i){switch("*"===(n=n||"i8").charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":S[t|0]=e;break;case"i16":w[t>>1]=e;break;case"i32":T[t>>2]=e;break;case"i64":W=[e>>>0,(j=e,+k(j)>=1?j>0?(0|G(+q(j/4294967296),4294967295))>>>0:~~+z((j-+(~~j>>>0))/4294967296)>>>0:0)],T[t>>2]=W[0],T[t+4>>2]=W[1];break;case"float":E[t>>2]=e;break;case"double":C[t>>3]=e;break;default:gt("invalid type for setValue: "+n)}},n.getValue=function(t,e,n){switch("*"===(e=e||"i8").charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":return S[t|0];case"i16":return w[t>>1];case"i32":case"i64":return T[t>>2];case"float":return E[t>>2];case"double":return C[t>>3];default:gt("invalid type for getValue: "+e)}return null},X)if(Q(X)||(at=X,X=n.locateFile?n.locateFile(at,p):p+at),a||l){var ct=c(X);M.set(ct,8)}else{V++,n.monitorRunDependencies&&n.monitorRunDependencies(V);var At=function(t){t.byteLength&&(t=new Uint8Array(t)),M.set(t,8),n.memoryInitializerRequest&&delete n.memoryInitializerRequest.response,function(){if(V--,n.monitorRunDependencies&&n.monitorRunDependencies(V),0==V&&H){var t=H;H=null,t()}}()},dt=function(){h(X,At,(function(){throw"could not load memory initializer "+X}))},pt=it(X);if(pt)At(pt.buffer);else if(n.memoryInitializerRequest){var ft=function(){var t=n.memoryInitializerRequest,e=t.response;if(200!==t.status&&0!==t.status){var i=it(n.memoryInitializerRequestURL);if(!i)return console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+t.status+", retrying "+X),void dt();e=i.buffer}At(e)};n.memoryInitializerRequest.response?setTimeout(ft,0):n.memoryInitializerRequest.addEventListener("load",ft)}else dt()}function mt(t){function e(){ot||(ot=!0,y||(L(U),L(O),n.onRuntimeInitialized&&n.onRuntimeInitialized(),function(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),F.unshift(t);var t;L(F)}()))}V>0||(!function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),B.unshift(t);var t;L(B)}(),V>0||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),e()}),1)):e()))}function gt(t){throw n.onAbort&&n.onAbort(t),f(t+=""),m(t),y=!0,"abort("+t+"). Build with -s ASSERTIONS=1 for more info."}if(H=function t(){ot||mt(),ot||(H=t)},n.run=mt,n.abort=gt,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return mt(),t}("object"==typeof Rg?Rg:{}),Ng="number",Pg={0:"Success",1:"The operation failed but a more specific error is not available",2:"Argument was outside of acceptable range",3:"Latitude or longitude arguments were outside of acceptable range",4:"Resolution argument was outside of acceptable range",5:"Cell argument was not valid",6:"Directed edge argument was not valid",7:"Undirected edge argument was not valid",8:"Vertex argument was not valid",9:"Pentagon distortion was encountered",10:"Duplicate input",11:"Cell arguments were not neighbors",12:"Cell arguments had incompatible resolutions",13:"Memory allocation failed",14:"Bounds of provided memory were insufficient",15:"Mode or flags argument was not valid"},Dg={1e3:"Unknown unit",1001:"Array length out of bounds",1002:"Got unexpected null value for H3 index"}; 5 mf.readability=function(e,t){var n=mf(e),r=mf(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},mf.isReadable=function(e,t,n){var r,i,s=mf.readability(e,t);switch(i=!1,(r=function(e){var t,n;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==n&&"large"!==n&&(n="small");return{level:t,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":i=s>=4.5;break;case"AAlarge":i=s>=3;break;case"AAAsmall":i=s>=7}return i},mf.mostReadable=function(e,t,n){var r,i,s,a,o=null,l=0;i=(n=n||{}).includeFallbackColors,s=n.level,a=n.size;for(var u=0;u<t.length;u++)(r=mf.readability(e,t[u]))>l&&(l=r,o=mf(t[u]));return mf.isReadable(e,o,{level:s,size:a})||!i?o:(n.includeFallbackColors=!1,mf.mostReadable(e,["#fff","#000"],n))};var Lf=mf.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},If=mf.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(Lf);function Uf(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Bf(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function Of(e){return Math.min(1,Math.max(0,e))}function Ff(e){return parseInt(e,16)}function kf(e){return 1==e.length?"0"+e:""+e}function qf(e){return e<=1&&(e=100*e+"%"),e}function Gf(e){return Math.round(255*parseFloat(e)).toString(16)}function zf(e){return Ff(e)/255}var Vf,Hf,jf,Wf=(Hf="[\\s|\\(]+("+(Vf="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+Vf+")[,|\\s]+("+Vf+")\\s*\\)?",jf="[\\s|\\(]+("+Vf+")[,|\\s]+("+Vf+")[,|\\s]+("+Vf+")[,|\\s]+("+Vf+")\\s*\\)?",{CSS_UNIT:new RegExp(Vf),rgb:new RegExp("rgb"+Hf),rgba:new RegExp("rgba"+jf),hsl:new RegExp("hsl"+Hf),hsla:new RegExp("hsla"+jf),hsv:new RegExp("hsv"+Hf),hsva:new RegExp("hsva"+jf),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function Xf(e){return!!Wf.CSS_UNIT.exec(e)}function Qf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Yf(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function $f(e,t){return e.get(Yf(e,t))}function Kf(e,t,n){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}function Zf(e,t,n){return e.set(Yf(e,t),n),n}function Jf(e,t,n){return function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,nm(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function em(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,0===t);else for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}(e,t)||rm(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tm(e){return function(e){if(Array.isArray(e))return Qf(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||rm(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nm(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function rm(e,t){if(e){if("string"==typeof e)return Qf(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qf(e,t):void 0}}var im=new WeakMap,sm=new WeakMap,am=new WeakMap,om=new WeakMap,lm=new WeakMap,um=new WeakMap,cm=function(){return Jf((function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Kf(this,im,new Map),Kf(this,sm,new Map),Kf(this,am,(function(e){return e})),Kf(this,om,(function(){return{}})),Kf(this,lm,(function(){})),Kf(this,um,(function(){}))}),[{key:"getObj",value:function(e){return $f(im,this).get($f(am,this).call(this,e))}},{key:"getData",value:function(e){return $f(sm,this).get(e)}},{key:"entries",value:function(){return tm($f(sm,this).entries()).map((function(e){var t=em(e,2),n=t[0];return[t[1],n]}))}},{key:"id",value:function(e){return Zf(am,this,Pp(e)),this}},{key:"onCreateObj",value:function(e){return Zf(om,this,e),this}},{key:"onUpdateObj",value:function(e){return Zf(lm,this,e),this}},{key:"onRemoveObj",value:function(e){return Zf(um,this,e),this}},{key:"digest",value:function(e){var t=this;e.filter((function(e){return!$f(im,t).has($f(am,t).call(t,e))})).forEach((function(e){var n=$f(om,t).call(t,e);$f(im,t).set($f(am,t).call(t,e),n),$f(sm,t).set(n,e)}));var n=new Map(e.map((function(e){return[$f(am,t).call(t,e),e]})));return $f(im,this).forEach((function(e,r){n.has(r)?$f(lm,t).call(t,e,n.get(r)):($f(um,t).call(t,e,r),$f(im,t).delete(r),$f(sm,t).delete(e))})),this}},{key:"clear",value:function(){return this.digest([]),this}}])}();function Am(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hm,dm={exports:{}};var pm=(hm||(hm=1,function(e){e.exports=function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){var r=n(1),i=function(){function e(e,t,n){void 0===e&&(e=NaN),void 0===t&&(t=NaN),void 0===n&&(n=!1),this._minFPS=t,this._maxFPS=e,this._timeScale=1,this._currentTick=0,this._currentTime=0,this._tickDeltaTime=0,this._isRunning=!1,this._maxInterval=isNaN(this._minFPS)?NaN:1e3/this._minFPS,this._minInterval=isNaN(this._maxFPS)?NaN:1e3/this._maxFPS,this._onResume=new r.default,this._onPause=new r.default,this._onTick=new r.default,this._onTickOncePerFrame=new r.default,n||this.resume()}return e.prototype.updateOnce=function(e){e(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick)},e.prototype.resume=function(){this._isRunning||(this._isRunning=!0,this._lastTimeUpdated=this.getTimer(),this._onResume.dispatch(),this.animateOnce())},e.prototype.pause=function(){this._isRunning&&(this._isRunning=!1,this._onPause.dispatch(),window.cancelAnimationFrame(this._animationFrameHandle))},e.prototype.dispose=function(){this.pause(),this._onResume.removeAll(),this._onPause.removeAll(),this._onTick.removeAll()},Object.defineProperty(e.prototype,"currentTick",{get:function(){return this._currentTick},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentTimeSeconds",{get:function(){return this._currentTime/1e3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tickDeltaTimeSeconds",{get:function(){return this._tickDeltaTime/1e3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"timeScale",{get:function(){return this._timeScale},set:function(e){this._timeScale!==e&&(this._timeScale=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onResume",{get:function(){return this._onResume},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onPause",{get:function(){return this._onPause},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onTick",{get:function(){return this._onTick},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onTickOncePerFrame",{get:function(){return this._onTickOncePerFrame},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isRunning",{get:function(){return this._isRunning},enumerable:!0,configurable:!0}),e.prototype.animateOnce=function(){var e=this;this._animationFrameHandle=window.requestAnimationFrame((function(){return e.onFrame()}))},e.prototype.onFrame=function(){if(this._now=this.getTimer(),this._frameDeltaTime=this._now-this._lastTimeUpdated,isNaN(this._minInterval)||this._frameDeltaTime>=this._minInterval)if(isNaN(this._maxInterval))this.update(this._frameDeltaTime*this._timeScale,!0),this._lastTimeUpdated=this._now;else for(this._interval=Math.min(this._frameDeltaTime,this._maxInterval);this._now>=this._lastTimeUpdated+this._interval;)this.update(this._interval*this._timeScale,this._now<=this._lastTimeUpdated+2*this._maxInterval),this._lastTimeUpdated+=this._interval;this._isRunning&&this.animateOnce()},e.prototype.update=function(e,t){void 0===t&&(t=!0),this._currentTick++,this._currentTime+=e,this._tickDeltaTime=e,this._onTick.dispatch(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick),t&&this._onTickOncePerFrame.dispatch(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick)},e.prototype.getTimer=function(){return Date.now()},e}();Object.defineProperty(t,"__esModule",{value:!0}),t.default=i},function(e,t,n){!function(t,n){e.exports=n()}(0,(function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t){var n=function(){function e(){this.functions=[]}return e.prototype.add=function(e){return-1===this.functions.indexOf(e)&&(this.functions.push(e),!0)},e.prototype.remove=function(e){var t=this.functions.indexOf(e);return t>-1&&(this.functions.splice(t,1),!0)},e.prototype.removeAll=function(){return this.functions.length>0&&(this.functions.length=0,!0)},e.prototype.dispatch=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.functions.concat().forEach((function(t){t.apply(void 0,e)}))},Object.defineProperty(e.prototype,"numItems",{get:function(){return this.functions.length},enumerable:!0,configurable:!0}),e}();Object.defineProperty(t,"__esModule",{value:!0}),t.default=n}])}))}])}(dm)),dm.exports),fm=Am(pm);function mm(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}var gm=e=>()=>e;function vm(e){return 1==(e=+e)?_m:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):gm(isNaN(t)?n:t)}}function _m(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):gm(isNaN(e)?t:e)}var ym=function e(t){var n=vm(t);function r(e,t){var r=n((e=Jp(e)).r,(t=Jp(t)).r),i=n(e.g,t.g),s=n(e.b,t.b),a=_m(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=s(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function xm(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(s){for(n=0;n<r;++n)i[n]=e[n]*(1-s)+t[n]*s;return i}}function bm(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Sm(e,t){return(bm(t)?xm:Tm)(e,t)}function Tm(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,s=new Array(i),a=new Array(r);for(n=0;n<i;++n)s[n]=Pm(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<i;++n)a[n]=s[n](e);return a}}function wm(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Mm(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Em(e,t){var n,r={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=Pm(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var Cm=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Rm=new RegExp(Cm.source,"g");function Nm(e,t){var n,r,i,s=Cm.lastIndex=Rm.lastIndex=0,a=-1,o=[],l=[];for(e+="",t+="";(n=Cm.exec(e))&&(r=Rm.exec(t));)(i=r.index)>s&&(i=t.slice(s,i),o[a]?o[a]+=i:o[++a]=i),(n=n[0])===(r=r[0])?o[a]?o[a]+=r:o[++a]=r:(o[++a]=null,l.push({i:a,x:Mm(n,r)})),s=Rm.lastIndex;return s<t.length&&(i=t.slice(s),o[a]?o[a]+=i:o[++a]=i),o.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)o[(n=l[r]).i]=n.x(e);return o.join("")})}function Pm(e,t){var n,r=typeof t;return null==t||"boolean"===r?gm(t):("number"===r?Mm:"string"===r?(n=$p(t))?(t=n,ym):Nm:t instanceof $p?ym:t instanceof Date?wm:bm(t)?xm:Array.isArray(t)?Tm:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Em:Mm)(e,t)}function Dm(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Lm(e){return+e}var Im=[0,1];function Um(e){return e}function Bm(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:(n=isNaN(t)?NaN:.5,function(){return n});var n}function Om(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=Bm(i,r),s=n(a,s)):(r=Bm(r,i),s=n(s,a)),function(e){return s(r(e))}}function Fm(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),s=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=Bm(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(t){var n=lA(e,t,1,r)-1;return s[n](i[n](t))}}function km(){var e,t,n,r,i,s,a=Im,o=Im,l=Pm,u=Um;function c(){var e=Math.min(a.length,o.length);return u!==Um&&(u=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(a[0],a[e-1])),r=e>2?Fm:Om,i=s=null,A}function A(t){return null==t||isNaN(t=+t)?n:(i||(i=r(a.map(e),o,l)))(e(u(t)))}return A.invert=function(n){return u(t((s||(s=r(o,a.map(e),Mm)))(n)))},A.domain=function(e){return arguments.length?(a=Array.from(e,Lm),c()):a.slice()},A.range=function(e){return arguments.length?(o=Array.from(e),c()):o.slice()},A.rangeRound=function(e){return o=Array.from(e),l=Dm,c()},A.clamp=function(e){return arguments.length?(u=!!e||Um,c()):u!==Um},A.interpolate=function(e){return arguments.length?(l=e,c()):l},A.unknown=function(e){return arguments.length?(n=e,A):n},function(n,r){return e=n,t=r,c()}}function qm(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Gm(e){return(e=qm(Math.abs(e)))?e[1]:NaN}var zm,Vm=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Hm(e){if(!(t=Vm.exec(e)))throw new Error("invalid format: "+e);var t;return new jm({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function jm(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function Wm(e,t){var n=qm(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}Hm.prototype=jm.prototype,jm.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Xm={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Wm(100*e,t),r:Wm,s:function(e,t){var n=qm(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(zm=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return s===a?r:s>a?r+new Array(s-a+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+qm(e,Math.max(0,t+s-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Qm(e){return e}var Ym,$m,Km,Zm=Array.prototype.map,Jm=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function eg(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?Qm:(t=Zm.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,s=[],a=0,o=t[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),s.push(e.substring(i-=o,i+o)),!((l+=o+1)>r));)o=t[a=(a+1)%t.length];return s.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",s=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",o=void 0===e.numerals?Qm:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(Zm.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",u=void 0===e.minus?"−":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function A(e){var t=(e=Hm(e)).fill,n=e.align,A=e.sign,h=e.symbol,d=e.zero,p=e.width,f=e.comma,m=e.precision,g=e.trim,v=e.type;"n"===v?(f=!0,v="g"):Xm[v]||(void 0===m&&(m=12),g=!0,v="g"),(d||"0"===t&&"="===n)&&(d=!0,t="0",n="=");var _="$"===h?i:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",y="$"===h?s:/[%p]/.test(v)?l:"",x=Xm[v],b=/[defgprs%]/.test(v);function S(e){var i,s,l,h=_,S=y;if("c"===v)S=x(e)+S,e="";else{var T=(e=+e)<0||1/e<0;if(e=isNaN(e)?c:x(Math.abs(e),m),g&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),T&&0==+e&&"+"!==A&&(T=!1),h=(T?"("===A?A:u:"-"===A||"("===A?"":A)+h,S=("s"===v?Jm[8+zm/3]:"")+S+(T&&"("===A?")":""),b)for(i=-1,s=e.length;++i<s;)if(48>(l=e.charCodeAt(i))||l>57){S=(46===l?a+e.slice(i+1):e.slice(i))+S,e=e.slice(0,i);break}}f&&!d&&(e=r(e,1/0));var w=h.length+e.length+S.length,M=w<p?new Array(p-w+1).join(t):"";switch(f&&d&&(e=r(M+e,M.length?p-S.length:1/0),M=""),n){case"<":e=h+e+S+M;break;case"=":e=h+M+e+S;break;case"^":e=M.slice(0,w=M.length>>1)+h+e+S+M.slice(w);break;default:e=M+h+e+S}return o(e)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),S.toString=function(){return e+""},S}return{format:A,formatPrefix:function(e,t){var n=A(((e=Hm(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(Gm(t)/3))),i=Math.pow(10,-r),s=Jm[8+r/3];return function(e){return n(i*e)+s}}}}function tg(e,t,n,r){var i,s=function(e,t,n){n=+n;const r=(t=+t)<(e=+e),i=r?fA(t,e,n):fA(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}(e,t,n);switch((r=Hm(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Gm(t)/3)))-Gm(Math.abs(e)))}(s,a))||(r.precision=i),Km(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Gm(t)-Gm(e))+1}(s,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-Gm(Math.abs(e)))}(s))||(r.precision=i-2*("%"===r.type))}return $m(r)}function ng(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){if(!((n=+n)>0))return[];if((e=+e)==(t=+t))return[e];const r=t<e,[i,s,a]=r?pA(t,e,n):pA(e,t,n);if(!(s>=i))return[];const o=s-i+1,l=new Array(o);if(r)if(a<0)for(let e=0;e<o;++e)l[e]=(s-e)/-a;else for(let e=0;e<o;++e)l[e]=(s-e)*a;else if(a<0)for(let e=0;e<o;++e)l[e]=(i+e)/-a;else for(let e=0;e<o;++e)l[e]=(i+e)*a;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return tg(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,s=t(),a=0,o=s.length-1,l=s[a],u=s[o],c=10;for(u<l&&(i=l,l=u,u=i,i=a,a=o,o=i);c-- >0;){if((i=fA(l,u,n))===r)return s[a]=l,s[o]=u,t(s);if(i>0)l=Math.floor(l/i)*i,u=Math.ceil(u/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,u=Math.floor(u*i)/i}r=i}return e},e}function rg(){var e=km()(Um,Um);return e.copy=function(){return t=e,rg().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},mm.apply(e,arguments),ng(e)}function ig(){var e,t=0,n=1,r=1,i=[.5],s=[0,1];function a(t){return null!=t&&t<=t?s[lA(i,t,0,r)]:e}function o(){var e=-1;for(i=new Array(r);++e<r;)i[e]=((e+1)*n-(e-r)*t)/(r+1);return a}return a.domain=function(e){return arguments.length?([t,n]=e,t=+t,n=+n,o()):[t,n]},a.range=function(e){return arguments.length?(r=(s=Array.from(e)).length-1,o()):s.slice()},a.invertExtent=function(e){var a=s.indexOf(e);return a<0?[NaN,NaN]:a<1?[t,i[0]]:a>=r?[i[r-1],n]:[i[a-1],i[a]]},a.unknown=function(t){return arguments.length?(e=t,a):a},a.thresholds=function(){return i.slice()},a.copy=function(){return ig().domain([t,n]).range(s).unknown(e)},mm.apply(ng(a),arguments)}Ym=eg({thousands:",",grouping:[3],currency:["$",""]}),$m=Ym.format,Km=Ym.formatPrefix;const sg=134217729;function ag(e,t,n,r,i){let s,a,o,l,u=t[0],c=r[0],A=0,h=0;c>u==c>-u?(s=u,u=t[++A]):(s=c,c=r[++h]);let d=0;if(A<e&&h<n)for(c>u==c>-u?(a=u+s,o=s-(a-u),u=t[++A]):(a=c+s,o=s-(a-c),c=r[++h]),s=a,0!==o&&(i[d++]=o);A<e&&h<n;)c>u==c>-u?(a=s+u,l=a-s,o=s-(a-l)+(u-l),u=t[++A]):(a=s+c,l=a-s,o=s-(a-l)+(c-l),c=r[++h]),s=a,0!==o&&(i[d++]=o);for(;A<e;)a=s+u,l=a-s,o=s-(a-l)+(u-l),u=t[++A],s=a,0!==o&&(i[d++]=o);for(;h<n;)a=s+c,l=a-s,o=s-(a-l)+(c-l),c=r[++h],s=a,0!==o&&(i[d++]=o);return 0===s&&0!==d||(i[d++]=s),d}function og(e){return new Float64Array(e)}const lg=og(4),ug=og(8),cg=og(12),Ag=og(16),hg=og(4);function dg(e,t,n,r,i,s){const a=(t-s)*(n-i),o=(e-i)*(r-s),l=a-o,u=Math.abs(a+o);return Math.abs(l)>=33306690738754716e-32*u?l:-function(e,t,n,r,i,s,a){let o,l,u,c,A,h,d,p,f,m,g,v,_,y,x,b,S,T;const w=e-i,M=n-i,E=t-s,C=r-s;y=w*C,h=sg*w,d=h-(h-w),p=w-d,h=sg*C,f=h-(h-C),m=C-f,x=p*m-(y-d*f-p*f-d*m),b=E*M,h=sg*E,d=h-(h-E),p=E-d,h=sg*M,f=h-(h-M),m=M-f,S=p*m-(b-d*f-p*f-d*m),g=x-S,A=x-g,lg[0]=x-(g+A)+(A-S),v=y+g,A=v-y,_=y-(v-A)+(g-A),g=_-b,A=_-g,lg[1]=_-(g+A)+(A-b),T=v+g,A=T-v,lg[2]=v-(T-A)+(g-A),lg[3]=T;let R=function(e,t){let n=t[0];for(let r=1;r<e;r++)n+=t[r];return n}(4,lg),N=22204460492503146e-32*a;if(R>=N||-R>=N)return R;if(A=e-w,o=e-(w+A)+(A-i),A=n-M,u=n-(M+A)+(A-i),A=t-E,l=t-(E+A)+(A-s),A=r-C,c=r-(C+A)+(A-s),0===o&&0===l&&0===u&&0===c)return R;if(N=11093356479670487e-47*a+33306690738754706e-32*Math.abs(R),R+=w*c+C*o-(E*u+M*l),R>=N||-R>=N)return R;y=o*C,h=sg*o,d=h-(h-o),p=o-d,h=sg*C,f=h-(h-C),m=C-f,x=p*m-(y-d*f-p*f-d*m),b=l*M,h=sg*l,d=h-(h-l),p=l-d,h=sg*M,f=h-(h-M),m=M-f,S=p*m-(b-d*f-p*f-d*m),g=x-S,A=x-g,hg[0]=x-(g+A)+(A-S),v=y+g,A=v-y,_=y-(v-A)+(g-A),g=_-b,A=_-g,hg[1]=_-(g+A)+(A-b),T=v+g,A=T-v,hg[2]=v-(T-A)+(g-A),hg[3]=T;const P=ag(4,lg,4,hg,ug);y=w*c,h=sg*w,d=h-(h-w),p=w-d,h=sg*c,f=h-(h-c),m=c-f,x=p*m-(y-d*f-p*f-d*m),b=E*u,h=sg*E,d=h-(h-E),p=E-d,h=sg*u,f=h-(h-u),m=u-f,S=p*m-(b-d*f-p*f-d*m),g=x-S,A=x-g,hg[0]=x-(g+A)+(A-S),v=y+g,A=v-y,_=y-(v-A)+(g-A),g=_-b,A=_-g,hg[1]=_-(g+A)+(A-b),T=v+g,A=T-v,hg[2]=v-(T-A)+(g-A),hg[3]=T;const D=ag(P,ug,4,hg,cg);y=o*c,h=sg*o,d=h-(h-o),p=o-d,h=sg*c,f=h-(h-c),m=c-f,x=p*m-(y-d*f-p*f-d*m),b=l*u,h=sg*l,d=h-(h-l),p=l-d,h=sg*u,f=h-(h-u),m=u-f,S=p*m-(b-d*f-p*f-d*m),g=x-S,A=x-g,hg[0]=x-(g+A)+(A-S),v=y+g,A=v-y,_=y-(v-A)+(g-A),g=_-b,A=_-g,hg[1]=_-(g+A)+(A-b),T=v+g,A=T-v,hg[2]=v-(T-A)+(g-A),hg[3]=T;const L=ag(D,cg,4,hg,Ag);return Ag[L-1]}(e,t,n,r,i,s,u)}const pg=Math.pow(2,-52),fg=new Uint32Array(512);class mg{static from(e,t=bg,n=Sg){const r=e.length,i=new Float64Array(2*r);for(let s=0;s<r;s++){const r=e[s];i[2*s]=t(r),i[2*s+1]=n(r)}return new mg(i)}constructor(e){const t=e.length>>1;if(t>0&&"number"!=typeof e[0])throw new Error("Expected coords to contain numbers.");this.coords=e;const n=Math.max(2*t-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(t)),this._hullPrev=new Uint32Array(t),this._hullNext=new Uint32Array(t),this._hullTri=new Uint32Array(t),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(t),this._dists=new Float64Array(t),this.update()}update(){const{coords:e,_hullPrev:t,_hullNext:n,_hullTri:r,_hullHash:i}=this,s=e.length>>1;let a=1/0,o=1/0,l=-1/0,u=-1/0;for(let t=0;t<s;t++){const n=e[2*t],r=e[2*t+1];n<a&&(a=n),r<o&&(o=r),n>l&&(l=n),r>u&&(u=r),this._ids[t]=t}const c=(a+l)/2,A=(o+u)/2;let h,d,p;for(let t=0,n=1/0;t<s;t++){const r=gg(c,A,e[2*t],e[2*t+1]);r<n&&(h=t,n=r)}const f=e[2*h],m=e[2*h+1];for(let t=0,n=1/0;t<s;t++){if(t===h)continue;const r=gg(f,m,e[2*t],e[2*t+1]);r<n&&r>0&&(d=t,n=r)}let g=e[2*d],v=e[2*d+1],_=1/0;for(let t=0;t<s;t++){if(t===h||t===d)continue;const n=_g(f,m,g,v,e[2*t],e[2*t+1]);n<_&&(p=t,_=n)}let y=e[2*p],x=e[2*p+1];if(_===1/0){for(let t=0;t<s;t++)this._dists[t]=e[2*t]-e[0]||e[2*t+1]-e[1];yg(this._ids,this._dists,0,s-1);const t=new Uint32Array(s);let n=0;for(let e=0,r=-1/0;e<s;e++){const i=this._ids[e],s=this._dists[i];s>r&&(t[n++]=i,r=s)}return this.hull=t.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(dg(f,m,g,v,y,x)<0){const e=d,t=g,n=v;d=p,g=y,v=x,p=e,y=t,x=n}const b=function(e,t,n,r,i,s){const a=n-e,o=r-t,l=i-e,u=s-t,c=a*a+o*o,A=l*l+u*u,h=.5/(a*u-o*l);return{x:e+(u*c-o*A)*h,y:t+(a*A-l*c)*h}}(f,m,g,v,y,x);this._cx=b.x,this._cy=b.y;for(let t=0;t<s;t++)this._dists[t]=gg(e[2*t],e[2*t+1],b.x,b.y);yg(this._ids,this._dists,0,s-1),this._hullStart=h;let S=3;n[h]=t[p]=d,n[d]=t[h]=p,n[p]=t[d]=h,r[h]=0,r[d]=1,r[p]=2,i.fill(-1),i[this._hashKey(f,m)]=h,i[this._hashKey(g,v)]=d,i[this._hashKey(y,x)]=p,this.trianglesLen=0,this._addTriangle(h,d,p,-1,-1,-1);for(let s,a,o=0;o<this._ids.length;o++){const l=this._ids[o],u=e[2*l],c=e[2*l+1];if(o>0&&Math.abs(u-s)<=pg&&Math.abs(c-a)<=pg)continue;if(s=u,a=c,l===h||l===d||l===p)continue;let A=0;for(let e=0,t=this._hashKey(u,c);e<this._hashSize&&(A=i[(t+e)%this._hashSize],-1===A||A===n[A]);e++);A=t[A];let f,m=A;for(;f=n[m],dg(u,c,e[2*m],e[2*m+1],e[2*f],e[2*f+1])>=0;)if(m=f,m===A){m=-1;break}if(-1===m)continue;let g=this._addTriangle(m,l,n[m],-1,-1,r[m]);r[l]=this._legalize(g+2),r[m]=g,S++;let v=n[m];for(;f=n[v],dg(u,c,e[2*v],e[2*v+1],e[2*f],e[2*f+1])<0;)g=this._addTriangle(v,l,f,r[l],-1,r[v]),r[l]=this._legalize(g+2),n[v]=v,S--,v=f;if(m===A)for(;f=t[m],dg(u,c,e[2*f],e[2*f+1],e[2*m],e[2*m+1])<0;)g=this._addTriangle(f,l,m,-1,r[m],r[f]),this._legalize(g+2),r[f]=g,n[m]=m,S--,m=f;this._hullStart=t[l]=m,n[m]=t[v]=l,n[l]=v,i[this._hashKey(u,c)]=l,i[this._hashKey(e[2*m],e[2*m+1])]=m}this.hull=new Uint32Array(S);for(let e=0,t=this._hullStart;e<S;e++)this.hull[e]=t,t=n[t];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(e,t){return Math.floor(function(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}(e-this._cx,t-this._cy)*this._hashSize)%this._hashSize}_legalize(e){const{_triangles:t,_halfedges:n,coords:r}=this;let i=0,s=0;for(;;){const a=n[e],o=e-e%3;if(s=o+(e+2)%3,-1===a){if(0===i)break;e=fg[--i];continue}const l=a-a%3,u=o+(e+1)%3,c=l+(a+2)%3,A=t[s],h=t[e],d=t[u],p=t[c];if(vg(r[2*A],r[2*A+1],r[2*h],r[2*h+1],r[2*d],r[2*d+1],r[2*p],r[2*p+1])){t[e]=p,t[a]=A;const r=n[c];if(-1===r){let t=this._hullStart;do{if(this._hullTri[t]===c){this._hullTri[t]=e;break}t=this._hullPrev[t]}while(t!==this._hullStart)}this._link(e,r),this._link(a,n[s]),this._link(s,c);const o=l+(a+1)%3;i<fg.length&&(fg[i++]=o)}else{if(0===i)break;e=fg[--i]}}return s}_link(e,t){this._halfedges[e]=t,-1!==t&&(this._halfedges[t]=e)}_addTriangle(e,t,n,r,i,s){const a=this.trianglesLen;return this._triangles[a]=e,this._triangles[a+1]=t,this._triangles[a+2]=n,this._link(a,r),this._link(a+1,i),this._link(a+2,s),this.trianglesLen+=3,a}}function gg(e,t,n,r){const i=e-n,s=t-r;return i*i+s*s}function vg(e,t,n,r,i,s,a,o){const l=e-a,u=t-o,c=n-a,A=r-o,h=i-a,d=s-o,p=c*c+A*A,f=h*h+d*d;return l*(A*f-p*d)-u*(c*f-p*h)+(l*l+u*u)*(c*d-A*h)<0}function _g(e,t,n,r,i,s){const a=n-e,o=r-t,l=i-e,u=s-t,c=a*a+o*o,A=l*l+u*u,h=.5/(a*u-o*l),d=(u*c-o*A)*h,p=(a*A-l*c)*h;return d*d+p*p}function yg(e,t,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const r=e[i],s=t[r];let a=i-1;for(;a>=n&&t[e[a]]>s;)e[a+1]=e[a--];e[a+1]=r}else{let i=n+1,s=r;xg(e,n+r>>1,i),t[e[n]]>t[e[r]]&&xg(e,n,r),t[e[i]]>t[e[r]]&&xg(e,i,r),t[e[n]]>t[e[i]]&&xg(e,n,i);const a=e[i],o=t[a];for(;;){do{i++}while(t[e[i]]<o);do{s--}while(t[e[s]]>o);if(s<i)break;xg(e,i,s)}e[n+1]=e[s],e[s]=a,r-i+1>=s-n?(yg(e,t,i,r),yg(e,t,n,s-1)):(yg(e,t,n,s-1),yg(e,t,i,r))}}function xg(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function bg(e){return e[0]}function Sg(e){return e[1]}function Tg(e,t){var n,r,i,s,a,o,l,u,c,A=0,h=e[0],d=e[1],p=t.length;for(n=0;n<p;n++){r=0;var f=t[n],m=f.length-1;if((u=f[0])[0]!==f[m][0]&&u[1]!==f[m][1])throw new Error("First and last coordinates in a ring must be the same");for(s=u[0]-h,a=u[1]-d;r<m;r++){if(o=(c=f[r+1])[0]-h,l=c[1]-d,0===a&&0===l){if(o<=0&&s>=0||s<=0&&o>=0)return 0}else if(l>=0&&a<=0||l<=0&&a>=0){if(0===(i=dg(s,o,a,l,0,0)))return 0;(i>0&&l>0&&a<=0||i<0&&l<=0&&a>0)&&A++}u=c,a=l,s=o}}return A%2!=0}var wg=function(e,t,n={}){if(!e)throw new Error("point is required");if(!t)throw new Error("polygon is required");const r=function(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return[...e.geometry.coordinates];if("Point"===e.type)return[...e.coordinates]}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return[...e];throw new Error("coord must be GeoJSON Point or an Array of numbers")}(e),i="Feature"===(s=t).type?s.geometry:s;var s;const a=i.type,o=t.bbox;let l=i.coordinates;if(o&&!1===function(e,t){return t[0]<=e[0]&&t[1]<=e[1]&&t[2]>=e[0]&&t[3]>=e[1]}(r,o))return!1;"Polygon"===a&&(l=[l]);let u=!1;for(var c=0;c<l.length;++c){const e=Tg(r,l[c]);if(0===e)return!n.ignoreBoundary;e&&(u=!0)}return u};const Mg=1e-6;class Eg{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,t){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,t){this._+=`L${this._x1=+e},${this._y1=+t}`}arc(e,t,n){const r=(e=+e)+(n=+n),i=t=+t;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>Mg||Math.abs(this._y1-i)>Mg)&&(this._+="L"+r+","+i),n&&(this._+=`A${n},${n},0,1,1,${e-n},${t}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(e,t,n,r){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}class Cg{constructor(){this._=[]}moveTo(e,t){this._.push([e,t])}closePath(){this._.push(this._[0].slice())}lineTo(e,t){this._.push([e,t])}value(){return this._.length?this._:null}}class Rg{constructor(e,[t,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(t=+t)&&(i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(2*e.points.length),this.vectors=new Float64Array(2*e.points.length),this.xmax=r,this.xmin=t,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:e,hull:t,triangles:n},vectors:r}=this;let i,s;const a=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let r,o,l=0,u=0,c=n.length;l<c;l+=3,u+=2){const c=2*n[l],A=2*n[l+1],h=2*n[l+2],d=e[c],p=e[c+1],f=e[A],m=e[A+1],g=e[h],v=e[h+1],_=f-d,y=m-p,x=g-d,b=v-p,S=2*(_*b-y*x);if(Math.abs(S)<1e-9){if(void 0===i){i=s=0;for(const n of t)i+=e[2*n],s+=e[2*n+1];i/=t.length,s/=t.length}const n=1e9*Math.sign((i-d)*b-(s-p)*x);r=(d+g)/2-n*b,o=(p+v)/2+n*x}else{const e=1/S,t=_*_+y*y,n=x*x+b*b;r=d+(b*t-y*n)*e,o=p+(_*n-x*t)*e}a[u]=r,a[u+1]=o}let o,l,u,c=t[t.length-1],A=4*c,h=e[2*c],d=e[2*c+1];r.fill(0);for(let n=0;n<t.length;++n)c=t[n],o=A,l=h,u=d,A=4*c,h=e[2*c],d=e[2*c+1],r[o+2]=r[A]=u-d,r[o+3]=r[A+1]=h-l}render(e){const t=null==e?e=new Eg:void 0,{delaunay:{halfedges:n,inedges:r,hull:i},circumcenters:s,vectors:a}=this;if(i.length<=1)return null;for(let t=0,r=n.length;t<r;++t){const r=n[t];if(r<t)continue;const i=2*Math.floor(t/3),a=2*Math.floor(r/3),o=s[i],l=s[i+1],u=s[a],c=s[a+1];this._renderSegment(o,l,u,c,e)}let o,l=i[i.length-1];for(let t=0;t<i.length;++t){o=l,l=i[t];const n=2*Math.floor(r[l]/3),u=s[n],c=s[n+1],A=4*o,h=this._project(u,c,a[A+2],a[A+3]);h&&this._renderSegment(u,c,h[0],h[1],e)}return t&&t.value()}renderBounds(e){const t=null==e?e=new Eg:void 0;return e.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),t&&t.value()}renderCell(e,t){const n=null==t?t=new Eg:void 0,r=this._clip(e);if(null===r||!r.length)return;t.moveTo(r[0],r[1]);let i=r.length;for(;r[0]===r[i-2]&&r[1]===r[i-1]&&i>1;)i-=2;for(let e=2;e<i;e+=2)r[e]===r[e-2]&&r[e+1]===r[e-1]||t.lineTo(r[e],r[e+1]);return t.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:e}}=this;for(let t=0,n=e.length/2;t<n;++t){const e=this.cellPolygon(t);e&&(e.index=t,yield e)}}cellPolygon(e){const t=new Cg;return this.renderCell(e,t),t.value()}_renderSegment(e,t,n,r,i){let s;const a=this._regioncode(e,t),o=this._regioncode(n,r);0===a&&0===o?(i.moveTo(e,t),i.lineTo(n,r)):(s=this._clipSegment(e,t,n,r,a,o))&&(i.moveTo(s[0],s[1]),i.lineTo(s[2],s[3]))}contains(e,t,n){return(t=+t)==t&&(n=+n)==n&&this.delaunay._step(e,t,n)===e}*neighbors(e){const t=this._clip(e);if(t)for(const n of this.delaunay.neighbors(e)){const e=this._clip(n);if(e)e:for(let r=0,i=t.length;r<i;r+=2)for(let s=0,a=e.length;s<a;s+=2)if(t[r]===e[s]&&t[r+1]===e[s+1]&&t[(r+2)%i]===e[(s+a-2)%a]&&t[(r+3)%i]===e[(s+a-1)%a]){yield n;break e}}}_cell(e){const{circumcenters:t,delaunay:{inedges:n,halfedges:r,triangles:i}}=this,s=n[e];if(-1===s)return null;const a=[];let o=s;do{const n=Math.floor(o/3);if(a.push(t[2*n],t[2*n+1]),o=o%3==2?o-2:o+1,i[o]!==e)break;o=r[o]}while(o!==s&&-1!==o);return a}_clip(e){if(0===e&&1===this.delaunay.hull.length)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const t=this._cell(e);if(null===t)return null;const{vectors:n}=this,r=4*e;return this._simplify(n[r]||n[r+1]?this._clipInfinite(e,t,n[r],n[r+1],n[r+2],n[r+3]):this._clipFinite(e,t))}_clipFinite(e,t){const n=t.length;let r,i,s,a,o=null,l=t[n-2],u=t[n-1],c=this._regioncode(l,u),A=0;for(let h=0;h<n;h+=2)if(r=l,i=u,l=t[h],u=t[h+1],s=c,c=this._regioncode(l,u),0===s&&0===c)a=A,A=0,o?o.push(l,u):o=[l,u];else{let t,n,h,d,p;if(0===s){if(null===(t=this._clipSegment(r,i,l,u,s,c)))continue;[n,h,d,p]=t}else{if(null===(t=this._clipSegment(l,u,r,i,c,s)))continue;[d,p,n,h]=t,a=A,A=this._edgecode(n,h),a&&A&&this._edge(e,a,A,o,o.length),o?o.push(n,h):o=[n,h]}a=A,A=this._edgecode(d,p),a&&A&&this._edge(e,a,A,o,o.length),o?o.push(d,p):o=[d,p]}if(o)a=A,A=this._edgecode(o[0],o[1]),a&&A&&this._edge(e,a,A,o,o.length);else if(this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return o}_clipSegment(e,t,n,r,i,s){const a=i<s;for(a&&([e,t,n,r,i,s]=[n,r,e,t,s,i]);;){if(0===i&&0===s)return a?[n,r,e,t]:[e,t,n,r];if(i&s)return null;let o,l,u=i||s;8&u?(o=e+(n-e)*(this.ymax-t)/(r-t),l=this.ymax):4&u?(o=e+(n-e)*(this.ymin-t)/(r-t),l=this.ymin):2&u?(l=t+(r-t)*(this.xmax-e)/(n-e),o=this.xmax):(l=t+(r-t)*(this.xmin-e)/(n-e),o=this.xmin),i?(e=o,t=l,i=this._regioncode(e,t)):(n=o,r=l,s=this._regioncode(n,r))}}_clipInfinite(e,t,n,r,i,s){let a,o=Array.from(t);if((a=this._project(o[0],o[1],n,r))&&o.unshift(a[0],a[1]),(a=this._project(o[o.length-2],o[o.length-1],i,s))&&o.push(a[0],a[1]),o=this._clipFinite(e,o))for(let t,n=0,r=o.length,i=this._edgecode(o[r-2],o[r-1]);n<r;n+=2)t=i,i=this._edgecode(o[n],o[n+1]),t&&i&&(n=this._edge(e,t,i,o,n),r=o.length);else this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(o=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return o}_edge(e,t,n,r,i){for(;t!==n;){let n,s;switch(t){case 5:t=4;continue;case 4:t=6,n=this.xmax,s=this.ymin;break;case 6:t=2;continue;case 2:t=10,n=this.xmax,s=this.ymax;break;case 10:t=8;continue;case 8:t=9,n=this.xmin,s=this.ymax;break;case 9:t=1;continue;case 1:t=5,n=this.xmin,s=this.ymin}r[i]===n&&r[i+1]===s||!this.contains(e,n,s)||(r.splice(i,0,n,s),i+=2)}return i}_project(e,t,n,r){let i,s,a,o=1/0;if(r<0){if(t<=this.ymin)return null;(i=(this.ymin-t)/r)<o&&(a=this.ymin,s=e+(o=i)*n)}else if(r>0){if(t>=this.ymax)return null;(i=(this.ymax-t)/r)<o&&(a=this.ymax,s=e+(o=i)*n)}if(n>0){if(e>=this.xmax)return null;(i=(this.xmax-e)/n)<o&&(s=this.xmax,a=t+(o=i)*r)}else if(n<0){if(e<=this.xmin)return null;(i=(this.xmin-e)/n)<o&&(s=this.xmin,a=t+(o=i)*r)}return[s,a]}_edgecode(e,t){return(e===this.xmin?1:e===this.xmax?2:0)|(t===this.ymin?4:t===this.ymax?8:0)}_regioncode(e,t){return(e<this.xmin?1:e>this.xmax?2:0)|(t<this.ymin?4:t>this.ymax?8:0)}_simplify(e){if(e&&e.length>4){for(let t=0;t<e.length;t+=2){const n=(t+2)%e.length,r=(t+4)%e.length;(e[t]===e[n]&&e[n]===e[r]||e[t+1]===e[n+1]&&e[n+1]===e[r+1])&&(e.splice(n,2),t-=2)}e.length||(e=null)}return e}}const Ng=2*Math.PI,Pg=Math.pow;function Dg(e){return e[0]}function Lg(e){return e[1]}function Ig(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class Ug{static from(e,t=Dg,n=Lg,r){return new Ug("length"in e?function(e,t,n,r){const i=e.length,s=new Float64Array(2*i);for(let a=0;a<i;++a){const i=e[a];s[2*a]=t.call(r,i,a,e),s[2*a+1]=n.call(r,i,a,e)}return s}(e,t,n,r):Float64Array.from(function*(e,t,n,r){let i=0;for(const s of e)yield t.call(r,s,i,e),yield n.call(r,s,i,e),++i}(e,t,n,r)))}constructor(e){this._delaunator=new mg(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const e=this._delaunator,t=this.points;if(e.hull&&e.hull.length>2&&function(e){const{triangles:t,coords:n}=e;for(let e=0;e<t.length;e+=3){const r=2*t[e],i=2*t[e+1],s=2*t[e+2];if((n[s]-n[r])*(n[i+1]-n[r+1])-(n[i]-n[r])*(n[s+1]-n[r+1])>1e-10)return!1}return!0}(e)){this.collinear=Int32Array.from({length:t.length/2},((e,t)=>t)).sort(((e,n)=>t[2*e]-t[2*n]||t[2*e+1]-t[2*n+1]));const e=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[t[2*e],t[2*e+1],t[2*n],t[2*n+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let e=0,n=t.length/2;e<n;++e){const n=Ig(t[2*e],t[2*e+1],i);t[2*e]=n[0],t[2*e+1]=n[1]}this._delaunator=new mg(t)}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,i=this.triangles=this._delaunator.triangles,s=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let e=0,t=n.length;e<t;++e){const t=i[e%3==2?e-2:e+1];-1!==n[e]&&-1!==s[t]||(s[t]=e)}for(let e=0,t=r.length;e<t;++e)a[r[e]]=e;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],s[r[0]]=1,2===r.length&&(s[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(e){return new Rg(this,e)}*neighbors(e){const{inedges:t,hull:n,_hullIndex:r,halfedges:i,triangles:s,collinear:a}=this;if(a){const t=a.indexOf(e);return t>0&&(yield a[t-1]),void(t<a.length-1&&(yield a[t+1]))}const o=t[e];if(-1===o)return;let l=o,u=-1;do{if(yield u=s[l],l=l%3==2?l-2:l+1,s[l]!==e)return;if(l=i[l],-1===l){const t=n[(r[e]+1)%n.length];return void(t!==u&&(yield t))}}while(l!==o)}find(e,t,n=0){if((e=+e)!=e||(t=+t)!=t)return-1;const r=n;let i;for(;(i=this._step(n,e,t))>=0&&i!==n&&i!==r;)n=i;return i}_step(e,t,n){const{inedges:r,hull:i,_hullIndex:s,halfedges:a,triangles:o,points:l}=this;if(-1===r[e]||!l.length)return(e+1)%(l.length>>1);let u=e,c=Pg(t-l[2*e],2)+Pg(n-l[2*e+1],2);const A=r[e];let h=A;do{let r=o[h];const A=Pg(t-l[2*r],2)+Pg(n-l[2*r+1],2);if(A<c&&(c=A,u=r),h=h%3==2?h-2:h+1,o[h]!==e)break;if(h=a[h],-1===h){if(h=i[(s[e]+1)%i.length],h!==r&&Pg(t-l[2*h],2)+Pg(n-l[2*h+1],2)<c)return h;break}}while(h!==A);return u}render(e){const t=null==e?e=new Eg:void 0,{points:n,halfedges:r,triangles:i}=this;for(let t=0,s=r.length;t<s;++t){const s=r[t];if(s<t)continue;const a=2*i[t],o=2*i[s];e.moveTo(n[a],n[a+1]),e.lineTo(n[o],n[o+1])}return this.renderHull(e),t&&t.value()}renderPoints(e,t){void 0!==t||e&&"function"==typeof e.moveTo||(t=e,e=null),t=null==t?2:+t;const n=null==e?e=new Eg:void 0,{points:r}=this;for(let n=0,i=r.length;n<i;n+=2){const i=r[n],s=r[n+1];e.moveTo(i+t,s),e.arc(i,s,t,0,Ng)}return n&&n.value()}renderHull(e){const t=null==e?e=new Eg:void 0,{hull:n,points:r}=this,i=2*n[0],s=n.length;e.moveTo(r[i],r[i+1]);for(let t=1;t<s;++t){const i=2*n[t];e.lineTo(r[i],r[i+1])}return e.closePath(),t&&t.value()}hullPolygon(){const e=new Cg;return this.renderHull(e),e.value()}renderTriangle(e,t){const n=null==t?t=new Eg:void 0,{points:r,triangles:i}=this,s=2*i[e*=3],a=2*i[e+1],o=2*i[e+2];return t.moveTo(r[s],r[s+1]),t.lineTo(r[a],r[a+1]),t.lineTo(r[o],r[o+1]),t.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:e}=this;for(let t=0,n=e.length/3;t<n;++t)yield this.trianglePolygon(t)}trianglePolygon(e){const t=new Cg;return this.renderTriangle(e,t),t.value()}}const Bg=Math.PI,Og=Bg/2,Fg=180/Bg,kg=Bg/180,qg=Math.atan2,Gg=Math.cos,zg=Math.max,Vg=Math.min,Hg=Math.sin,jg=Math.sign||function(e){return e>0?1:e<0?-1:0},Wg=Math.sqrt;function Xg(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Qg(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Yg(e,t){return[e[0]+t[0],e[1]+t[1],e[2]+t[2]]}function $g(e){var t=Wg(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);return[e[0]/t,e[1]/t,e[2]/t]}function Kg(e){return[qg(e[1],e[0])*Fg,(t=zg(-1,Vg(1,e[2])),(t>1?Og:t<-1?-Og:Math.asin(t))*Fg)];var t}function Zg(e){const t=e[0]*kg,n=e[1]*kg,r=Gg(n);return[r*Gg(t),r*Hg(t),Hg(n)]}function Jg(e){return Xg((e=e.map((e=>Zg(e))))[0],Qg(e[2],e[1]))}function ev(e){const t=function(e){if(e.length<2)return{};let t=0;for(;isNaN(e[t][0]+e[t][1])&&t++<e.length;);const n=function(e){function t(t){return(t=e(t[0]*wA,t[1]*wA))[0]*=TA,t[1]*=TA,t}return e=ld(e[0]*wA,e[1]*wA,e.length>2?e[2]*wA:0),t.invert=function(t){return(t=e.invert(t[0]*wA,t[1]*wA))[0]*=TA,t[1]*=TA,t},t}(e[t]),r=dp().translate([0,0]).scale(1).rotate(n.invert([180,0]));e=e.map(r);const i=[];let s=1;for(let t=0,n=e.length;t<n;t++){let n=e[t][0]**2+e[t][1]**2;!isFinite(n)||n>1e32?i.push(t):n>s&&(s=n)}const a=1e6*Wg(s);i.forEach((t=>e[t]=[a,0])),e.push([0,a]),e.push([-a,0]),e.push([0,-a]);const o=Ug.from(e);o.projection=r;const{triangles:l,halfedges:u,inedges:c}=o;for(let n=0,r=u.length;n<r;n++)if(u[n]<0){const e=n%3==2?n-2:n+1,r=n%3==0?n+2:n-1,i=u[e],s=u[r];u[i]=s,u[s]=i,u[e]=u[r]=-1,l[n]=l[e]=l[r]=t,c[l[i]]=i%3==0?i+2:i-1,c[l[s]]=s%3==0?s+2:s-1,n+=2-n%3}else l[n]>e.length-3-1&&(l[n]=t);return o}(e),n=function(e){const{triangles:t}=e;if(!t)return[];const n=[];for(let e=0,r=t.length/3;e<r;e++){const r=t[3*e],i=t[3*e+1],s=t[3*e+2];r!==i&&i!==s&&n.push([r,s,i])}return n}(t),r=function(e,t){const n=new Set;return 2===t.length?[[0,1]]:(e.forEach((e=>{if(e[0]!==e[1]&&!(Jg(e.map((e=>t[e])))<0))for(let t,r=0;r<3;r++)t=(r+1)%3,n.add(uA([e[r],e[t]]).join("-"))})),Array.from(n,(e=>e.split("-").map(Number))))}(n,e),i=function(e,t){const n=[];e.forEach((e=>{for(let t=0;t<3;t++){const r=e[t],i=e[(t+1)%3];n[r]=n[r]||[],n[r].push(i)}})),0===e.length&&(2===t?(n[0]=[1],n[1]=[0]):1===t&&(n[0]=[]));return n}(n,e.length),s=function(e,t){function n(e,t){let n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}return function(r,i,s){void 0===s&&(s=0);let a,o,l=s;const u=Zg([r,i]);do{a=s,s=null,o=n(u,Zg(t[a])),e[a].forEach((e=>{let r=n(u,Zg(t[e]));if(r<o)return o=r,s=e,void(l=e)}))}while(null!==s);return l}}(i,e),a=function(e,t){return e.map((e=>{const n=e.map((e=>t[e])).map(Zg);return Kg($g(Yg(Yg(Qg(n[1],n[0]),Qg(n[2],n[1])),Qg(n[0],n[2]))))}))}(n,e),{polygons:o,centers:l}=function(e,t,n){const r=[],i=e.slice();if(0===t.length){if(n.length<2)return{polygons:r,centers:i};if(2===n.length){const e=Zg(n[0]),t=Zg(n[1]),s=$g(Yg(e,t)),o=$g(Qg(e,t)),l=Qg(s,o),u=[s,Qg(s,l),Qg(Qg(s,l),l),Qg(Qg(Qg(s,l),l),l)].map(Kg).map(a);return r.push(u),r.push(u.slice().reverse()),{polygons:r,centers:i}}}t.forEach(((e,t)=>{for(let n=0;n<3;n++){const i=e[n],s=e[(n+1)%3],a=e[(n+2)%3];r[i]=r[i]||[],r[i].push([s,a,t,[i,s,a]])}}));const s=r.map((e=>{const t=[e[0][2]];let r=e[0][1];for(let n=1;n<e.length;n++)for(let n=0;n<e.length;n++)if(e[n][0]==r){r=e[n][1],t.push(e[n][2]);break}if(t.length>2)return t;if(2==t.length){const r=tv(n[e[0][3][0]],n[e[0][3][1]],i[t[0]]),s=tv(n[e[0][3][2]],n[e[0][3][0]],i[t[0]]),o=a(r),l=a(s);return[t[0],l,t[1],o]}}));function a(e){let n=-1;return i.slice(t.length,1/0).forEach(((r,i)=>{r[0]===e[0]&&r[1]===e[1]&&(n=i+t.length)})),n<0&&(n=i.length,i.push(e)),n}return{polygons:s,centers:i}}(a,n,e),u=function(e){const t=[];return e.forEach((e=>{if(!e)return;let n=e[e.length-1];for(let r of e)r>n&&t.push([n,r]),n=r})),t}(o),c=function(e,t){const n=new Set,r=[];e.map((e=>{if(!(Jg(e.map((e=>t[e>t.length?0:e])))>1e-12))for(let t=0;t<3;t++){let r=[e[t],e[(t+1)%3]],i=`${r[0]}-${r[1]}`;n.has(i)?n.delete(i):n.add(`${r[1]}-${r[0]}`)}}));const i=new Map;let s;if(n.forEach((e=>{e=e.split("-").map(Number),i.set(e[0],e[1]),s=e[0]})),void 0===s)return r;let a=s;do{r.push(a);let e=i.get(a);i.set(a,-1),a=e}while(a>-1&&a!==s);return r}(n,e),A=function(e,t){return function(n){const r=new Map,i=new Map;return e.forEach(((e,t)=>{const s=e.join("-");r.set(s,n[t]),i.set(s,!0)})),t.forEach((e=>{let t=0,n=-1;for(let i=0;i<3;i++){let s=uA([e[i],e[(i+1)%3]]).join("-");r.get(s)>t&&(t=r.get(s),n=s)}i.set(n,!1)})),e.map((e=>i.get(e.join("-"))))}}(r,n);return{delaunay:t,edges:r,triangles:n,centers:l,neighbors:i,polygons:o,mesh:u,hull:c,urquhart:A,find:s}}function tv(e,t,n){e=Zg(e),t=Zg(t),n=Zg(n);const r=jg(Xg(Qg(t,e),n));return Kg($g(Yg(e,t)).map((e=>r*e)))}function nv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function rv(e,t,n){return t=iv(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,sv()?Reflect.construct(t,[],iv(e).constructor):t.apply(e,n))}function iv(e){return iv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},iv(e)}function sv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(sv=function(){return!!e})()}function av(e,t){return av=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},av(e,t)}function ov(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,0===t);else for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}(e,t)||uv(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lv(e){return function(e){if(Array.isArray(e))return nv(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||uv(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uv(e,t){if(e){if("string"==typeof e)return nv(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nv(e,t):void 0}}function cv(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).resolution,n=void 0===t?1/0:t,r=function(e,t){return e.map((function(e){var n,r=[];return e.forEach((function(e){if(n){var i=180*Fd(e,n)/Math.PI;if(i>t)for(var s=$d(n,e),a=1/Math.ceil(i/t),o=a;o<1;)r.push(s(o)),o+=a}r.push(n=e)})),r}))}(e,n),i=mA(r),s=function(e,t){var n={type:"Polygon",coordinates:e},r=Xh(n),i=ov(r,2),s=ov(i[0],2),a=s[0],o=s[1],l=ov(i[1],2),u=l[0],c=l[1];if(Math.min(Math.abs(u-a),Math.abs(c-o))<t)return[];var A=a>u||c>=89||o<=-89;return function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.minLng,r=t.maxLng,i=t.minLat,s=t.maxLat,a=Math.round(Math.pow(360/e,2)/Math.PI),o=(1+Math.sqrt(5))/2,l=function(e){return e/o*360%360-180},u=function(e){return Math.acos(2*e/a-1)/Math.PI*180-90},c=function(e){return a*(Math.cos((e+90)*Math.PI/180)+1)/2},A=[void 0!==s?Math.ceil(c(s)):0,void 0!==i?Math.floor(c(i)):a-1],h=void 0===n&&void 0===r?function(){return!0}:void 0===n?function(e){return e<=r}:void 0===r?function(e){return e>=n}:r>=n?function(e){return e>=n&&e<=r}:function(e){return e>=n||e<=r},d=[],p=A[0];p<=A[1];p++){var f=l(p);h(f)&&d.push([f,u(p)])}return d}(t,{minLng:a,maxLng:u,minLat:o,maxLat:c}).filter((function(e){return Av(e,n,A)}))}(e,n),a=[].concat(lv(i),lv(s)),o={type:"Polygon",coordinates:e},l=ov(Xh(o),2),u=ov(l[0],2),c=u[0],A=u[1],h=ov(l[1],2),d=h[0],p=h[1],f=c>d||p>=89||A<=-89,m=[];if(f){var g=function(e){const t=function(e){if(t.delaunay=null,t._data=e,"object"==typeof t._data&&"FeatureCollection"===t._data.type&&(t._data=t._data.features),"object"==typeof t._data){const e=t._data.map((e=>[t._vx(e),t._vy(e),e])).filter((e=>isFinite(e[0]+e[1])));t.points=e.map((e=>[e[0],e[1]])),t.valid=e.map((e=>e[2])),t.delaunay=ev(t.points)}return t};return t._vx=function(e){return"object"==typeof e&&"type"in e?sd(e)[0]:0 in e?e[0]:void 0},t._vy=function(e){return"object"==typeof e&&"type"in e?sd(e)[1]:1 in e?e[1]:void 0},t.x=function(e){return e?(t._vx=e,t):t._vx},t.y=function(e){return e?(t._vy=e,t):t._vy},t.polygons=function(e){if(void 0!==e&&t(e),!t.delaunay)return!1;const n={type:"FeatureCollection",features:[]};return 0===t.valid.length||(t.delaunay.polygons.forEach(((e,r)=>n.features.push({type:"Feature",geometry:e?{type:"Polygon",coordinates:[[...e,e[0]].map((e=>t.delaunay.centers[e]))]}:null,properties:{site:t.valid[r],sitecoordinates:t.points[r],neighbours:t.delaunay.neighbors[r]}}))),1===t.valid.length&&n.features.push({type:"Feature",geometry:{type:"Sphere"},properties:{site:t.valid[0],sitecoordinates:t.points[0],neighbours:[]}})),n},t.triangles=function(e){return void 0!==e&&t(e),!!t.delaunay&&{type:"FeatureCollection",features:t.delaunay.triangles.map(((e,n)=>((e=e.map((e=>t.points[e]))).center=t.delaunay.centers[n],e))).filter((e=>Jg(e)>0)).map((e=>({type:"Feature",properties:{circumcenter:e.center},geometry:{type:"Polygon",coordinates:[[...e,e[0]]]}})))}},t.links=function(e){if(void 0!==e&&t(e),!t.delaunay)return!1;const n=t.delaunay.edges.map((e=>Fd(t.points[e[0]],t.points[e[1]]))),r=t.delaunay.urquhart(n);return{type:"FeatureCollection",features:t.delaunay.edges.map(((e,i)=>({type:"Feature",properties:{source:t.valid[e[0]],target:t.valid[e[1]],length:n[i],urquhart:!!r[i]},geometry:{type:"LineString",coordinates:[t.points[e[0]],t.points[e[1]]]}})))}},t.mesh=function(e){return void 0!==e&&t(e),!!t.delaunay&&{type:"MultiLineString",coordinates:t.delaunay.edges.map((e=>[t.points[e[0]],t.points[e[1]]]))}},t.cellMesh=function(e){if(void 0!==e&&t(e),!t.delaunay)return!1;const{centers:n,polygons:r}=t.delaunay,i=[];for(const e of r)if(e)for(let t=e.length,r=e[t-1],s=e[0],a=0;a<t;r=s,s=e[++a])s>r&&i.push([n[r],n[s]]);return{type:"MultiLineString",coordinates:i}},t._found=void 0,t.find=function(e,n,r){if(t._found=t.delaunay.find(e,n,t._found),!r||Fd([e,n],t.points[t._found])<r)return t._found},t.hull=function(e){void 0!==e&&t(e);const n=t.delaunay.hull,r=t.points;return 0===n.length?null:{type:"Polygon",coordinates:[[...n.map((e=>r[e])),r[n[0]]]]}},t(e)}(a).triangles(),v=new Map(a.map((function(e,t){var n=ov(e,2),r=n[0],i=n[1];return["".concat(r,"-").concat(i),t]})));g.features.forEach((function(e){var t,n=e.geometry.coordinates[0].slice(0,3).reverse(),r=[];if(n.forEach((function(e){var t=ov(e,2),n=t[0],i=t[1],s="".concat(n,"-").concat(i);v.has(s)&&r.push(v.get(s))})),3===r.length){if(r.some((function(e){return e<i.length})))if(!Av(e.properties.circumcenter,o,f))return;(t=m).push.apply(t,r)}}))}else if(s.length)for(var _=mg.from(a),y=function(e){var t,n=[2,1,0].map((function(t){return _.triangles[e+t]})),r=n.map((function(e){return a[e]}));if(n.some((function(e){return e<i.length}))){var s=[0,1].map((function(e){return function(e,t){let n=0,r=0;if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(++n,r+=t);else{let i=-1;for(let s of e)null!=(s=t(s,++i,e))&&(s=+s)>=s&&(++n,r+=s)}if(n)return r/n}(r,(function(t){return t[e]}))}));if(!Av(s,o,f))return 1}(t=m).push.apply(t,lv(n))},x=0,b=_.triangles.length;x<b;x+=3)y(x);else{var S=rA(r),T=S.vertices,w=S.holes;m=Pc(T,void 0===w?[]:w,2)}var M=rg(uA(a,(function(e){return e[0]})),[0,1]),E=rg(uA(a,(function(e){return e[1]})),[0,1]),C=a.map((function(e){var t=ov(e,2),n=t[0],r=t[1];return[M(n),E(r)]}));return{contour:r,triangles:{points:a,indices:m,uvs:C}}}function Av(e,t){return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?function(e,t){return(e&&kd.hasOwnProperty(e.type)?kd[e.type]:Gd)(e,t)}(t,e):wg(e,t)}var hv=window.THREE?window.THREE:{BufferGeometry:Zr,Float32BufferAttribute:Hr},dv=(new hv.BufferGeometry).setAttribute?"setAttribute":"addAttribute",pv=function(e){function t(e,n,r,i,s,a,o){var l;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(l=rv(this,t)).type="ConicPolygonGeometry",l.parameters={polygonGeoJson:e,startHeight:n,endHeight:r,closedBottom:i,closedTop:s,includeSides:a,curvatureResolution:o},n=n||0,r=r||1,i=void 0===i||i,s=void 0===s||s,a=void 0===a||a;var u=cv(e,{resolution:o=o||5}),c=u.contour,A=u.triangles,h=mA(A.uvs),d=[],p=[],f=[],m=0,g=function(e){var t=Math.round(d.length/3),n=f.length;d=d.concat(e.vertices),p=p.concat(e.uvs),f=f.concat(t?e.indices.map((function(e){return e+t})):e.indices),l.addGroup(n,f.length-n,m++)};function v(e,t){var n=e.map((function(e){return e.map((function(e){var n=ov(e,2),r=n[0];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(90-e)*Math.PI/180,i=(90-t)*Math.PI/180;return[n*Math.sin(r)*Math.cos(i),n*Math.cos(r),n*Math.sin(r)*Math.sin(i)]}(n[1],r,t)}))}));return rA(n)}function _(e){return{indices:!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?A.indices:A.indices.slice().reverse(),vertices:v([A.points],e).vertices,uvs:h}}return a&&g(function(){for(var e=v(c,n),t=e.vertices,i=e.holes,s=v(c,r).vertices,a=mA([s,t]),o=Math.round(s.length/3),l=new Set(i),u=0,A=[],h=0;h<o;h++){var d=h+1;if(d===o)d=u;else if(l.has(d)){var p=d;d=u,u=p}A.push(h,h+o,d+o),A.push(d+o,d,h)}for(var f=[],m=1;m>=0;m--)for(var g=0;g<o;g+=1)f.push(g/(o-1),m);return{indices:A,vertices:a,uvs:f}}()),i&&g(_(n,!1)),s&&g(_(r,!0)),l.setIndex(f),l[dv]("position",new hv.Float32BufferAttribute(d,3)),l[dv]("uv",new hv.Float32BufferAttribute(p,2)),l.computeVertexNormals(),l}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&av(e,t)}(t,e),n=t,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(hv.BufferGeometry);function fv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function mv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,0===t);else for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}(e,t)||_v(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gv(e){return function(e){if(Array.isArray(e))return fv(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||_v(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vv(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function _v(e,t){if(e){if("string"==typeof e)return fv(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fv(e,t):void 0}}var yv=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=(t instanceof Array?t.length?t:[void 0]:[t]).map((function(e){return{keyAccessor:e,isProp:!(e instanceof Function)}})),s=e.reduce((function(e,t){var r=e,s=t;return i.forEach((function(e,t){var a,o=e.keyAccessor;if(e.isProp){var l=s,u=l[o],c=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(l,[o].map(vv));a=u,s=c}else a=o(s,t);t+1<i.length?(r.hasOwnProperty(a)||(r[a]={}),r=r[a]):n?(r.hasOwnProperty(a)||(r[a]=[]),r[a].push(s)):r[a]=s})),e}),{});n instanceof Function&&function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;r===i.length?Object.keys(t).forEach((function(e){return t[e]=n(t[e])})):Object.values(t).forEach((function(t){return e(t,r+1)}))}(s);var a=s;return r&&(a=[],function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];n.length===i.length?a.push({keys:n,vals:t}):Object.entries(t).forEach((function(t){var r=mv(t,2),i=r[0],s=r[1];return e(s,[].concat(gv(n),[i]))}))}(s),t instanceof Array&&0===t.length&&1===a.length&&(a[0].keys=[])),a},xv=function(e){var t,n=void 0!==(e=e||{})?e:{},r={};for(t in n)n.hasOwnProperty(t)&&(r[t]=n[t]);var i,s,a,o,l;i="object"==typeof window,s="function"==typeof importScripts,o="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,a=o&&!i&&!s,l=!i&&!a&&!s;var u,c,A,h,d,p="";a?(p=__dirname+"/",u=function(e,t){var n;return(n=re(e))||(h||(h=require("fs")),d||(d=require("path")),e=d.normalize(e),n=h.readFileSync(e)),t?n:n.toString()},A=function(e){var t=u(e,!0);return t.buffer||(t=new Uint8Array(t)),_(t.buffer),t},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),n.inspect=function(){return"[Emscripten Module object]"}):l?("undefined"!=typeof read&&(u=function(e){var t=re(e);return t?te(t):read(e)}),A=function(e){var t;return(t=re(e))?t:"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(_("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs&&scriptArgs,"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(i||s)&&(s?p=self.location.href:"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),p=0!==p.indexOf("blob:")?p.substr(0,p.lastIndexOf("/")+1):"",u=function(e){try{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText}catch(t){var n=re(e);if(n)return te(n);throw t}},s&&(A=function(e){try{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}catch(t){var n=re(e);if(n)return n;throw t}}),c=function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){if(200==r.status||0==r.status&&r.response)t(r.response);else{var i=re(e);i?t(i.buffer):n()}},r.onerror=n,r.send(null)});var f=n.print||console.log.bind(console),m=n.printErr||console.warn.bind(console);for(t in r)r.hasOwnProperty(t)&&(n[t]=r[t]);r=null,n.arguments&&n.arguments,n.thisProgram&&n.thisProgram;var g=0;var v=!1;function _(e,t){e||ge("Assertion failed: "+t)}function y(e){var t=n["_"+e];return _(t,"Cannot call unknown function "+e+", make sure it is exported"),t}function x(e,t,n,r,i){var s={string:function(e){var t=0;if(null!=e&&0!==e){var n=1+(e.length<<2);(function(e,t,n){(function(e,t,n,r){if(!(r>0))return 0;for(var i=n,s=n+r-1,a=0;a<e.length;++a){var o=e.charCodeAt(a);if(o>=55296&&o<=57343)o=65536+((1023&o)<<10)|1023&e.charCodeAt(++a);if(o<=127){if(n>=s)break;t[n++]=o}else if(o<=2047){if(n+1>=s)break;t[n++]=192|o>>6,t[n++]=128|63&o}else if(o<=65535){if(n+2>=s)break;t[n++]=224|o>>12,t[n++]=128|o>>6&63,t[n++]=128|63&o}else{if(n+3>=s)break;t[n++]=240|o>>18,t[n++]=128|o>>12&63,t[n++]=128|o>>6&63,t[n++]=128|63&o}}t[n]=0})(e,T,t,n)})(e,t=le(n),n)}return t},array:function(e){var t=le(e.length);return function(e,t){S.set(e,t)}(e,t),t}};var a=y(e),o=[],l=0;if(r)for(var u=0;u<r.length;u++){var c=s[n[u]];c?(0===l&&(l=ce()),o[u]=c(r[u])):o[u]=r[u]}var A=a.apply(null,o);return A=function(e){return"string"===t?N(e):"boolean"===t?Boolean(e):e}(A),0!==l&&ue(l),A}var b,S,T,w,M,E,C,R="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function N(e,t){return e?function(e,t,n){for(var r=t+n,i=t;e[i]&&!(i>=r);)++i;if(i-t>16&&e.subarray&&R)return R.decode(e.subarray(t,i));for(var s="";t<i;){var a=e[t++];if(128&a){var o=63&e[t++];if(192!=(224&a)){var l=63&e[t++];if((a=224==(240&a)?(15&a)<<12|o<<6|l:(7&a)<<18|o<<12|l<<6|63&e[t++])<65536)s+=String.fromCharCode(a);else{var u=a-65536;s+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else s+=String.fromCharCode((31&a)<<6|o)}else s+=String.fromCharCode(a)}return s}(T,e,t):""}function P(e,t){return e%t>0&&(e+=t-e%t),e}function D(e){b=e,n.HEAP8=S=new Int8Array(e),n.HEAP16=w=new Int16Array(e),n.HEAP32=M=new Int32Array(e),n.HEAPU8=T=new Uint8Array(e),n.HEAPU16=new Uint16Array(e),n.HEAPU32=new Uint32Array(e),n.HEAPF32=E=new Float32Array(e),n.HEAPF64=C=new Float64Array(e)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var L=n.TOTAL_MEMORY||33554432;function I(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var r=t.func;"number"==typeof r?void 0===t.arg?n.dynCall_v(r):n.dynCall_vi(r,t.arg):r(void 0===t.arg?null:t.arg)}else t()}}L=(b=n.buffer?n.buffer:new ArrayBuffer(L)).byteLength,D(b),M[6032]=5267040;var U=[],B=[],O=[],F=[];var k=Math.abs,q=Math.ceil,G=Math.floor,z=Math.min,V=0,H=null;n.preloadedImages={},n.preloadedAudios={};var j,W,X=null,Q="data:application/octet-stream;base64,";function Y(e){return String.prototype.startsWith?e.startsWith(Q):0===e.indexOf(Q)}X="data:application/octet-stream;base64,AAAAAAAAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAAAQAAAAQAAAADAAAABgAAAAUAAAACAAAAAAAAAAIAAAADAAAAAQAAAAQAAAAGAAAAAAAAAAUAAAADAAAABgAAAAQAAAAFAAAAAAAAAAEAAAACAAAABAAAAAUAAAAGAAAAAAAAAAIAAAADAAAAAQAAAAUAAAACAAAAAAAAAAEAAAADAAAABgAAAAQAAAAGAAAAAAAAAAUAAAACAAAAAQAAAAQAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAAAAAAEAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAYAAAAAAAAABQAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAYAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAAYAAAAAAAAAAwAAAAIAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAFAAAABAAAAAAAAAABAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAYAAAAAAAAABAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAgAAAAQAAAADAAAACAAAAAEAAAAHAAAABgAAAAkAAAAAAAAAAwAAAAIAAAACAAAABgAAAAoAAAALAAAAAAAAAAEAAAAFAAAAAwAAAA0AAAABAAAABwAAAAQAAAAMAAAAAAAAAAQAAAB/AAAADwAAAAgAAAADAAAAAAAAAAwAAAAFAAAAAgAAABIAAAAKAAAACAAAAAAAAAAQAAAABgAAAA4AAAALAAAAEQAAAAEAAAAJAAAAAgAAAAcAAAAVAAAACQAAABMAAAADAAAADQAAAAEAAAAIAAAABQAAABYAAAAQAAAABAAAAAAAAAAPAAAACQAAABMAAAAOAAAAFAAAAAEAAAAHAAAABgAAAAoAAAALAAAAGAAAABcAAAAFAAAAAgAAABIAAAALAAAAEQAAABcAAAAZAAAAAgAAAAYAAAAKAAAADAAAABwAAAANAAAAGgAAAAQAAAAPAAAAAwAAAA0AAAAaAAAAFQAAAB0AAAADAAAADAAAAAcAAAAOAAAAfwAAABEAAAAbAAAACQAAABQAAAAGAAAADwAAABYAAAAcAAAAHwAAAAQAAAAIAAAADAAAABAAAAASAAAAIQAAAB4AAAAIAAAABQAAABYAAAARAAAACwAAAA4AAAAGAAAAIwAAABkAAAAbAAAAEgAAABgAAAAeAAAAIAAAAAUAAAAKAAAAEAAAABMAAAAiAAAAFAAAACQAAAAHAAAAFQAAAAkAAAAUAAAADgAAABMAAAAJAAAAKAAAABsAAAAkAAAAFQAAACYAAAATAAAAIgAAAA0AAAAdAAAABwAAABYAAAAQAAAAKQAAACEAAAAPAAAACAAAAB8AAAAXAAAAGAAAAAsAAAAKAAAAJwAAACUAAAAZAAAAGAAAAH8AAAAgAAAAJQAAAAoAAAAXAAAAEgAAABkAAAAXAAAAEQAAAAsAAAAtAAAAJwAAACMAAAAaAAAAKgAAAB0AAAArAAAADAAAABwAAAANAAAAGwAAACgAAAAjAAAALgAAAA4AAAAUAAAAEQAAABwAAAAfAAAAKgAAACwAAAAMAAAADwAAABoAAAAdAAAAKwAAACYAAAAvAAAADQAAABoAAAAVAAAAHgAAACAAAAAwAAAAMgAAABAAAAASAAAAIQAAAB8AAAApAAAALAAAADUAAAAPAAAAFgAAABwAAAAgAAAAHgAAABgAAAASAAAANAAAADIAAAAlAAAAIQAAAB4AAAAxAAAAMAAAABYAAAAQAAAAKQAAACIAAAATAAAAJgAAABUAAAA2AAAAJAAAADMAAAAjAAAALgAAAC0AAAA4AAAAEQAAABsAAAAZAAAAJAAAABQAAAAiAAAAEwAAADcAAAAoAAAANgAAACUAAAAnAAAANAAAADkAAAAYAAAAFwAAACAAAAAmAAAAfwAAACIAAAAzAAAAHQAAAC8AAAAVAAAAJwAAACUAAAAZAAAAFwAAADsAAAA5AAAALQAAACgAAAAbAAAAJAAAABQAAAA8AAAALgAAADcAAAApAAAAMQAAADUAAAA9AAAAFgAAACEAAAAfAAAAKgAAADoAAAArAAAAPgAAABwAAAAsAAAAGgAAACsAAAA+AAAALwAAAEAAAAAaAAAAKgAAAB0AAAAsAAAANQAAADoAAABBAAAAHAAAAB8AAAAqAAAALQAAACcAAAAjAAAAGQAAAD8AAAA7AAAAOAAAAC4AAAA8AAAAOAAAAEQAAAAbAAAAKAAAACMAAAAvAAAAJgAAACsAAAAdAAAARQAAADMAAABAAAAAMAAAADEAAAAeAAAAIQAAAEMAAABCAAAAMgAAADEAAAB/AAAAPQAAAEIAAAAhAAAAMAAAACkAAAAyAAAAMAAAACAAAAAeAAAARgAAAEMAAAA0AAAAMwAAAEUAAAA2AAAARwAAACYAAAAvAAAAIgAAADQAAAA5AAAARgAAAEoAAAAgAAAAJQAAADIAAAA1AAAAPQAAAEEAAABLAAAAHwAAACkAAAAsAAAANgAAAEcAAAA3AAAASQAAACIAAAAzAAAAJAAAADcAAAAoAAAANgAAACQAAABIAAAAPAAAAEkAAAA4AAAARAAAAD8AAABNAAAAIwAAAC4AAAAtAAAAOQAAADsAAABKAAAATgAAACUAAAAnAAAANAAAADoAAAB/AAAAPgAAAEwAAAAsAAAAQQAAACoAAAA7AAAAPwAAAE4AAABPAAAAJwAAAC0AAAA5AAAAPAAAAEgAAABEAAAAUAAAACgAAAA3AAAALgAAAD0AAAA1AAAAMQAAACkAAABRAAAASwAAAEIAAAA+AAAAKwAAADoAAAAqAAAAUgAAAEAAAABMAAAAPwAAAH8AAAA4AAAALQAAAE8AAAA7AAAATQAAAEAAAAAvAAAAPgAAACsAAABUAAAARQAAAFIAAABBAAAAOgAAADUAAAAsAAAAVgAAAEwAAABLAAAAQgAAAEMAAABRAAAAVQAAADEAAAAwAAAAPQAAAEMAAABCAAAAMgAAADAAAABXAAAAVQAAAEYAAABEAAAAOAAAADwAAAAuAAAAWgAAAE0AAABQAAAARQAAADMAAABAAAAALwAAAFkAAABHAAAAVAAAAEYAAABDAAAANAAAADIAAABTAAAAVwAAAEoAAABHAAAAWQAAAEkAAABbAAAAMwAAAEUAAAA2AAAASAAAAH8AAABJAAAANwAAAFAAAAA8AAAAWAAAAEkAAABbAAAASAAAAFgAAAA2AAAARwAAADcAAABKAAAATgAAAFMAAABcAAAANAAAADkAAABGAAAASwAAAEEAAAA9AAAANQAAAF4AAABWAAAAUQAAAEwAAABWAAAAUgAAAGAAAAA6AAAAQQAAAD4AAABNAAAAPwAAAEQAAAA4AAAAXQAAAE8AAABaAAAATgAAAEoAAAA7AAAAOQAAAF8AAABcAAAATwAAAE8AAABOAAAAPwAAADsAAABdAAAAXwAAAE0AAABQAAAARAAAAEgAAAA8AAAAYwAAAFoAAABYAAAAUQAAAFUAAABeAAAAZQAAAD0AAABCAAAASwAAAFIAAABgAAAAVAAAAGIAAAA+AAAATAAAAEAAAABTAAAAfwAAAEoAAABGAAAAZAAAAFcAAABcAAAAVAAAAEUAAABSAAAAQAAAAGEAAABZAAAAYgAAAFUAAABXAAAAZQAAAGYAAABCAAAAQwAAAFEAAABWAAAATAAAAEsAAABBAAAAaAAAAGAAAABeAAAAVwAAAFMAAABmAAAAZAAAAEMAAABGAAAAVQAAAFgAAABIAAAAWwAAAEkAAABjAAAAUAAAAGkAAABZAAAAYQAAAFsAAABnAAAARQAAAFQAAABHAAAAWgAAAE0AAABQAAAARAAAAGoAAABdAAAAYwAAAFsAAABJAAAAWQAAAEcAAABpAAAAWAAAAGcAAABcAAAAUwAAAE4AAABKAAAAbAAAAGQAAABfAAAAXQAAAE8AAABaAAAATQAAAG0AAABfAAAAagAAAF4AAABWAAAAUQAAAEsAAABrAAAAaAAAAGUAAABfAAAAXAAAAE8AAABOAAAAbQAAAGwAAABdAAAAYAAAAGgAAABiAAAAbgAAAEwAAABWAAAAUgAAAGEAAAB/AAAAYgAAAFQAAABnAAAAWQAAAG8AAABiAAAAbgAAAGEAAABvAAAAUgAAAGAAAABUAAAAYwAAAFAAAABpAAAAWAAAAGoAAABaAAAAcQAAAGQAAABmAAAAUwAAAFcAAABsAAAAcgAAAFwAAABlAAAAZgAAAGsAAABwAAAAUQAAAFUAAABeAAAAZgAAAGUAAABXAAAAVQAAAHIAAABwAAAAZAAAAGcAAABbAAAAYQAAAFkAAAB0AAAAaQAAAG8AAABoAAAAawAAAG4AAABzAAAAVgAAAF4AAABgAAAAaQAAAFgAAABnAAAAWwAAAHEAAABjAAAAdAAAAGoAAABdAAAAYwAAAFoAAAB1AAAAbQAAAHEAAABrAAAAfwAAAGUAAABeAAAAcwAAAGgAAABwAAAAbAAAAGQAAABfAAAAXAAAAHYAAAByAAAAbQAAAG0AAABsAAAAXQAAAF8AAAB1AAAAdgAAAGoAAABuAAAAYgAAAGgAAABgAAAAdwAAAG8AAABzAAAAbwAAAGEAAABuAAAAYgAAAHQAAABnAAAAdwAAAHAAAABrAAAAZgAAAGUAAAB4AAAAcwAAAHIAAABxAAAAYwAAAHQAAABpAAAAdQAAAGoAAAB5AAAAcgAAAHAAAABkAAAAZgAAAHYAAAB4AAAAbAAAAHMAAABuAAAAawAAAGgAAAB4AAAAdwAAAHAAAAB0AAAAZwAAAHcAAABvAAAAcQAAAGkAAAB5AAAAdQAAAH8AAABtAAAAdgAAAHEAAAB5AAAAagAAAHYAAAB4AAAAbAAAAHIAAAB1AAAAeQAAAG0AAAB3AAAAbwAAAHMAAABuAAAAeQAAAHQAAAB4AAAAeAAAAHMAAAByAAAAcAAAAHkAAAB3AAAAdgAAAHkAAAB0AAAAeAAAAHcAAAB1AAAAcQAAAHYAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAACAAAABQAAAAEAAAAAAAAA/////wEAAAAAAAAAAwAAAAQAAAACAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAUAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABAAAAAUAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAUAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAD//////////wEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAAAAAAAAAAABAAAAAgAAAAYAAAAEAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAAAAAAAAAAAAQAAAAEAAAAFAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAAAAAAAAAAABAAAAAwAAAAcAAAAGAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADgAAAAIAAAAAAAAAAAAAAAEAAAAAAAAACQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAAAAAAAAAAAAAEAAAAEAAAACAAAAAoAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAAAAAAAAAAAAQAAAAsAAAAPAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAIAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAAAAAAAAAAAAQAAAAwAAAAQAAAADAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAAAAAAAAAAABAAAACgAAABMAAAAIAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAAAAAAAAAAAAAEAAAANAAAAEQAAAA0AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAACAAAAAAAAAAAAAAABAAAADgAAABIAAAAPAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAADwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABIAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAAAAAAAAQAAAP//////////EwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAASAAAAAAAAABgAAAAAAAAAIQAAAAAAAAAeAAAAAAAAACAAAAADAAAAMQAAAAEAAAAwAAAAAwAAADIAAAADAAAACAAAAAAAAAAFAAAABQAAAAoAAAAFAAAAFgAAAAAAAAAQAAAAAAAAABIAAAAAAAAAKQAAAAEAAAAhAAAAAAAAAB4AAAAAAAAABAAAAAAAAAAAAAAABQAAAAIAAAAFAAAADwAAAAEAAAAIAAAAAAAAAAUAAAAFAAAAHwAAAAEAAAAWAAAAAAAAABAAAAAAAAAAAgAAAAAAAAAGAAAAAAAAAA4AAAAAAAAACgAAAAAAAAALAAAAAAAAABEAAAADAAAAGAAAAAEAAAAXAAAAAwAAABkAAAADAAAAAAAAAAAAAAABAAAABQAAAAkAAAAFAAAABQAAAAAAAAACAAAAAAAAAAYAAAAAAAAAEgAAAAEAAAAKAAAAAAAAAAsAAAAAAAAABAAAAAEAAAADAAAABQAAAAcAAAAFAAAACAAAAAEAAAAAAAAAAAAAAAEAAAAFAAAAEAAAAAEAAAAFAAAAAAAAAAIAAAAAAAAABwAAAAAAAAAVAAAAAAAAACYAAAAAAAAACQAAAAAAAAATAAAAAAAAACIAAAADAAAADgAAAAEAAAAUAAAAAwAAACQAAAADAAAAAwAAAAAAAAANAAAABQAAAB0AAAAFAAAAAQAAAAAAAAAHAAAAAAAAABUAAAAAAAAABgAAAAEAAAAJAAAAAAAAABMAAAAAAAAABAAAAAIAAAAMAAAABQAAABoAAAAFAAAAAAAAAAEAAAADAAAAAAAAAA0AAAAFAAAAAgAAAAEAAAABAAAAAAAAAAcAAAAAAAAAGgAAAAAAAAAqAAAAAAAAADoAAAAAAAAAHQAAAAAAAAArAAAAAAAAAD4AAAADAAAAJgAAAAEAAAAvAAAAAwAAAEAAAAADAAAADAAAAAAAAAAcAAAABQAAACwAAAAFAAAADQAAAAAAAAAaAAAAAAAAACoAAAAAAAAAFQAAAAEAAAAdAAAAAAAAACsAAAAAAAAABAAAAAMAAAAPAAAABQAAAB8AAAAFAAAAAwAAAAEAAAAMAAAAAAAAABwAAAAFAAAABwAAAAEAAAANAAAAAAAAABoAAAAAAAAAHwAAAAAAAAApAAAAAAAAADEAAAAAAAAALAAAAAAAAAA1AAAAAAAAAD0AAAADAAAAOgAAAAEAAABBAAAAAwAAAEsAAAADAAAADwAAAAAAAAAWAAAABQAAACEAAAAFAAAAHAAAAAAAAAAfAAAAAAAAACkAAAAAAAAAKgAAAAEAAAAsAAAAAAAAADUAAAAAAAAABAAAAAQAAAAIAAAABQAAABAAAAAFAAAADAAAAAEAAAAPAAAAAAAAABYAAAAFAAAAGgAAAAEAAAAcAAAAAAAAAB8AAAAAAAAAMgAAAAAAAAAwAAAAAAAAADEAAAADAAAAIAAAAAAAAAAeAAAAAwAAACEAAAADAAAAGAAAAAMAAAASAAAAAwAAABAAAAADAAAARgAAAAAAAABDAAAAAAAAAEIAAAADAAAANAAAAAMAAAAyAAAAAAAAADAAAAAAAAAAJQAAAAMAAAAgAAAAAAAAAB4AAAADAAAAUwAAAAAAAABXAAAAAwAAAFUAAAADAAAASgAAAAMAAABGAAAAAAAAAEMAAAAAAAAAOQAAAAEAAAA0AAAAAwAAADIAAAAAAAAAGQAAAAAAAAAXAAAAAAAAABgAAAADAAAAEQAAAAAAAAALAAAAAwAAAAoAAAADAAAADgAAAAMAAAAGAAAAAwAAAAIAAAADAAAALQAAAAAAAAAnAAAAAAAAACUAAAADAAAAIwAAAAMAAAAZAAAAAAAAABcAAAAAAAAAGwAAAAMAAAARAAAAAAAAAAsAAAADAAAAPwAAAAAAAAA7AAAAAwAAADkAAAADAAAAOAAAAAMAAAAtAAAAAAAAACcAAAAAAAAALgAAAAMAAAAjAAAAAwAAABkAAAAAAAAAJAAAAAAAAAAUAAAAAAAAAA4AAAADAAAAIgAAAAAAAAATAAAAAwAAAAkAAAADAAAAJgAAAAMAAAAVAAAAAwAAAAcAAAADAAAANwAAAAAAAAAoAAAAAAAAABsAAAADAAAANgAAAAMAAAAkAAAAAAAAABQAAAAAAAAAMwAAAAMAAAAiAAAAAAAAABMAAAADAAAASAAAAAAAAAA8AAAAAwAAAC4AAAADAAAASQAAAAMAAAA3AAAAAAAAACgAAAAAAAAARwAAAAMAAAA2AAAAAwAAACQAAAAAAAAAQAAAAAAAAAAvAAAAAAAAACYAAAADAAAAPgAAAAAAAAArAAAAAwAAAB0AAAADAAAAOgAAAAMAAAAqAAAAAwAAABoAAAADAAAAVAAAAAAAAABFAAAAAAAAADMAAAADAAAAUgAAAAMAAABAAAAAAAAAAC8AAAAAAAAATAAAAAMAAAA+AAAAAAAAACsAAAADAAAAYQAAAAAAAABZAAAAAwAAAEcAAAADAAAAYgAAAAMAAABUAAAAAAAAAEUAAAAAAAAAYAAAAAMAAABSAAAAAwAAAEAAAAAAAAAASwAAAAAAAABBAAAAAAAAADoAAAADAAAAPQAAAAAAAAA1AAAAAwAAACwAAAADAAAAMQAAAAMAAAApAAAAAwAAAB8AAAADAAAAXgAAAAAAAABWAAAAAAAAAEwAAAADAAAAUQAAAAMAAABLAAAAAAAAAEEAAAAAAAAAQgAAAAMAAAA9AAAAAAAAADUAAAADAAAAawAAAAAAAABoAAAAAwAAAGAAAAADAAAAZQAAAAMAAABeAAAAAAAAAFYAAAAAAAAAVQAAAAMAAABRAAAAAwAAAEsAAAAAAAAAOQAAAAAAAAA7AAAAAAAAAD8AAAADAAAASgAAAAAAAABOAAAAAwAAAE8AAAADAAAAUwAAAAMAAABcAAAAAwAAAF8AAAADAAAAJQAAAAAAAAAnAAAAAwAAAC0AAAADAAAANAAAAAAAAAA5AAAAAAAAADsAAAAAAAAARgAAAAMAAABKAAAAAAAAAE4AAAADAAAAGAAAAAAAAAAXAAAAAwAAABkAAAADAAAAIAAAAAMAAAAlAAAAAAAAACcAAAADAAAAMgAAAAMAAAA0AAAAAAAAADkAAAAAAAAALgAAAAAAAAA8AAAAAAAAAEgAAAADAAAAOAAAAAAAAABEAAAAAwAAAFAAAAADAAAAPwAAAAMAAABNAAAAAwAAAFoAAAADAAAAGwAAAAAAAAAoAAAAAwAAADcAAAADAAAAIwAAAAAAAAAuAAAAAAAAADwAAAAAAAAALQAAAAMAAAA4AAAAAAAAAEQAAAADAAAADgAAAAAAAAAUAAAAAwAAACQAAAADAAAAEQAAAAMAAAAbAAAAAAAAACgAAAADAAAAGQAAAAMAAAAjAAAAAAAAAC4AAAAAAAAARwAAAAAAAABZAAAAAAAAAGEAAAADAAAASQAAAAAAAABbAAAAAwAAAGcAAAADAAAASAAAAAMAAABYAAAAAwAAAGkAAAADAAAAMwAAAAAAAABFAAAAAwAAAFQAAAADAAAANgAAAAAAAABHAAAAAAAAAFkAAAAAAAAANwAAAAMAAABJAAAAAAAAAFsAAAADAAAAJgAAAAAAAAAvAAAAAwAAAEAAAAADAAAAIgAAAAMAAAAzAAAAAAAAAEUAAAADAAAAJAAAAAMAAAA2AAAAAAAAAEcAAAAAAAAAYAAAAAAAAABoAAAAAAAAAGsAAAADAAAAYgAAAAAAAABuAAAAAwAAAHMAAAADAAAAYQAAAAMAAABvAAAAAwAAAHcAAAADAAAATAAAAAAAAABWAAAAAwAAAF4AAAADAAAAUgAAAAAAAABgAAAAAAAAAGgAAAAAAAAAVAAAAAMAAABiAAAAAAAAAG4AAAADAAAAOgAAAAAAAABBAAAAAwAAAEsAAAADAAAAPgAAAAMAAABMAAAAAAAAAFYAAAADAAAAQAAAAAMAAABSAAAAAAAAAGAAAAAAAAAAVQAAAAAAAABXAAAAAAAAAFMAAAADAAAAZQAAAAAAAABmAAAAAwAAAGQAAAADAAAAawAAAAMAAABwAAAAAwAAAHIAAAADAAAAQgAAAAAAAABDAAAAAwAAAEYAAAADAAAAUQAAAAAAAABVAAAAAAAAAFcAAAAAAAAAXgAAAAMAAABlAAAAAAAAAGYAAAADAAAAMQAAAAAAAAAwAAAAAwAAADIAAAADAAAAPQAAAAMAAABCAAAAAAAAAEMAAAADAAAASwAAAAMAAABRAAAAAAAAAFUAAAAAAAAAXwAAAAAAAABcAAAAAAAAAFMAAAAAAAAATwAAAAAAAABOAAAAAAAAAEoAAAADAAAAPwAAAAEAAAA7AAAAAwAAADkAAAADAAAAbQAAAAAAAABsAAAAAAAAAGQAAAAFAAAAXQAAAAEAAABfAAAAAAAAAFwAAAAAAAAATQAAAAEAAABPAAAAAAAAAE4AAAAAAAAAdQAAAAQAAAB2AAAABQAAAHIAAAAFAAAAagAAAAEAAABtAAAAAAAAAGwAAAAAAAAAWgAAAAEAAABdAAAAAQAAAF8AAAAAAAAAWgAAAAAAAABNAAAAAAAAAD8AAAAAAAAAUAAAAAAAAABEAAAAAAAAADgAAAADAAAASAAAAAEAAAA8AAAAAwAAAC4AAAADAAAAagAAAAAAAABdAAAAAAAAAE8AAAAFAAAAYwAAAAEAAABaAAAAAAAAAE0AAAAAAAAAWAAAAAEAAABQAAAAAAAAAEQAAAAAAAAAdQAAAAMAAABtAAAABQAAAF8AAAAFAAAAcQAAAAEAAABqAAAAAAAAAF0AAAAAAAAAaQAAAAEAAABjAAAAAQAAAFoAAAAAAAAAaQAAAAAAAABYAAAAAAAAAEgAAAAAAAAAZwAAAAAAAABbAAAAAAAAAEkAAAADAAAAYQAAAAEAAABZAAAAAwAAAEcAAAADAAAAcQAAAAAAAABjAAAAAAAAAFAAAAAFAAAAdAAAAAEAAABpAAAAAAAAAFgAAAAAAAAAbwAAAAEAAABnAAAAAAAAAFsAAAAAAAAAdQAAAAIAAABqAAAABQAAAFoAAAAFAAAAeQAAAAEAAABxAAAAAAAAAGMAAAAAAAAAdwAAAAEAAAB0AAAAAQAAAGkAAAAAAAAAdwAAAAAAAABvAAAAAAAAAGEAAAAAAAAAcwAAAAAAAABuAAAAAAAAAGIAAAADAAAAawAAAAEAAABoAAAAAwAAAGAAAAADAAAAeQAAAAAAAAB0AAAAAAAAAGcAAAAFAAAAeAAAAAEAAAB3AAAAAAAAAG8AAAAAAAAAcAAAAAEAAABzAAAAAAAAAG4AAAAAAAAAdQAAAAEAAABxAAAABQAAAGkAAAAFAAAAdgAAAAEAAAB5AAAAAAAAAHQAAAAAAAAAcgAAAAEAAAB4AAAAAQAAAHcAAAAAAAAAcgAAAAAAAABwAAAAAAAAAGsAAAAAAAAAZAAAAAAAAABmAAAAAAAAAGUAAAADAAAAUwAAAAEAAABXAAAAAwAAAFUAAAADAAAAdgAAAAAAAAB4AAAAAAAAAHMAAAAFAAAAbAAAAAEAAAByAAAAAAAAAHAAAAAAAAAAXAAAAAEAAABkAAAAAAAAAGYAAAAAAAAAdQAAAAAAAAB5AAAABQAAAHcAAAAFAAAAbQAAAAEAAAB2AAAAAAAAAHgAAAAAAAAAXwAAAAEAAABsAAAAAQAAAHIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAGAAAAAgAAAAUAAAABAAAABAAAAAAAAAAAAAAABQAAAAMAAAABAAAABgAAAAQAAAACAAAAAAAAAH6iBfbytuk/Gq6akm/58z/Xrm0Liez0P5doSdOpSwRAWs602ULg8D/dT7Rcbo/1v1N1RQHFNOM/g9Snx7HW3L8HWsP8Q3jfP6VwOLosutk/9rjk1YQcxj+gnmKMsNn6P/HDeuPFY+M/YHwDjqKhB0Ci19/fCVrbP4UxKkDWOP6/pvljWa09tL9wi7wrQXjnv/Z6yLImkM2/3yTlOzY14D+m+WNZrT20PzwKVQnrQwNA9nrIsiaQzT/g40rFrRQFwPa45NWEHMa/kbslHEZq97/xw3rjxWPjv4cLC2SMBci/otff3wla27+rKF5oIAv0P1N1RQHFNOO/iDJPGyWHBUAHWsP8Q3jfvwQf/by16gXAfqIF9vK26b8XrO0Vh0r+v9eubQuJ7PS/BxLrA0ZZ479azrTZQuDwv1MK1EuItPw/yscgV9Z6FkAwHBR2WjQMQJNRzXsQ5vY/GlUHVJYKF0DONuFv2lMNQNCGZ28QJfk/0WUwoIL36D8ggDOMQuATQNqMOeAy/wZAWFYOYM+M2z/LWC4uH3oSQDE+LyTsMgRAkJzhRGWFGEDd4soovCQQQKqk0DJMEP8/rGmNdwOLBUAW2X/9xCbjP4hu3dcqJhNAzuYItRvdB0CgzW3zJW/sPxotm/Y2TxRAQAk9XmdDDEC1Kx9MKgT3P1M+NctcghZAFVqcLlb0C0Bgzd3sB2b2P77mZDPUWhZAFROHJpUGCEDAfma5CxXtPz1DWq/zYxRAmhYY5824F0DOuQKWSbAOQNCMqrvu3fs/L6DR22K2wT9nAAxPBU8RQGiN6mW43AFAZhu25b633D8c1YgmzowSQNM25BRKWARArGS08/lNxD+LFssHwmMRQLC5aNcxBgJABL9HT0WRF0CjCmJmOGEOQHsuaVzMP/s/TWJCaGGwBUCeu1PAPLzjP9nqN9DZOBNAKE4JcydbCkCGtbd1qjPzP8dgm9U8jhVAtPeKTkVwDkCeCLss5l37P401XMPLmBdAFd29VMVQDUBg0yA55h75Pz6odcYLCRdApBM4rBrkAkDyAVWgQxbRP4XDMnK20hFAymLlF7EmzD8GUgo9XBHlP3lbK7T9COc/k+OhPthhy7+YGEpnrOvCPzBFhLs15u4/epbqB6H4uz9IuuLF5svev6lzLKY31es/CaQ0envF5z8ZY0xlUADXv7zaz7HYEuI/CfbK1sn16T8uAQfWwxLWPzKn/YuFN94/5KdbC1AFu793fyCSnlfvPzK2y4doAMY/NRg5t1/X6b/shq4QJaHDP5yNIAKPOeI/vpn7BSE30r/X4YQrO6nrv78Ziv/Thto/DqJ1Y6+y5z9l51NaxFrlv8QlA65HOLS/86dxiEc96z+Hj0+LFjneP6LzBZ8LTc2/DaJ1Y6+y579l51NaxFrlP8QlA65HOLQ/8qdxiEc967+Jj0+LFjnev6LzBZ8LTc0/1qdbC1AFuz93fyCSnlfvvzK2y4doAMa/NRg5t1/X6T/vhq4QJaHDv5yNIAKPOeK/wJn7BSE30j/W4YQrO6nrP78Ziv/Thtq/CaQ0envF578XY0xlUADXP7zaz7HYEuK/CvbK1sn16b8rAQfWwxLWvzKn/YuFN96/zWLlF7EmzL8GUgo9XBHlv3lbK7T9COe/kOOhPthhyz+cGEpnrOvCvzBFhLs15u6/c5bqB6H4u79IuuLF5sveP6lzLKY31eu/AQAAAP////8HAAAA/////zEAAAD/////VwEAAP////9hCQAA/////6dBAAD/////kcsBAP/////3kAwA/////8H2VwAAAAAAAAAAAAAAAAACAAAA/////w4AAAD/////YgAAAP////+uAgAA/////8ISAAD/////ToMAAP////8ilwMA/////+4hGQD/////gu2vAAAAAAAAAAAAAAAAAAAAAAACAAAA//////////8BAAAAAwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////AgAAAP//////////AQAAAAAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD/////////////////////AQAAAP///////////////wIAAAD///////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP///////////////////////////////wIAAAD///////////////8BAAAA/////////////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAABAAAA//////////8CAAAA//////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAAAQAAAP//////////AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAACAAAAAAAAAAIAAAABAAAAAQAAAAIAAAACAAAAAAAAAAUAAAAFAAAAAAAAAAIAAAACAAAAAwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAAEAAAACAAAAAgAAAAIAAAAAAAAABQAAAAYAAAAAAAAAAgAAAAIAAAADAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAAAAAACAAAAAQAAAAMAAAACAAAAAgAAAAAAAAAFAAAABwAAAAAAAAACAAAAAgAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAACAAAAAAAAAAIAAAABAAAABAAAAAIAAAACAAAAAAAAAAUAAAAIAAAAAAAAAAIAAAACAAAAAwAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAIAAAAAAAAAAgAAAAEAAAAAAAAAAgAAAAIAAAAAAAAABQAAAAkAAAAAAAAAAgAAAAIAAAADAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAIAAAAAAAAAAwAAAA4AAAACAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAgAAAAMAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAgAAAAAAAAADAAAACgAAAAIAAAAAAAAAAgAAAAMAAAABAAAAAAAAAAIAAAACAAAAAwAAAAcAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAIAAAACAAAAAAAAAAMAAAALAAAAAgAAAAAAAAACAAAAAwAAAAIAAAAAAAAAAgAAAAIAAAADAAAACAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAgAAAAIAAAAAAAAAAwAAAAwAAAACAAAAAAAAAAIAAAADAAAAAwAAAAAAAAACAAAAAgAAAAMAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAACAAAAAgAAAAAAAAADAAAADQAAAAIAAAAAAAAAAgAAAAMAAAAEAAAAAAAAAAIAAAACAAAAAwAAAAoAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAIAAAACAAAAAAAAAAMAAAAGAAAAAgAAAAAAAAACAAAAAwAAAA8AAAAAAAAAAgAAAAIAAAADAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAIAAAAAAAAAAwAAAAcAAAACAAAAAAAAAAIAAAADAAAAEAAAAAAAAAACAAAAAgAAAAMAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAACAAAAAgAAAAAAAAADAAAACAAAAAIAAAAAAAAAAgAAAAMAAAARAAAAAAAAAAIAAAACAAAAAwAAAA0AAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAACAAAAAAAAAAMAAAAJAAAAAgAAAAAAAAACAAAAAwAAABIAAAAAAAAAAgAAAAIAAAADAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAgAAAAIAAAAAAAAAAwAAAAUAAAACAAAAAAAAAAIAAAADAAAAEwAAAAAAAAACAAAAAgAAAAMAAAAPAAAAAAAAAAAAAAAAAAAAAAAAABAAAAACAAAAAAAAAAIAAAABAAAAEwAAAAIAAAACAAAAAAAAAAUAAAAKAAAAAAAAAAIAAAACAAAAAwAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAIAAAAAAAAAAgAAAAEAAAAPAAAAAgAAAAIAAAAAAAAABQAAAAsAAAAAAAAAAgAAAAIAAAADAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAgAAAAAAAAACAAAAAQAAABAAAAACAAAAAgAAAAAAAAAFAAAADAAAAAAAAAACAAAAAgAAAAMAAAASAAAAAAAAAAAAAAAAAAAAAAAAABMAAAACAAAAAAAAAAIAAAABAAAAEQAAAAIAAAACAAAAAAAAAAUAAAANAAAAAAAAAAIAAAACAAAAAwAAABMAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAIAAAAAAAAAAgAAAAEAAAASAAAAAgAAAAIAAAAAAAAABQAAAA4AAAAAAAAAAgAAAAIAAAADAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAOgehWlKfUEEz1zLi+JsiQa2og3wcMfVAWCbHorc0yEDi+Yn/Y6mbQJ11/mfsnG9At6bnG4UQQkBvMCQWKqUUQJVmwwswmOc/3hVgVBL3uj//qqOEOdGOPw/WDN4gnGE/H3ANkCUgND+AA8btKgAHPwTXBqJVSdo+XfRQAqsKrj4fc+zLYbSPQklEmCZHv2FCUP+uDso1NEKYtPhwphUHQptxnyFXYdpB7CddZAMmrkGAt1AxSTqBQUibBVdTsFNBSuX3MV+AJkFocv82SLf5QAqmgj7AY81A23VDSEnLoEDGEJVSeDFzQDYrqvBk70VA8U157pcRGUBWfEF+ZKbsP7KBdLHZTpFAqKYk69AqekDbeGY41MdjQD8AZzHK501A1vcrrjubNkD5LnquvBYhQCbiRRD71QlAqt72EbOH8z8Eu+jL1YbdP4uaox/xUcY/abedg1XfsD+BsUdzJ4KZP5wE9YFySIM/rW1kAKMpbT+rZFthVRhWPy4PKlXIs0A/qMZLlwDnMEHByqEF0I0ZQQYSFD8lUQNBPpY+dFs07UAH8BZImBPWQN9RY0I0sMBA2T7kLfc6qUByFYvfhBKTQMq+0Mis1XxA0XQbeQXMZUBJJ5aEGXpQQP7/SY0a6ThAaMD92b/UIkAs8s8yqXoMQNIegOvCk/U/aOi7NZJP4D8AAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAD/////AAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAA/////wAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAP////8AAAAABQAAAAAAAAAAAAAAAAAAAAAAAAD/////BQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAABAAAAAAAAAAUAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAEAAQAAAQEAAAAAAAEAAAABAAAAAQABAAAAAAAAAAAAAAAAAAAAAAcAAAAHAAAAAQAAAAIAAAAEAAAAAwAAAAAAAAAAAAAABwAAAAMAAAABAAAAAgAAAAUAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAACAAAAAQAAAAMAAAAOAAAABgAAAAsAAAACAAAABwAAAAEAAAAYAAAABQAAAAoAAAABAAAABgAAAAAAAAAmAAAABwAAAAwAAAADAAAACAAAAAIAAAAxAAAACQAAAA4AAAAAAAAABQAAAAQAAAA6AAAACAAAAA0AAAAEAAAACQAAAAMAAAA/AAAACwAAAAYAAAAPAAAACgAAABAAAABIAAAADAAAAAcAAAAQAAAACwAAABEAAABTAAAACgAAAAUAAAATAAAADgAAAA8AAABhAAAADQAAAAgAAAARAAAADAAAABIAAABrAAAADgAAAAkAAAASAAAADQAAABMAAAB1AAAADwAAABMAAAARAAAAEgAAABAAAAAGAAAAAgAAAAMAAAAFAAAABAAAAAAAAAAAAAAAAAAAAAYAAAACAAAAAwAAAAEAAAAFAAAABAAAAAAAAAAAAAAABwAAAAUAAAADAAAABAAAAAEAAAAAAAAAAgAAAAAAAAACAAAAAwAAAAEAAAAFAAAABAAAAAYAAAAAAAAAAAAAAGFsZ29zLmMAaDNOZWlnaGJvclJvdGF0aW9ucwBjb29yZGlqay5jAF91cEFwN0NoZWNrZWQAX3VwQXA3ckNoZWNrZWQAZGlyZWN0ZWRFZGdlLmMAZGlyZWN0ZWRFZGdlVG9Cb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbdG1wRmlqay5mYWNlXVtmaWprLmZhY2VdID09IEtJAGZhY2VpamsuYwBfZmFjZUlqa1BlbnRUb0NlbGxCb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbY2VudGVySUpLLmZhY2VdW2ZhY2UyXSA9PSBLSQBfZmFjZUlqa1RvQ2VsbEJvdW5kYXJ5AGgzSW5kZXguYwBjb21wYWN0Q2VsbHMAbGF0TG5nVG9DZWxsAGNlbGxUb0NoaWxkUG9zAHZhbGlkYXRlQ2hpbGRQb3MAbGF0TG5nLmMAY2VsbEFyZWFSYWRzMgBwb2x5Z29uLT5uZXh0ID09IE5VTEwAbGlua2VkR2VvLmMAYWRkTmV3TGlua2VkUG9seWdvbgBuZXh0ICE9IE5VTEwAbG9vcCAhPSBOVUxMAGFkZE5ld0xpbmtlZExvb3AAcG9seWdvbi0+Zmlyc3QgPT0gTlVMTABhZGRMaW5rZWRMb29wAGNvb3JkICE9IE5VTEwAYWRkTGlua2VkQ29vcmQAbG9vcC0+Zmlyc3QgPT0gTlVMTABpbm5lckxvb3BzICE9IE5VTEwAbm9ybWFsaXplTXVsdGlQb2x5Z29uAGJib3hlcyAhPSBOVUxMAGNhbmRpZGF0ZXMgIT0gTlVMTABmaW5kUG9seWdvbkZvckhvbGUAY2FuZGlkYXRlQkJveGVzICE9IE5VTEwAcmV2RGlyICE9IElOVkFMSURfRElHSVQAbG9jYWxpai5jAGNlbGxUb0xvY2FsSWprAGJhc2VDZWxsICE9IG9yaWdpbkJhc2VDZWxsACEob3JpZ2luT25QZW50ICYmIGluZGV4T25QZW50KQBiYXNlQ2VsbCA9PSBvcmlnaW5CYXNlQ2VsbABiYXNlQ2VsbCAhPSBJTlZBTElEX0JBU0VfQ0VMTABsb2NhbElqa1RvQ2VsbAAhX2lzQmFzZUNlbGxQZW50YWdvbihiYXNlQ2VsbCkAYmFzZUNlbGxSb3RhdGlvbnMgPj0gMABncmlkUGF0aENlbGxzADAAdmVydGV4LmMAY2VsbFRvVmVydGV4AGdyYXBoLT5idWNrZXRzICE9IE5VTEwAdmVydGV4R3JhcGguYwBpbml0VmVydGV4R3JhcGgAbm9kZSAhPSBOVUxMAGFkZFZlcnRleE5vZGU=";function $(e){return e}function K(e){return e.replace(/\b__Z[\w\d_]+/g,(function(e){return e===e?e:e+" ["+e+"]"}))}function Z(){var e=new Error;if(!e.stack){try{throw new Error(0)}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}function J(){return S.length}function ee(e){try{var t=new ArrayBuffer(e);if(t.byteLength!=e)return;return new Int8Array(t).set(S),se(t),D(t),1}catch(e){}}function te(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r>255&&(r&=255),t.push(String.fromCharCode(r))}return t.join("")}var ne="function"==typeof atob?atob:function(e){var t,n,r,i,s,a,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l="",u=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{t=o.indexOf(e.charAt(u++))<<2|(i=o.indexOf(e.charAt(u++)))>>4,n=(15&i)<<4|(s=o.indexOf(e.charAt(u++)))>>2,r=(3&s)<<6|(a=o.indexOf(e.charAt(u++))),l+=String.fromCharCode(t),64!==s&&(l+=String.fromCharCode(n)),64!==a&&(l+=String.fromCharCode(r))}while(u<e.length);return l};function re(e){if(Y(e))return function(e){if("boolean"==typeof a&&a){var t;try{t=Buffer.from(e,"base64")}catch(n){t=new Buffer(e,"base64")}return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}try{for(var n=ne(e),r=new Uint8Array(n.length),i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}catch(e){throw new Error("Converting base64 string to bytes failed.")}}(e.slice(Q.length))}var ie=function(e,t,n){var r=new e.Int8Array(n),i=new e.Int32Array(n);new e.Uint8Array(n),new e.Float32Array(n);var s=new e.Float64Array(n),a=0|t.o,o=0|t.p,l=e.Math.floor,u=e.Math.abs,c=e.Math.sqrt,A=e.Math.pow,h=e.Math.cos,d=e.Math.sin,p=e.Math.tan,f=e.Math.acos,m=e.Math.asin,g=e.Math.atan,v=e.Math.atan2,_=e.Math.ceil,y=e.Math.imul,x=e.Math.min,b=e.Math.max,S=e.Math.clz32,T=t.b,w=t.c,M=t.d,E=t.e,C=t.f,R=t.g,N=t.h,P=t.i,D=24160;function L(e,t,n,r){return 0|I(e|=0,t|=0,n|=0,r|=0,0)}function I(e,t,n,r,s){var a,o=0,l=0,u=0,c=0;if(a=D,D=D+16|0,l=a,!(0|U(e|=0,t|=0,n|=0,r|=0,s|=0)))return D=a,0|(r=0);do{if((0|n)>=0){if((0|n)>13780509){if(0|(o=0|tt(15,l)))break;l=0|i[(u=l)>>2],u=0|i[u+4>>2]}else c=0|Ot(0|n,0|(o=((0|n)<0)<<31>>31),3,0),u=0|w(),o=0|Dt(0|n,0|o,1,0),o=0|Dt(0|(o=0|Ot(0|c,0|u,0|o,0|w())),0|w(),1,0),u=0|w(),i[l>>2]=o,i[l+4>>2]=u,l=o;if(Xt(0|r,0,l<<3),0|s){Xt(0|s,0,l<<2),o=0|B(e,t,n,r,s,l,u,0);break}(o=0|Pt(l,4))?(c=0|B(e,t,n,r,o,l,u,0),Nt(o),o=c):o=13}else o=2}while(0);return D=a,0|(c=o)}function U(e,t,n,r,s){e|=0,t|=0,n|=0,r|=0,s|=0;var a,o,l=0,u=0,c=0,A=0,h=0,d=0,p=0,f=0,m=0;if(o=D,D=D+16|0,m=o+8|0,i[(f=a=o)>>2]=e,i[f+4>>2]=t,(0|n)<0)return D=o,0|(m=2);if(i[(l=r)>>2]=e,i[l+4>>2]=t,(l=!!(0|s))&&(i[s>>2]=0),0|Oe(e,t))return D=o,0|(m=9);i[m>>2]=0;e:do{if((0|n)>=1)if(l)for(d=1,h=0,p=0,f=1,l=e;;){if(!(h|p)){if(0|(l=0|O(l,t,4,m,a)))break e;if(0|Oe(l=0|i[(t=a)>>2],t=0|i[t+4>>2])){l=9;break e}}if(0|(l=0|O(l,t,0|i[22384+(p<<2)>>2],m,a)))break e;if(l=0|i[(t=a)>>2],t=0|i[t+4>>2],i[(e=r+(d<<3)|0)>>2]=l,i[e+4>>2]=t,i[s+(d<<2)>>2]=f,u=(0|(e=h+1|0))==(0|f),A=6==(0|(c=p+1|0)),0|Oe(l,t)){l=9;break e}if((0|(f=f+(A&u&1)|0))>(0|n)){l=0;break}d=d+1|0,h=u?0:e,p=u?A?0:c:p}else for(d=1,h=0,p=0,f=1,l=e;;){if(!(h|p)){if(0|(l=0|O(l,t,4,m,a)))break e;if(0|Oe(l=0|i[(t=a)>>2],t=0|i[t+4>>2])){l=9;break e}}if(0|(l=0|O(l,t,0|i[22384+(p<<2)>>2],m,a)))break e;if(l=0|i[(t=a)>>2],t=0|i[t+4>>2],i[(e=r+(d<<3)|0)>>2]=l,i[e+4>>2]=t,u=(0|(e=h+1|0))==(0|f),A=6==(0|(c=p+1|0)),0|Oe(l,t)){l=9;break e}if((0|(f=f+(A&u&1)|0))>(0|n)){l=0;break}d=d+1|0,h=u?0:e,p=u?A?0:c:p}else l=0}while(0);return D=o,0|(m=l)}function B(e,t,n,r,s,a,o,l){n|=0,r|=0,s|=0,l|=0;var u,c,A,h=0,d=0,p=0,f=0,m=0,g=0,v=0;if(A=D,D=D+16|0,u=A+8|0,c=A,h=0|kt(0|(e|=0),0|(t|=0),0|(a|=0),0|(o|=0)),p=0|w(),!(!(0|(v=0|i[(g=f=r+(h<<3)|0)>>2]))&!(0|(g=0|i[g+4>>2]))|(d=(0|v)==(0|e)&(0|g)==(0|t))))do{h=0|Ft(0|(h=0|Dt(0|h,0|p,1,0)),0|w(),0|a,0|o),p=0|w(),d=(0|(g=0|i[(v=f=r+(h<<3)|0)>>2]))==(0|e)&(0|(v=0|i[v+4>>2]))==(0|t)}while(!(!(0|g)&!(0|v)|d));if(h=s+(h<<2)|0,d&&(0|i[h>>2])<=(0|l))return D=A,0|(v=0);if(i[(v=f)>>2]=e,i[v+4>>2]=t,i[h>>2]=l,(0|l)>=(0|n))return D=A,0|(v=0);switch(d=l+1|0,i[u>>2]=0,0|(h=0|O(e,t,2,u,c))){case 9:m=9;break;case 0:(h=0|B(0|i[(h=c)>>2],0|i[h+4>>2],n,r,s,a,o,d))||(m=9)}e:do{if(9==(0|m)){switch(i[u>>2]=0,0|(h=0|O(e,t,3,u,c))){case 9:break;case 0:if(0|(h=0|B(0|i[(h=c)>>2],0|i[h+4>>2],n,r,s,a,o,d)))break e;break;default:break e}switch(i[u>>2]=0,0|(h=0|O(e,t,1,u,c))){case 9:break;case 0:if(0|(h=0|B(0|i[(h=c)>>2],0|i[h+4>>2],n,r,s,a,o,d)))break e;break;default:break e}switch(i[u>>2]=0,0|(h=0|O(e,t,5,u,c))){case 9:break;case 0:if(0|(h=0|B(0|i[(h=c)>>2],0|i[h+4>>2],n,r,s,a,o,d)))break e;break;default:break e}switch(i[u>>2]=0,0|(h=0|O(e,t,4,u,c))){case 9:break;case 0:if(0|(h=0|B(0|i[(h=c)>>2],0|i[h+4>>2],n,r,s,a,o,d)))break e;break;default:break e}switch(i[u>>2]=0,0|(h=0|O(e,t,6,u,c))){case 9:break;case 0:if(0|(h=0|B(0|i[(h=c)>>2],0|i[h+4>>2],n,r,s,a,o,d)))break e;break;default:break e}return D=A,0|(v=0)}}while(0);return D=A,0|(v=h)}function O(e,t,n,r,s){e|=0,t|=0,s|=0;var a,o,l=0,u=0,c=0,A=0,h=0,d=0,p=0;if((n|=0)>>>0>6)return 0|(s=1);if(h=(0|i[(r|=0)>>2])%6|0,i[r>>2]=h,(0|h)>0){l=0;do{n=0|pe(n),l=l+1|0}while((0|l)<(0|i[r>>2]))}if(h=0|Gt(0|e,0|t,45),w(),(o=127&h)>>>0>121)return 0|(s=5);a=0|Fe(e,t),l=0|Gt(0|e,0|t,52),w(),l&=15;e:do{if(l){for(;;){if(c=0|Gt(0|e,0|t,0|(u=3*(15-l|0)|0)),w(),7==(0|(c&=7))){t=5;break}if(p=!(0|Ve(l)),l=l+-1|0,d=0|zt(7,0,0|u),t&=~w(),e=0|zt(0|i[(p?432:16)+(28*c|0)+(n<<2)>>2],0,0|u)|e&~d,t|=u=0|w(),!(n=0|i[(p?640:224)+(28*c|0)+(n<<2)>>2])){n=0;break e}if(!l){A=8;break e}}return 0|t}A=8}while(0);8==(0|A)&&(e|=0|zt(0|(p=0|i[848+(28*o|0)+(n<<2)>>2]),0,45),t=w()|-1040385&t,n=0|i[4272+(28*o|0)+(n<<2)>>2],127&~p||(p=0|zt(0|i[848+(28*o|0)+20>>2],0,45),t=w()|-1040385&t,n=0|i[4272+(28*o|0)+20>>2],e=0|qe(p|e,t),t=0|w(),i[r>>2]=1+(0|i[r>>2]))),c=0|Gt(0|e,0|t,45),w(),c&=127;e:do{if(0|q(c)){t:do{if(1==(0|Fe(e,t))){if((0|o)!=(0|c)){if(0|H(c,0|i[7696+(28*o|0)>>2])){e=0|ze(e,t),u=1,t=0|w();break}M(23313,22416,436,22424)}switch(0|a){case 3:e=0|qe(e,t),t=0|w(),i[r>>2]=1+(0|i[r>>2]),u=0;break t;case 5:e=0|ze(e,t),t=0|w(),i[r>>2]=5+(0|i[r>>2]),u=0;break t;case 0:return 0|(p=9);default:return 0|(p=1)}}else u=0}while(0);if((0|n)>0){l=0;do{e=0|ke(e,t),t=0|w(),l=l+1|0}while((0|l)!=(0|n))}if((0|o)!=(0|c)){if(!(0|G(c))){if(!!(0|u)|5!=(0|Fe(e,t)))break;i[r>>2]=1+(0|i[r>>2]);break}switch(127&h){case 8:case 118:break e}3!=(0|Fe(e,t))&&(i[r>>2]=1+(0|i[r>>2]))}}else if((0|n)>0){l=0;do{e=0|qe(e,t),t=0|w(),l=l+1|0}while((0|l)!=(0|n))}}while(0);return i[r>>2]=((0|i[r>>2])+n|0)%6|0,i[(p=s)>>2]=e,i[p+4>>2]=t,0|(p=0)}function F(e,t,n,r){n|=0,r|=0;var s,a,o,l=0,u=0;for(o=D,D=D+16|0,s=o,a=o+8|0,l=(l=!(0|Oe(e|=0,t|=0)))?1:2;;){if(i[a>>2]=0,!(0|O(e,t,l,a,s))&((0|i[(u=s)>>2])==(0|n)?(0|i[u+4>>2])==(0|r):0)){e=4;break}if((l=l+1|0)>>>0>=7){l=7,e=4;break}}return 4==(0|e)?(D=o,0|l):0}function k(e,t,n,r,a,o,l){t|=0,n|=0,r|=0,a|=0,o|=0,l|=0;var u,c,A,h,d,p,f,m,g,v,_=0,y=0,x=0,b=0,S=0,T=0,M=0,E=0,C=0,R=0,N=0,P=0,L=0,I=0,U=0,B=0,O=0,F=0,k=0;if(v=D,D=D+64|0,f=v+48|0,m=v+32|0,g=v+24|0,u=v+8|0,c=v,(0|(y=0|i[(e|=0)>>2]))<=0)return D=v,0|(U=0);for(A=e+4|0,h=f+8|0,d=m+8|0,p=u+8|0,_=0,L=0;;){P=(x=0|i[A>>2])+(L<<4)|0,i[f>>2]=i[P>>2],i[f+4>>2]=i[P+4>>2],i[f+8>>2]=i[P+8>>2],i[f+12>>2]=i[P+12>>2],(0|L)==(y+-1|0)?(i[m>>2]=i[x>>2],i[m+4>>2]=i[x+4>>2],i[m+8>>2]=i[x+8>>2],i[m+12>>2]=i[x+12>>2]):(P=x+(L+1<<4)|0,i[m>>2]=i[P>>2],i[m+4>>2]=i[P+4>>2],i[m+8>>2]=i[P+8>>2],i[m+12>>2]=i[P+12>>2]),y=0|$(f,m,r,g);e:do{if(y)x=0,_=y;else if(y=0|i[(x=g)>>2],(0|(x=0|i[x+4>>2]))>0|!(0|x)&y>>>0>0){N=0,P=0;t:for(;;){if(k=+s[f>>3],F=+((R=0|Lt(0|y,0|x,0|N,0|P))>>>0)+4294967296*+(0|w()),B=+(y>>>0)+4294967296*+(0|x),O=+(N>>>0)+4294967296*+(0|P),s[u>>3]=k*F/B+ +s[m>>3]*O/B,s[p>>3]=+s[h>>3]*F/B+ +s[d>>3]*O/B,0|(y=0|He(u,r,c))){_=y;break}T=0|kt(0|(C=0|i[(R=c)>>2]),0|(R=0|i[R+4>>2]),0|t,0|n),b=0|w(),x=0|i[(S=y=l+(T<<3)|0)>>2],S=0|i[S+4>>2];n:do{if(!(0|x)&!(0|S))I=y,U=16;else for(M=0,E=0;;){if((0|M)>(0|n)|(0|M)==(0|n)&E>>>0>t>>>0){_=1;break t}if((0|x)==(0|C)&(0|S)==(0|R))break n;if(T=0|Ft(0|(y=0|Dt(0|T,0|b,1,0)),0|w(),0|t,0|n),b=0|w(),E=0|Dt(0|E,0|M,1,0),M=0|w(),!(0|(x=0|i[(S=y=l+(T<<3)|0)>>2]))&!(0|(S=0|i[S+4>>2]))){I=y,U=16;break}}}while(0);if(16!=(0|U)||(U=0,!(0|C)&!(0|R))||(i[(E=I)>>2]=C,i[E+4>>2]=R,E=o+(i[a>>2]<<3)|0,i[E>>2]=C,i[E+4>>2]=R,E=0|Dt(0|i[(E=a)>>2],0|i[E+4>>2],1,0),C=0|w(),i[(R=a)>>2]=E,i[R+4>>2]=C),N=0|Dt(0|N,0|P,1,0),P=0|w(),y=0|i[(x=g)>>2],!((0|(x=0|i[x+4>>2]))>(0|P)|(0|x)==(0|P)&y>>>0>N>>>0)){x=1;break e}}x=0}else x=1}while(0);if(L=L+1|0,!x){U=21;break}if((0|L)>=(0|(y=0|i[e>>2]))){_=0,U=21;break}}return 21==(0|U)?(D=v,0|_):0}function q(e){return(e|=0)>>>0>121?0|(e=0):0|(e=0|i[7696+(28*e|0)+16>>2])}function G(e){return 4==(0|(e|=0))|117==(0|e)}function z(e){return 0|i[11120+(216*(0|i[(e|=0)>>2])|0)+(72*(0|i[e+4>>2])|0)+(24*(0|i[e+8>>2])|0)+(i[e+12>>2]<<3)>>2]}function V(e){return 0|i[11120+(216*(0|i[(e|=0)>>2])|0)+(72*(0|i[e+4>>2])|0)+(24*(0|i[e+8>>2])|0)+(i[e+12>>2]<<3)+4>>2]}function H(e,t){return t|=0,(0|i[7696+(28*(e|=0)|0)+20>>2])==(0|t)?0|(t=1):0|(t=(0|i[7696+(28*e|0)+24>>2])==(0|t))}function j(e,t){return 0|i[848+(28*(e|=0)|0)+((t|=0)<<2)>>2]}function W(e,t){return t|=0,(0|i[848+(28*(e|=0)|0)>>2])==(0|t)?0|(t=0):(0|i[848+(28*e|0)+4>>2])==(0|t)?0|(t=1):(0|i[848+(28*e|0)+8>>2])==(0|t)?0|(t=2):(0|i[848+(28*e|0)+12>>2])==(0|t)?0|(t=3):(0|i[848+(28*e|0)+16>>2])==(0|t)?0|(t=4):(0|i[848+(28*e|0)+20>>2])==(0|t)?0|(t=5):0|((0|i[848+(28*e|0)+24>>2])==(0|t)?6:7)}function X(e){return+s[(e|=0)+16>>3]<+s[e+24>>3]|0}function Q(e,t){e|=0;var n,r,i=0;return(i=+s[(t|=0)>>3])>=+s[e+8>>3]&&i<=+s[e>>3]?(n=+s[e+16>>3],i=+s[e+24>>3],t=(r=+s[t+8>>3])>=i,e=r<=n&1,n<i?t&&(e=1):t||(e=0),0|(t=!!(0|e))):0|(t=0)}function Y(e,t,n){e|=0,t|=0,n|=0;var r,o,c,A,h,d,p,f=0,m=0,g=0,v=0,y=0,b=0,S=0;d=D,D=D+288|0,h=d+264|0,v=d+96|0,m=(f=g=d)+96|0;do{i[f>>2]=0,f=f+4|0}while((0|f)<(0|m));return 0|(t=0|Ye(t,g))?(D=d,0|(b=t)):(Xe(g=0|i[(m=g)>>2],m=0|i[m+4>>2],h),Qe(g,m,v),A=+et(h,v+8|0),s[h>>3]=+s[e>>3],s[(m=h+8|0)>>3]=+s[e+16>>3],s[v>>3]=+s[e+8>>3],s[(g=v+8|0)>>3]=+s[e+24>>3],o=+et(h,v),S=+s[m>>3]-+s[g>>3],c=+u(+S),p=+s[h>>3]-+s[v>>3],r=+u(+p),!(0==S|0==p)&&(S=+Vt(+c,+r),S=+_(+o*o/+Ht(+S/+Ht(+c,+r),3)/(A*(2.59807621135*A)*.8)),s[a>>3]=S,y=~~S>>>0,b=+u(S)>=1?S>0?~~+x(+l(S/4294967296),4294967295)>>>0:~~+_((S-+(~~S>>>0))/4294967296)>>>0:0,2146435072&~i[a+4>>2])?(v=!(0|y)&!(0|b),i[(t=n)>>2]=v?1:y,i[t+4>>2]=v?0:b,t=0):t=1,D=d,0|(b=t))}function $(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var o,c,A,h,d=0,p=0,f=0;h=D,D=D+288|0,c=h+264|0,A=h+96|0,o=(d=p=h)+96|0;do{i[d>>2]=0,d=d+4|0}while((0|d)<(0|o));return 0|(n=0|Ye(n,p))?(D=h,0|(r=n)):(Xe(d=0|i[(n=p)>>2],n=0|i[n+4>>2],c),Qe(d,n,A),f=+et(c,A+8|0),f=+_(+ +et(e,t)/(2*f)),s[a>>3]=f,n=~~f>>>0,d=+u(f)>=1?f>0?~~+x(+l(f/4294967296),4294967295)>>>0:~~+_((f-+(~~f>>>0))/4294967296)>>>0:0,2146435072&~i[a+4>>2]?(p=!(0|n)&!(0|d),i[r>>2]=p?1:n,i[r+4>>2]=p?0:d,D=h,0|(r=0)):(D=h,0|(r=1)))}function K(e,t,n,r){t|=0,n|=0,r|=0,i[(e|=0)>>2]=t,i[e+4>>2]=n,i[e+8>>2]=r}function Z(e,t){e|=0;var n,r,a,o,l=0,c=0,A=0,h=0,d=0,p=0,f=0;i[(o=(t|=0)+8|0)>>2]=0,r=+s[e>>3],h=+u(+r),a=+s[e+8>>3],h+=.5*(d=+u(+a)/.8660254037844386),h-=+(0|(l=~~h)),d-=+(0|(e=~~d));do{if(h<.5){if(h<.3333333333333333){if(i[t>>2]=l,d<.5*(h+1)){i[t+4>>2]=e;break}e=e+1|0,i[t+4>>2]=e;break}if(e=(1&!(d<(f=1-h)))+e|0,i[t+4>>2]=e,f<=d&d<2*h){l=l+1|0,i[t>>2]=l;break}i[t>>2]=l;break}if(!(h<.6666666666666666)){if(l=l+1|0,i[t>>2]=l,d<.5*h){i[t+4>>2]=e;break}e=e+1|0,i[t+4>>2]=e;break}if(d<1-h){if(i[t+4>>2]=e,2*h-1<d){i[t>>2]=l;break}}else e=e+1|0,i[t+4>>2]=e;l=l+1|0,i[t>>2]=l}while(0);do{if(r<0){if(1&e){l=~~(+(0|l)-(2*(+((p=0|Lt(0|l,((0|l)<0)<<31>>31,0|(p=(e+1|0)/2|0),((0|p)<0)<<31>>31))>>>0)+4294967296*+(0|w()))+1)),i[t>>2]=l;break}l=~~(+(0|l)-2*(+((p=0|Lt(0|l,((0|l)<0)<<31>>31,0|(p=(0|e)/2|0),((0|p)<0)<<31>>31))>>>0)+4294967296*+(0|w()))),i[t>>2]=l;break}}while(0);p=t+4|0,a<0&&(l=l-((1|e<<1)/2|0)|0,i[t>>2]=l,e=0-e|0,i[p>>2]=e),c=e-l|0,(0|l)<0?(A=0-l|0,i[p>>2]=c,i[o>>2]=A,i[t>>2]=0,e=c,l=0):A=0,(0|e)<0&&(l=l-e|0,i[t>>2]=l,A=A-e|0,i[o>>2]=A,i[p>>2]=0,e=0),n=l-A|0,c=e-A|0,(0|A)<0&&(i[t>>2]=n,i[p>>2]=c,i[o>>2]=0,e=c,l=n,A=0),(0|(c=(0|A)<(0|(c=(0|e)<(0|l)?e:l))?A:c))<=0||(i[t>>2]=l-c,i[p>>2]=e-c,i[o>>2]=A-c)}function J(e){var t,n=0,r=0,s=0,a=0,o=0;n=0|i[(e|=0)>>2],r=0|i[(t=e+4|0)>>2],(0|n)<0&&(r=r-n|0,i[t>>2]=r,i[(o=e+8|0)>>2]=(0|i[o>>2])-n,i[e>>2]=0,n=0),(0|r)<0?(n=n-r|0,i[e>>2]=n,a=(0|i[(o=e+8|0)>>2])-r|0,i[o>>2]=a,i[t>>2]=0,r=0):(o=a=e+8|0,a=0|i[a>>2]),(0|a)<0&&(n=n-a|0,i[e>>2]=n,r=r-a|0,i[t>>2]=r,i[o>>2]=0,a=0),(0|(s=(0|a)<(0|(s=(0|r)<(0|n)?r:n))?a:s))<=0||(i[e>>2]=n-s,i[t>>2]=r-s,i[o>>2]=a-s)}function ee(e,t){t|=0;var n,r;r=0|i[(e|=0)+8>>2],n=+((0|i[e+4>>2])-r|0),s[t>>3]=+((0|i[e>>2])-r|0)-.5*n,s[t+8>>3]=.8660254037844386*n}function te(e,t,n){e|=0,t|=0,i[(n|=0)>>2]=(0|i[t>>2])+(0|i[e>>2]),i[n+4>>2]=(0|i[t+4>>2])+(0|i[e+4>>2]),i[n+8>>2]=(0|i[t+8>>2])+(0|i[e+8>>2])}function ne(e,t,n){e|=0,t|=0,i[(n|=0)>>2]=(0|i[e>>2])-(0|i[t>>2]),i[n+4>>2]=(0|i[e+4>>2])-(0|i[t+4>>2]),i[n+8>>2]=(0|i[e+8>>2])-(0|i[t+8>>2])}function re(e,t){t|=0;var n,r=0;r=0|y(0|i[(e|=0)>>2],t),i[e>>2]=r,n=0|y(0|i[(r=e+4|0)>>2],t),i[r>>2]=n,t=0|y(0|i[(e=e+8|0)>>2],t),i[e>>2]=t}function ie(e){var t,n,r=0,s=0,a=0,o=0,l=0;l=(0|(n=0|i[(e|=0)>>2]))<0,e=(e=(s=(0|(o=((t=(0|(a=(0|i[e+4>>2])-(l?n:0)|0))<0)?0-a|0:0)+((0|i[e+8>>2])-(l?n:0))|0))<0)?0:o)-((a=(0|(s=(0|e)<(0|(s=(0|(r=(t?0:a)-(s?o:0)|0))<(0|(o=(l?0:n)-(t?a:0)-(s?o:0)|0))?r:o))?e:s))>0)?s:0)|0,r=r-(a?s:0)|0;e:do{switch(o-(a?s:0)|0){case 0:switch(0|r){case 0:return 0|(l=0|e?1==(0|e)?1:7:0);case 1:return 0|(l=0|e?1==(0|e)?3:7:2);default:break e}case 1:switch(0|r){case 0:return 0|(l=0|e?1==(0|e)?5:7:4);case 1:if(e)break e;return 0|(e=6);default:break e}}}while(0);return 0|(l=7)}function se(e){var t,n=0,r=0,s=0,a=0,o=0,l=0;a=0|i[(t=(e|=0)+8|0)>>2],o=(0|i[e>>2])-a|0,a=(0|i[(l=e+4|0)>>2])-a|0;do{if(o>>>0>715827881|a>>>0>715827881){if(r=(0|o)>0){if((2147483647-o|0)<(0|o))return 0|(l=1);if((2147483647-(o<<1)|0)<(0|o))return 0|(l=1)}else{if((-2147483648-o|0)>(0|o))return 0|(l=1);if((-2147483648-(o<<1)|0)>(0|o))return 0|(l=1)}if(n=3*o|0,(0|a)>0){if((2147483647-a|0)<(0|a))return 0|(l=1)}else if((-2147483648-a|0)>(0|a))return 0|(l=1);if(s=a<<1,(0|o)>-1){if((-2147483648|n)>=(0|a))return 0|(l=1)}else if((-2147483648^n)<(0|a))return 0|(l=1);if(r){if(!((2147483647-o|0)<(0|s))){r=s;break}return 0|(n=1)}if(!((-2147483648-o|0)>(0|s))){r=s;break}return 0|(n=1)}r=a<<1,n=3*o|0}while(0);s=0|Ct(+(n-a|0)/7),i[e>>2]=s,a=0|Ct(+(r+o|0)/7),i[l>>2]=a,i[t>>2]=0,n=(r=(0|a)<(0|s))?s:a,r=r?a:s;do{if((0|r)<0){if((0|n)>0){if((-2147483648|n)<(0|r)&-2147483648!=(0|r)&(2147483647-n|0)>=(0|r))break;M(23313,22444,355,22455)}if(-2147483648==(0|r)|(-2147483648-n|0)>(0|r)&&M(23313,22444,355,22455),(0|n)>-1){if((-2147483648|n)<(0|r))break;M(23313,22444,355,22455)}else{if((-2147483648^n)>=(0|r))break;M(23313,22444,355,22455)}}}while(0);return n=a-s|0,(0|s)<0?(r=0-s|0,i[l>>2]=n,i[t>>2]=r,i[e>>2]=0,s=0):(n=a,r=0),(0|n)<0&&(s=s-n|0,i[e>>2]=s,r=r-n|0,i[t>>2]=r,i[l>>2]=0,n=0),o=s-r|0,a=n-r|0,(0|r)<0?(i[e>>2]=o,i[l>>2]=a,i[t>>2]=0,n=a,a=o,r=0):a=s,(0|(s=(0|r)<(0|(s=(0|n)<(0|a)?n:a))?r:s))<=0||(i[e>>2]=a-s,i[l>>2]=n-s,i[t>>2]=r-s),0|(l=0)}function ae(e){var t,n=0,r=0,s=0,a=0,o=0,l=0;a=0|i[(t=(e|=0)+8|0)>>2],o=(0|i[e>>2])-a|0,a=(0|i[(l=e+4|0)>>2])-a|0;do{if(o>>>0>715827881|a>>>0>715827881){if(r=(0|o)>0){if((2147483647-o|0)<(0|o))return 0|(l=1)}else if((-2147483648-o|0)>(0|o))return 0|(l=1);if(n=o<<1,(0|a)>0){if((2147483647-a|0)<(0|a))return 0|(l=1);if((2147483647-(a<<1)|0)<(0|a))return 0|(l=1)}else{if((-2147483648-a|0)>(0|a))return 0|(l=1);if((-2147483648-(a<<1)|0)>(0|a))return 0|(l=1)}if(s=3*a|0,r){if((2147483647-n|0)<(0|a))return 0|(l=1)}else if((-2147483648-n|0)>(0|a))return 0|(l=1);if((0|a)>-1){if((-2147483648|s)<(0|o)){r=s;break}return 0|(n=1)}if(!((-2147483648^s)<(0|o))){r=s;break}return 0|(n=1)}r=3*a|0,n=o<<1}while(0);s=0|Ct(+(n+a|0)/7),i[e>>2]=s,a=0|Ct(+(r-o|0)/7),i[l>>2]=a,i[t>>2]=0,n=(r=(0|a)<(0|s))?s:a,r=r?a:s;do{if((0|r)<0){if((0|n)>0){if((-2147483648|n)<(0|r)&-2147483648!=(0|r)&(2147483647-n|0)>=(0|r))break;M(23313,22444,404,22469)}if(-2147483648==(0|r)|(-2147483648-n|0)>(0|r)&&M(23313,22444,404,22469),(0|n)>-1){if((-2147483648|n)<(0|r))break;M(23313,22444,404,22469)}else{if((-2147483648^n)>=(0|r))break;M(23313,22444,404,22469)}}}while(0);return n=a-s|0,(0|s)<0?(r=0-s|0,i[l>>2]=n,i[t>>2]=r,i[e>>2]=0,s=0):(n=a,r=0),(0|n)<0&&(s=s-n|0,i[e>>2]=s,r=r-n|0,i[t>>2]=r,i[l>>2]=0,n=0),o=s-r|0,a=n-r|0,(0|r)<0?(i[e>>2]=o,i[l>>2]=a,i[t>>2]=0,n=a,a=o,r=0):a=s,(0|(s=(0|r)<(0|(s=(0|n)<(0|a)?n:a))?r:s))<=0||(i[e>>2]=a-s,i[l>>2]=n-s,i[t>>2]=r-s),0|(l=0)}function oe(e){var t,n,r=0,s=0,a=0,o=0,l=0;s=0|i[(t=(e|=0)+8|0)>>2],a=0|Ct(+((3*(r=(0|i[e>>2])-s|0)|0)-(s=(0|i[(n=e+4|0)>>2])-s|0)|0)/7),i[e>>2]=a,r=0|Ct(+((s<<1)+r|0)/7),i[n>>2]=r,i[t>>2]=0,s=r-a|0,(0|a)<0?(l=0-a|0,i[n>>2]=s,i[t>>2]=l,i[e>>2]=0,r=s,a=0,s=l):s=0,(0|r)<0&&(a=a-r|0,i[e>>2]=a,s=s-r|0,i[t>>2]=s,i[n>>2]=0,r=0),l=a-s|0,o=r-s|0,(0|s)<0?(i[e>>2]=l,i[n>>2]=o,i[t>>2]=0,r=o,o=l,s=0):o=a,(0|(a=(0|s)<(0|(a=(0|r)<(0|o)?r:o))?s:a))<=0||(i[e>>2]=o-a,i[n>>2]=r-a,i[t>>2]=s-a)}function le(e){var t,n,r=0,s=0,a=0,o=0,l=0;s=0|i[(t=(e|=0)+8|0)>>2],a=0|Ct(+(((r=(0|i[e>>2])-s|0)<<1)+(s=(0|i[(n=e+4|0)>>2])-s|0)|0)/7),i[e>>2]=a,r=0|Ct(+((3*s|0)-r|0)/7),i[n>>2]=r,i[t>>2]=0,s=r-a|0,(0|a)<0?(l=0-a|0,i[n>>2]=s,i[t>>2]=l,i[e>>2]=0,r=s,a=0,s=l):s=0,(0|r)<0&&(a=a-r|0,i[e>>2]=a,s=s-r|0,i[t>>2]=s,i[n>>2]=0,r=0),l=a-s|0,o=r-s|0,(0|s)<0?(i[e>>2]=l,i[n>>2]=o,i[t>>2]=0,r=o,o=l,s=0):o=a,(0|(a=(0|s)<(0|(a=(0|r)<(0|o)?r:o))?s:a))<=0||(i[e>>2]=o-a,i[n>>2]=r-a,i[t>>2]=s-a)}function ue(e){var t,n,r,s=0,a=0,o=0,l=0;s=0|i[(e|=0)>>2],a=0|i[(n=e+4|0)>>2],o=0|i[(r=e+8|0)>>2],l=a+(3*s|0)|0,i[e>>2]=l,a=o+(3*a|0)|0,i[n>>2]=a,s=(3*o|0)+s|0,i[r>>2]=s,o=a-l|0,(0|l)<0?(s=s-l|0,i[n>>2]=o,i[r>>2]=s,i[e>>2]=0,a=o,o=0):o=l,(0|a)<0&&(o=o-a|0,i[e>>2]=o,s=s-a|0,i[r>>2]=s,i[n>>2]=0,a=0),t=o-s|0,l=a-s|0,(0|s)<0?(i[e>>2]=t,i[n>>2]=l,i[r>>2]=0,o=t,s=0):l=a,(0|(a=(0|s)<(0|(a=(0|l)<(0|o)?l:o))?s:a))<=0||(i[e>>2]=o-a,i[n>>2]=l-a,i[r>>2]=s-a)}function ce(e){var t,n,r,s=0,a=0,o=0,l=0;l=0|i[(e|=0)>>2],o=(3*(s=0|i[(n=e+4|0)>>2])|0)+l|0,l=(a=0|i[(r=e+8|0)>>2])+(3*l|0)|0,i[e>>2]=l,i[n>>2]=o,s=(3*a|0)+s|0,i[r>>2]=s,a=o-l|0,(0|l)<0?(s=s-l|0,i[n>>2]=a,i[r>>2]=s,i[e>>2]=0,l=0):a=o,(0|a)<0&&(l=l-a|0,i[e>>2]=l,s=s-a|0,i[r>>2]=s,i[n>>2]=0,a=0),t=l-s|0,o=a-s|0,(0|s)<0?(i[e>>2]=t,i[n>>2]=o,i[r>>2]=0,l=t,s=0):o=a,(0|(a=(0|s)<(0|(a=(0|o)<(0|l)?o:l))?s:a))<=0||(i[e>>2]=l-a,i[n>>2]=o-a,i[r>>2]=s-a)}function Ae(e,t){e|=0;var n,r,s,a=0,o=0,l=0;((t|=0)+-1|0)>>>0>=6||(l=(0|i[15440+(12*t|0)>>2])+(0|i[e>>2])|0,i[e>>2]=l,s=e+4|0,o=(0|i[15440+(12*t|0)+4>>2])+(0|i[s>>2])|0,i[s>>2]=o,r=e+8|0,t=(0|i[15440+(12*t|0)+8>>2])+(0|i[r>>2])|0,i[r>>2]=t,a=o-l|0,(0|l)<0?(t=t-l|0,i[s>>2]=a,i[r>>2]=t,i[e>>2]=0,o=0):(a=o,o=l),(0|a)<0&&(o=o-a|0,i[e>>2]=o,t=t-a|0,i[r>>2]=t,i[s>>2]=0,a=0),n=o-t|0,l=a-t|0,(0|t)<0?(i[e>>2]=n,i[s>>2]=l,i[r>>2]=0,o=n,t=0):l=a,(0|(a=(0|t)<(0|(a=(0|l)<(0|o)?l:o))?t:a))<=0||(i[e>>2]=o-a,i[s>>2]=l-a,i[r>>2]=t-a))}function he(e){var t,n,r,s=0,a=0,o=0,l=0;l=0|i[(e|=0)>>2],o=(s=0|i[(n=e+4|0)>>2])+l|0,l=(a=0|i[(r=e+8|0)>>2])+l|0,i[e>>2]=l,i[n>>2]=o,s=a+s|0,i[r>>2]=s,a=o-l|0,(0|l)<0?(s=s-l|0,i[n>>2]=a,i[r>>2]=s,i[e>>2]=0,o=0):(a=o,o=l),(0|a)<0&&(o=o-a|0,i[e>>2]=o,s=s-a|0,i[r>>2]=s,i[n>>2]=0,a=0),t=o-s|0,l=a-s|0,(0|s)<0?(i[e>>2]=t,i[n>>2]=l,i[r>>2]=0,o=t,s=0):l=a,(0|(a=(0|s)<(0|(a=(0|l)<(0|o)?l:o))?s:a))<=0||(i[e>>2]=o-a,i[n>>2]=l-a,i[r>>2]=s-a)}function de(e){var t,n,r,s=0,a=0,o=0,l=0;s=0|i[(e|=0)>>2],o=0|i[(n=e+4|0)>>2],a=0|i[(r=e+8|0)>>2],l=o+s|0,i[e>>2]=l,o=a+o|0,i[n>>2]=o,s=a+s|0,i[r>>2]=s,a=o-l|0,(0|l)<0?(s=s-l|0,i[n>>2]=a,i[r>>2]=s,i[e>>2]=0,o=0):(a=o,o=l),(0|a)<0&&(o=o-a|0,i[e>>2]=o,s=s-a|0,i[r>>2]=s,i[n>>2]=0,a=0),t=o-s|0,l=a-s|0,(0|s)<0?(i[e>>2]=t,i[n>>2]=l,i[r>>2]=0,o=t,s=0):l=a,(0|(a=(0|s)<(0|(a=(0|l)<(0|o)?l:o))?s:a))<=0||(i[e>>2]=o-a,i[n>>2]=l-a,i[r>>2]=s-a)}function pe(e){switch(0|(e|=0)){case 1:e=5;break;case 5:e=4;break;case 4:e=6;break;case 6:e=2;break;case 2:e=3;break;case 3:e=1}return 0|e}function fe(e){switch(0|(e|=0)){case 1:e=3;break;case 3:e=2;break;case 2:e=6;break;case 6:e=4;break;case 4:e=5;break;case 5:e=1}return 0|e}function me(e){var t,n,r,s=0,a=0,o=0,l=0;s=0|i[(e|=0)>>2],a=0|i[(n=e+4|0)>>2],o=0|i[(r=e+8|0)>>2],l=a+(s<<1)|0,i[e>>2]=l,a=o+(a<<1)|0,i[n>>2]=a,s=(o<<1)+s|0,i[r>>2]=s,o=a-l|0,(0|l)<0?(s=s-l|0,i[n>>2]=o,i[r>>2]=s,i[e>>2]=0,a=o,o=0):o=l,(0|a)<0&&(o=o-a|0,i[e>>2]=o,s=s-a|0,i[r>>2]=s,i[n>>2]=0,a=0),t=o-s|0,l=a-s|0,(0|s)<0?(i[e>>2]=t,i[n>>2]=l,i[r>>2]=0,o=t,s=0):l=a,(0|(a=(0|s)<(0|(a=(0|l)<(0|o)?l:o))?s:a))<=0||(i[e>>2]=o-a,i[n>>2]=l-a,i[r>>2]=s-a)}function ge(e){var t,n,r,s=0,a=0,o=0,l=0;l=0|i[(e|=0)>>2],o=((s=0|i[(n=e+4|0)>>2])<<1)+l|0,l=(a=0|i[(r=e+8|0)>>2])+(l<<1)|0,i[e>>2]=l,i[n>>2]=o,s=(a<<1)+s|0,i[r>>2]=s,a=o-l|0,(0|l)<0?(s=s-l|0,i[n>>2]=a,i[r>>2]=s,i[e>>2]=0,l=0):a=o,(0|a)<0&&(l=l-a|0,i[e>>2]=l,s=s-a|0,i[r>>2]=s,i[n>>2]=0,a=0),t=l-s|0,o=a-s|0,(0|s)<0?(i[e>>2]=t,i[n>>2]=o,i[r>>2]=0,l=t,s=0):o=a,(0|(a=(0|s)<(0|(a=(0|o)<(0|l)?o:l))?s:a))<=0||(i[e>>2]=l-a,i[n>>2]=o-a,i[r>>2]=s-a)}function ve(e,t){t|=0;var n,r,s,a=0,o=0,l=0;return s=(0|(r=(0|i[(e|=0)>>2])-(0|i[t>>2])|0))<0,n=(0|(o=(0|i[e+4>>2])-(0|i[t+4>>2])-(s?r:0)|0))<0,t=(t=(e=(0|(l=(s?0-r|0:0)+(0|i[e+8>>2])-(0|i[t+8>>2])+(n?0-o|0:0)|0))<0)?0:l)-((o=(0|(e=(0|t)<(0|(e=(0|(a=(n?0:o)-(e?l:0)|0))<(0|(l=(s?0:r)-(n?o:0)-(e?l:0)|0))?a:l))?t:e))>0)?e:0)|0,a=a-(o?e:0)|0,0|((0|(e=(0|(e=l-(o?e:0)|0))>-1?e:0-e|0))>(0|(t=(0|(a=(0|a)>-1?a:0-a|0))>(0|(t=(0|t)>-1?t:0-t|0))?a:t))?e:t)}function _e(e,t){t|=0;var n;n=0|i[(e|=0)+8>>2],i[t>>2]=(0|i[e>>2])-n,i[t+4>>2]=(0|i[e+4>>2])-n}function ye(e,t){t|=0;var n,r,s,a=0,o=0,l=0;o=0|i[(e|=0)>>2],i[t>>2]=o,l=0|i[e+4>>2],i[(r=t+4|0)>>2]=l,i[(s=t+8|0)>>2]=0,e=(a=(0|l)<(0|o))?o:l,a=a?l:o;do{if((0|a)<0){if((0|e)>0){if((-2147483648|e)<(0|a)&-2147483648!=(0|a)&(2147483647-e|0)>=(0|a))break;return 0|(e=1)}if(-2147483648==(0|a)|(-2147483648-e|0)>(0|a))return 0|(t=1);if((0|e)>-1){if((-2147483648|e)<(0|a))break;return 0|(e=1)}if(!((-2147483648^e)<(0|a)))break;return 0|(e=1)}}while(0);return e=l-o|0,(0|o)<0?(a=0-o|0,i[r>>2]=e,i[s>>2]=a,i[t>>2]=0,o=0):(e=l,a=0),(0|e)<0&&(o=o-e|0,i[t>>2]=o,a=a-e|0,i[s>>2]=a,i[r>>2]=0,e=0),n=o-a|0,l=e-a|0,(0|a)<0?(i[t>>2]=n,i[r>>2]=l,i[s>>2]=0,e=l,l=n,a=0):l=o,(0|(o=(0|a)<(0|(o=(0|e)<(0|l)?e:l))?a:o))<=0||(i[t>>2]=l-o,i[r>>2]=e-o,i[s>>2]=a-o),0|(t=0)}function xe(e){var t,n,r,s;n=(s=0|i[(t=(e|=0)+8|0)>>2])-(0|i[e>>2])|0,i[e>>2]=n,e=(0|i[(r=e+4|0)>>2])-s|0,i[r>>2]=e,i[t>>2]=0-(e+n)}function be(e){var t,n,r=0,s=0,a=0,o=0,l=0;r=0-(s=0|i[(e|=0)>>2])|0,i[e>>2]=r,i[(t=e+8|0)>>2]=0,o=(a=0|i[(n=e+4|0)>>2])+s|0,(0|s)>0?(i[n>>2]=o,i[t>>2]=s,i[e>>2]=0,r=0,a=o):s=0,(0|a)<0?(l=r-a|0,i[e>>2]=l,s=s-a|0,i[t>>2]=s,i[n>>2]=0,o=l-s|0,r=0-s|0,(0|s)<0?(i[e>>2]=o,i[n>>2]=r,i[t>>2]=0,a=r,s=0):(a=0,o=l)):o=r,(0|(r=(0|s)<(0|(r=(0|a)<(0|o)?a:o))?s:r))<=0||(i[e>>2]=o-r,i[n>>2]=a-r,i[t>>2]=s-r)}function Se(e,t,n){n|=0;var r,s,a=0,o=0;return s=D,D=D+16|0,r=s,o=-2130706433&(t|=0)|134217728,!0&268435456==(2013265920&t)?(a=0|Gt(0|(e|=0),0|t,56),w(),a=0|function(e,t,n){e|=0,t|=0,n|=0;var r=0,s=0,a=0;if(a=D,D=D+16|0,s=a,r=0|Oe(e,t),(n+-1|0)>>>0>5)return D=a,0|(s=-1);if(r=!!(0|r),1==(0|n)&r)return D=a,0|(s=-1);do{if(!(0|_t(e,t,s))){if(r){r=(5+(0|i[21936+(n<<2)>>2])-(0|i[s>>2])|0)%5|0;break}r=(6+(0|i[21968+(n<<2)>>2])-(0|i[s>>2])|0)%6|0;break}r=-1}while(0);return s=r,D=a,0|s}(e,o,7&a),-1==(0|a)?(i[n>>2]=0,D=s,0|(o=6)):(0|We(e,o,r)&&M(23313,22484,282,22499),t=0|Gt(0|e,0|t,52),w(),t&=15,0|Oe(e,o)?Ee(r,t,a,2,n):Pe(r,t,a,2,n),D=s,0|(o=0))):(D=s,0|(o=6))}function Te(e,t,n,r){t|=0,r|=0;var a,o=0,l=0,u=0,c=0;if(a=D,D=D+16|0,function(e,t,n){e|=0,t|=0,n|=0;var r=0,a=0,o=0;o=D,D=D+32|0,a=o,function(e,t){e|=0,t|=0;var n=0,r=0,i=0;n=+s[e>>3],r=+h(+n),n=+d(+n),s[t+16>>3]=n,n=+s[e+8>>3],i=r*+h(+n),s[t>>3]=i,n=r*+d(+n),s[t+8>>3]=n}(e,a),i[t>>2]=0,s[n>>3]=5,r=+vt(16400,a),r<+s[n>>3]&&(i[t>>2]=0,s[n>>3]=r);r=+vt(16424,a),r<+s[n>>3]&&(i[t>>2]=1,s[n>>3]=r);r=+vt(16448,a),r<+s[n>>3]&&(i[t>>2]=2,s[n>>3]=r);r=+vt(16472,a),r<+s[n>>3]&&(i[t>>2]=3,s[n>>3]=r);r=+vt(16496,a),r<+s[n>>3]&&(i[t>>2]=4,s[n>>3]=r);r=+vt(16520,a),r<+s[n>>3]&&(i[t>>2]=5,s[n>>3]=r);r=+vt(16544,a),r<+s[n>>3]&&(i[t>>2]=6,s[n>>3]=r);r=+vt(16568,a),r<+s[n>>3]&&(i[t>>2]=7,s[n>>3]=r);r=+vt(16592,a),r<+s[n>>3]&&(i[t>>2]=8,s[n>>3]=r);r=+vt(16616,a),r<+s[n>>3]&&(i[t>>2]=9,s[n>>3]=r);r=+vt(16640,a),r<+s[n>>3]&&(i[t>>2]=10,s[n>>3]=r);r=+vt(16664,a),r<+s[n>>3]&&(i[t>>2]=11,s[n>>3]=r);r=+vt(16688,a),r<+s[n>>3]&&(i[t>>2]=12,s[n>>3]=r);r=+vt(16712,a),r<+s[n>>3]&&(i[t>>2]=13,s[n>>3]=r);r=+vt(16736,a),r<+s[n>>3]&&(i[t>>2]=14,s[n>>3]=r);r=+vt(16760,a),r<+s[n>>3]&&(i[t>>2]=15,s[n>>3]=r);r=+vt(16784,a),r<+s[n>>3]&&(i[t>>2]=16,s[n>>3]=r);r=+vt(16808,a),r<+s[n>>3]&&(i[t>>2]=17,s[n>>3]=r);r=+vt(16832,a),r<+s[n>>3]&&(i[t>>2]=18,s[n>>3]=r);if(r=+vt(16856,a),!(r<+s[n>>3]))return void(D=o);i[t>>2]=19,s[n>>3]=r,D=o}(e|=0,n|=0,c=a),(l=+f(+(1-.5*+s[c>>3])))<1e-16)return i[r>>2]=0,i[r+4>>2]=0,i[r+8>>2]=0,i[r+12>>2]=0,void(D=a);if(c=0|i[n>>2],o=+Ze((o=+s[15920+(24*c|0)>>3])-+Ze(+function(e,t){e|=0,t|=0;var n=0,r=0,i=0,a=0,o=0;return a=+s[t>>3],r=+h(+a),i=+s[t+8>>3]-+s[e+8>>3],o=r*+d(+i),n=+s[e>>3],+ +v(+o,+(+d(+a)*+h(+n)-+h(+i)*(r*+d(+n))))}(15600+(c<<4)|0,e))),u=0|Ve(t)?+Ze(o+-.3334731722518321):o,o=+p(+l)/.381966011250105,(0|t)>0){e=0;do{o*=2.6457513110645907,e=e+1|0}while((0|e)!=(0|t))}l=+h(+u)*o,s[r>>3]=l,u=+d(+u)*o,s[r+8>>3]=u,D=a}function we(e,t,n,r,a){t|=0,n|=0,r|=0,a|=0;var o=0,l=0;if(o=+function(e){e|=0;var t=0,n=0;return n=+s[e>>3],t=+s[e+8>>3],+ +c(+(n*n+t*t))}(e|=0),o<1e-16)return t=15600+(t<<4)|0,i[a>>2]=i[t>>2],i[a+4>>2]=i[t+4>>2],i[a+8>>2]=i[t+8>>2],void(i[a+12>>2]=i[t+12>>2]);if(l=+v(+ +s[e+8>>3],+ +s[e>>3]),(0|n)>0){e=0;do{o/=2.6457513110645907,e=e+1|0}while((0|e)!=(0|n))}r?(o/=3,n=!(0|Ve(n)),o=+g(.381966011250105*(n?o:o/2.6457513110645907))):(o=+g(.381966011250105*o),0|Ve(n)&&(l=+Ze(l+.3334731722518321))),function(e,t,n,r){e|=0,t=+t,n=+n,r|=0;var a=0,o=0,l=0,c=0;if(n<1e-16)return i[r>>2]=i[e>>2],i[r+4>>2]=i[e+4>>2],i[r+8>>2]=i[e+8>>2],void(i[r+12>>2]=i[e+12>>2]);o=t<0?t+6.283185307179586:t,o=t>=6.283185307179586?o+-6.283185307179586:o;do{if(!(o<1e-16)){if(a=+u(+(o+-3.141592653589793))<1e-16,t=+s[e>>3],a){t-=n,s[r>>3]=t,a=r;break}if(l=+h(+n),n=+d(+n),t=l*+d(+t)+ +h(+o)*(n*+h(+t)),t=+m(+((t=t>1?1:t)<-1?-1:t)),s[r>>3]=t,+u(+(t+-1.5707963267948966))<1e-16)return s[r>>3]=1.5707963267948966,void(s[r+8>>3]=0);if(+u(+(t+1.5707963267948966))<1e-16)return s[r>>3]=-1.5707963267948966,void(s[r+8>>3]=0);if(c=+h(+t),o=n*+d(+o)/c,n=+s[e>>3],t=(l-+d(+t)*+d(+n))/+h(+n)/c,l=o>1?1:o,t=t>1?1:t,(t=+s[e+8>>3]+ +v(+(l<-1?-1:l),+(t<-1?-1:t)))>3.141592653589793)do{t+=-6.283185307179586}while(t>3.141592653589793);if(t<-3.141592653589793)do{t+=6.283185307179586}while(t<-3.141592653589793);return void(s[r+8>>3]=t)}t=+s[e>>3]+n,s[r>>3]=t,a=r}while(0);if(+u(+(t+-1.5707963267948966))<1e-16)return s[a>>3]=1.5707963267948966,void(s[r+8>>3]=0);if(+u(+(t+1.5707963267948966))<1e-16)return s[a>>3]=-1.5707963267948966,void(s[r+8>>3]=0);if(t=+s[e+8>>3],t>3.141592653589793)do{t+=-6.283185307179586}while(t>3.141592653589793);if(t<-3.141592653589793)do{t+=6.283185307179586}while(t<-3.141592653589793);s[r+8>>3]=t}(15600+(t<<4)|0,+Ze(+s[15920+(24*t|0)>>3]-l),o,a)}function Me(e,t,n){t|=0,n|=0;var r,s;r=D,D=D+16|0,ee((e|=0)+4|0,s=r),we(s,0|i[e>>2],t,0,n),D=r}function Ee(e,t,n,r,a){e|=0,t|=0,n|=0,r|=0,a|=0;var o,l,u,c,A,h,d,p,f,m,g,v,_,y,x,b,S,T,w,E,C,R,N=0,P=0,L=0,I=0,U=0,B=0;if(R=D,D=D+272|0,I=R+240|0,w=R,E=R+224|0,C=R+208|0,g=R+176|0,v=R+160|0,_=R+192|0,y=R+144|0,x=R+128|0,b=R+112|0,S=R+96|0,T=R+80|0,i[(N=R+256|0)>>2]=t,i[I>>2]=i[e>>2],i[I+4>>2]=i[e+4>>2],i[I+8>>2]=i[e+8>>2],i[I+12>>2]=i[e+12>>2],Ce(I,N,w),i[a>>2]=0,(0|(I=r+n+(5==(0|r)&1)|0))<=(0|n))D=R;else{l=E+4|0,u=g+4|0,c=n+5|0,A=16880+((o=0|i[N>>2])<<2)|0,h=16960+(o<<2)|0,d=x+8|0,p=b+8|0,f=S+8|0,m=C+4|0,L=n;e:for(;;){P=w+((0|L)%5<<4)|0,i[C>>2]=i[P>>2],i[C+4>>2]=i[P+4>>2],i[C+8>>2]=i[P+8>>2],i[C+12>>2]=i[P+12>>2];do{}while(2==(0|Re(C,o,0,1)));if((0|L)>(0|n)&!!(0|Ve(t))){if(i[g>>2]=i[C>>2],i[g+4>>2]=i[C+4>>2],i[g+8>>2]=i[C+8>>2],i[g+12>>2]=i[C+12>>2],ee(l,v),r=0|i[g>>2],N=0|i[17040+(80*r|0)+(i[E>>2]<<2)>>2],i[g>>2]=i[18640+(80*r|0)+(20*N|0)>>2],(0|(P=0|i[18640+(80*r|0)+(20*N|0)+16>>2]))>0){e=0;do{he(u),e=e+1|0}while((0|e)<(0|P))}switch(P=18640+(80*r|0)+(20*N|0)+4|0,i[_>>2]=i[P>>2],i[_+4>>2]=i[P+4>>2],i[_+8>>2]=i[P+8>>2],re(_,3*(0|i[A>>2])|0),te(u,_,u),J(u),ee(u,y),U=+(0|i[h>>2]),s[x>>3]=3*U,s[d>>3]=0,B=-1.5*U,s[b>>3]=B,s[p>>3]=2.598076211353316*U,s[S>>3]=B,s[f>>3]=-2.598076211353316*U,0|i[17040+(80*(0|i[g>>2])|0)+(i[C>>2]<<2)>>2]){case 1:e=b,r=x;break;case 3:e=S,r=b;break;case 2:e=x,r=S;break;default:e=12;break e}mt(v,y,r,e,T),we(T,0|i[g>>2],o,1,a+8+(i[a>>2]<<4)|0),i[a>>2]=1+(0|i[a>>2])}if((0|L)<(0|c)&&(ee(m,g),we(g,0|i[C>>2],o,1,a+8+(i[a>>2]<<4)|0),i[a>>2]=1+(0|i[a>>2])),i[E>>2]=i[C>>2],i[E+4>>2]=i[C+4>>2],i[E+8>>2]=i[C+8>>2],i[E+12>>2]=i[C+12>>2],(0|(L=L+1|0))>=(0|I)){e=3;break}}3!=(0|e)?12==(0|e)&&M(22522,22569,571,22579):D=R}}function Ce(e,t,n){e|=0,t|=0,n|=0;var r,s=0,a=0,o=0,l=0,u=0;r=D,D=D+128|0,a=r,l=20240,u=(o=s=r+64|0)+60|0;do{i[o>>2]=i[l>>2],o=o+4|0,l=l+4|0}while((0|o)<(0|u));l=20304,u=(o=a)+60|0;do{i[o>>2]=i[l>>2],o=o+4|0,l=l+4|0}while((0|o)<(0|u));s=(u=!(0|Ve(0|i[t>>2])))?s:a,me(a=e+4|0),ge(a),0|Ve(0|i[t>>2])&&(ce(a),i[t>>2]=1+(0|i[t>>2])),i[n>>2]=i[e>>2],te(a,s,t=n+4|0),J(t),i[n+16>>2]=i[e>>2],te(a,s+12|0,t=n+20|0),J(t),i[n+32>>2]=i[e>>2],te(a,s+24|0,t=n+36|0),J(t),i[n+48>>2]=i[e>>2],te(a,s+36|0,t=n+52|0),J(t),i[n+64>>2]=i[e>>2],te(a,s+48|0,n=n+68|0),J(n),D=r}function Re(e,t,n,r){n|=0,r|=0;var s,a,o,l,u,c,A=0,h=0,d=0,p=0,f=0;if(c=D,D=D+32|0,u=c+12|0,a=c,f=(e|=0)+4|0,p=0|i[16960+((t|=0)<<2)>>2],p=(l=!!(0|r))?3*p|0:p,A=0|i[f>>2],s=0|i[(o=e+8|0)>>2],l){if((0|(A=s+A+(r=0|i[(h=e+12|0)>>2])|0))==(0|p))return D=c,0|(f=1);d=h}else A=s+A+(r=0|i[(d=e+12|0)>>2])|0;if((0|A)<=(0|p))return D=c,0|(f=0);do{if((0|r)>0){if(r=0|i[e>>2],(0|s)>0){h=18640+(80*r|0)+60|0,r=e;break}r=18640+(80*r|0)+40|0,n?(K(u,p,0,0),ne(f,u,a),de(a),te(a,u,f),h=r,r=e):(h=r,r=e)}else h=18640+(80*(0|i[e>>2])|0)+20|0,r=e}while(0);if(i[r>>2]=i[h>>2],(0|i[(A=h+16|0)>>2])>0){r=0;do{he(f),r=r+1|0}while((0|r)<(0|i[A>>2]))}return e=h+4|0,i[u>>2]=i[e>>2],i[u+4>>2]=i[e+4>>2],i[u+8>>2]=i[e+8>>2],t=0|i[16880+(t<<2)>>2],re(u,l?3*t|0:t),te(f,u,f),J(f),r=l&&((0|i[o>>2])+(0|i[f>>2])+(0|i[d>>2])|0)==(0|p)?1:2,D=c,0|(f=r)}function Ne(e,t){e|=0,t|=0;var n=0;do{n=0|Re(e,t,0,1)}while(2==(0|n));return 0|n}function Pe(e,t,n,r,a){e|=0,t|=0,n|=0,r|=0,a|=0;var o,l,u,c,A,h,d,p,f,m,g,v,_,y,x,b,S,T,w=0,E=0,C=0,R=0,N=0;if(T=D,D=D+240|0,y=T+208|0,x=T,b=T+192|0,S=T+176|0,f=T+160|0,m=T+144|0,g=T+128|0,v=T+112|0,_=T+96|0,i[(w=T+224|0)>>2]=t,i[y>>2]=i[e>>2],i[y+4>>2]=i[e+4>>2],i[y+8>>2]=i[e+8>>2],i[y+12>>2]=i[e+12>>2],De(y,w,x),i[a>>2]=0,(0|(p=r+n+(6==(0|r)&1)|0))<=(0|n))D=T;else{l=n+6|0,u=16960+((o=0|i[w>>2])<<2)|0,c=m+8|0,A=g+8|0,h=v+8|0,d=b+4|0,E=0,C=n,r=-1;e:for(;;){if(e=x+((w=(0|C)%6|0)<<4)|0,i[b>>2]=i[e>>2],i[b+4>>2]=i[e+4>>2],i[b+8>>2]=i[e+8>>2],i[b+12>>2]=i[e+12>>2],e=E,E=0|Re(b,o,0,1),(0|C)>(0|n)&!!(0|Ve(t))&&(1!=(0|e)&&(0|i[b>>2])!=(0|r))){switch(ee(x+((w+5|0)%6<<4)+4|0,S),ee(x+(w<<4)+4|0,f),R=+(0|i[u>>2]),s[m>>3]=3*R,s[c>>3]=0,N=-1.5*R,s[g>>3]=N,s[A>>3]=2.598076211353316*R,s[v>>3]=N,s[h>>3]=-2.598076211353316*R,w=0|i[y>>2],0|i[17040+(80*w|0)+(((0|r)==(0|w)?i[b>>2]:r)<<2)>>2]){case 1:e=g,r=m;break;case 3:e=v,r=g;break;case 2:e=m,r=v;break;default:e=8;break e}mt(S,f,r,e,_),0|gt(S,_)||0|gt(f,_)||(we(_,0|i[y>>2],o,1,a+8+(i[a>>2]<<4)|0),i[a>>2]=1+(0|i[a>>2]))}if((0|C)<(0|l)&&(ee(d,S),we(S,0|i[b>>2],o,1,a+8+(i[a>>2]<<4)|0),i[a>>2]=1+(0|i[a>>2])),(0|(C=C+1|0))>=(0|p)){e=3;break}r=0|i[b>>2]}3!=(0|e)?8==(0|e)&&M(22606,22569,736,22651):D=T}}function De(e,t,n){e|=0,t|=0,n|=0;var r,s=0,a=0,o=0,l=0,u=0;r=D,D=D+160|0,a=r,l=20368,u=(o=s=r+80|0)+72|0;do{i[o>>2]=i[l>>2],o=o+4|0,l=l+4|0}while((0|o)<(0|u));l=20448,u=(o=a)+72|0;do{i[o>>2]=i[l>>2],o=o+4|0,l=l+4|0}while((0|o)<(0|u));s=(u=!(0|Ve(0|i[t>>2])))?s:a,me(a=e+4|0),ge(a),0|Ve(0|i[t>>2])&&(ce(a),i[t>>2]=1+(0|i[t>>2])),i[n>>2]=i[e>>2],te(a,s,t=n+4|0),J(t),i[n+16>>2]=i[e>>2],te(a,s+12|0,t=n+20|0),J(t),i[n+32>>2]=i[e>>2],te(a,s+24|0,t=n+36|0),J(t),i[n+48>>2]=i[e>>2],te(a,s+36|0,t=n+52|0),J(t),i[n+64>>2]=i[e>>2],te(a,s+48|0,t=n+68|0),J(t),i[n+80>>2]=i[e>>2],te(a,s+60|0,n=n+84|0),J(n),D=r}function Le(e,t){return t=0|Gt(0|(e|=0),0|(t|=0),45),w(),127&t}function Ie(e,t){var n=0,r=0,i=0,s=0,a=0,o=0;if(!(!0&134217728==(-16777216&(t|=0))))return 0|(t=0);if(a=0|Gt(0|(e|=0),0|t,45),w(),(a&=127)>>>0>121)return 0|(t=0);n=0|Gt(0|e,0|t,52),w(),n&=15;do{if(0|n){for(i=1,r=0;;){if(s=0|Gt(0|e,0|t,3*(15-i|0)|0),w(),!!(0|(s&=7))&(1^r)){if(1==(0|s)&!!(0|q(a))){o=0,r=13;break}r=1}if(7==(0|s)){o=0,r=13;break}if(!(i>>>0<n>>>0)){r=9;break}i=i+1|0}if(9==(0|r)){if(15!=(0|n))break;return 0|(o=1)}if(13==(0|r))return 0|o}}while(0);for(;;){if(o=0|Gt(0|e,0|t,3*(14-n|0)|0),w(),!(!0&!(7&~o))){o=0,r=13;break}if(!(n>>>0<14)){o=1,r=13;break}n=n+1|0}return 13==(0|r)?0|o:0}function Ue(e,t,n,r){n|=0,r|=0;var s=0,a=0;if(a=0|Gt(0|(e|=0),0|(t|=0),52),w(),n>>>0>15)return 0|(r=4);if((0|(a&=15))<(0|n))return 0|(r=12);if((0|a)==(0|n))return i[r>>2]=e,i[r+4>>2]=t,0|(r=0);if(s=0|zt(0|n,0,52),s|=e,e=w()|-15728641&t,(0|a)>(0|n))do{t=0|zt(7,0,3*(14-n|0)|0),n=n+1|0,s|=t,e=w()|e}while((0|n)<(0|a));return i[r>>2]=s,i[r+4>>2]=e,0|(r=0)}function Be(e,t,n,r){n|=0,r|=0;var s=0,a=0,o=0;if(a=0|Gt(0|(e|=0),0|(t|=0),52),w(),!((0|n)<16&(0|(a&=15))<=(0|n)))return 0|(r=4);s=n-a|0,n=0|Gt(0|e,0|t,45),w();e:do{if(0|q(127&n)){t:do{if(0|a){for(n=1;!((o=0|zt(7,0,3*(15-n|0)|0))&e)&!(w()&t);){if(!(n>>>0<a>>>0))break t;n=n+1|0}n=0|At(7,0,s,((0|s)<0)<<31>>31),s=0|w();break e}}while(0);n=0|Dt(0|(n=0|Ot(0|(n=0|At(7,0,s,((0|s)<0)<<31>>31)),0|w(),5,0)),0|w(),-5,-1),n=0|Dt(0|(n=0|Bt(0|n,0|w(),6,0)),0|w(),1,0),s=0|w()}else n=0|At(7,0,s,((0|s)<0)<<31>>31),s=0|w()}while(0);return i[(o=r)>>2]=n,i[o+4>>2]=s,0|(o=0)}function Oe(e,t){var n=0,r=0,i=0;if(i=0|Gt(0|(e|=0),0|(t|=0),45),w(),!(0|q(127&i)))return 0|(i=0);i=0|Gt(0|e,0|t,52),w(),i&=15;e:do{if(i)for(r=1;;){if(n=0|Gt(0|e,0|t,3*(15-r|0)|0),w(),0|(n&=7))break e;if(!(r>>>0<i>>>0)){n=0;break}r=r+1|0}else n=0}while(0);return 0|(i=1&!(0|n))}function Fe(e,t){var n=0,r=0,i=0;if(i=0|Gt(0|(e|=0),0|(t|=0),52),w(),!(i&=15))return 0|(i=0);for(r=1;;){if(n=0|Gt(0|e,0|t,3*(15-r|0)|0),w(),0|(n&=7)){r=5;break}if(!(r>>>0<i>>>0)){n=0,r=5;break}r=r+1|0}return 5==(0|r)?0|n:0}function ke(e,t){var n=0,r=0,i=0,s=0,a=0,o=0,l=0;if(l=0|Gt(0|(e|=0),0|(t|=0),52),w(),!(l&=15))return l=e,T(0|(o=t)),0|l;for(o=1,n=0;;){r=0|zt(7,0,0|(s=3*(15-o|0)|0)),i=0|w(),a=0|Gt(0|e,0|t,0|s),w(),e=(s=0|zt(0|pe(7&a),0,0|s))|e&~r,t=(a=0|w())|t&~i;e:do{if(!n)if(!(s&r)&!(a&i))n=0;else if(r=0|Gt(0|e,0|t,52),w(),r&=15){n=1;t:for(;;){switch(a=0|Gt(0|e,0|t,3*(15-n|0)|0),w(),7&a){case 1:break t;case 0:break;default:n=1;break e}if(!(n>>>0<r>>>0)){n=1;break e}n=n+1|0}for(n=1;;){if(i=0|Gt(0|e,0|t,0|(a=3*(15-n|0)|0)),w(),s=0|zt(7,0,0|a),t&=~w(),e=e&~s|(a=0|zt(0|pe(7&i),0,0|a)),t|=w(),!(n>>>0<r>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(o>>>0<l>>>0))break;o=o+1|0}return T(0|t),0|e}function qe(e,t){var n=0,r=0,i=0,s=0,a=0;if(r=0|Gt(0|(e|=0),0|(t|=0),52),w(),!(r&=15))return r=e,T(0|(n=t)),0|r;for(n=1;a=0|Gt(0|e,0|t,0|(s=3*(15-n|0)|0)),w(),i=0|zt(7,0,0|s),t&=~w(),e=(s=0|zt(0|pe(7&a),0,0|s))|e&~i,t=w()|t,n>>>0<r>>>0;)n=n+1|0;return T(0|t),0|e}function Ge(e,t){var n=0,r=0,i=0,s=0,a=0,o=0,l=0;if(l=0|Gt(0|(e|=0),0|(t|=0),52),w(),!(l&=15))return l=e,T(0|(o=t)),0|l;for(o=1,n=0;;){r=0|zt(7,0,0|(s=3*(15-o|0)|0)),i=0|w(),a=0|Gt(0|e,0|t,0|s),w(),e=(s=0|zt(0|fe(7&a),0,0|s))|e&~r,t=(a=0|w())|t&~i;e:do{if(!n)if(!(s&r)&!(a&i))n=0;else if(r=0|Gt(0|e,0|t,52),w(),r&=15){n=1;t:for(;;){switch(a=0|Gt(0|e,0|t,3*(15-n|0)|0),w(),7&a){case 1:break t;case 0:break;default:n=1;break e}if(!(n>>>0<r>>>0)){n=1;break e}n=n+1|0}for(n=1;;){if(s=0|zt(7,0,0|(i=3*(15-n|0)|0)),a=t&~w(),t=0|Gt(0|e,0|t,0|i),w(),e=e&~s|(t=0|zt(0|fe(7&t),0,0|i)),t=a|w(),!(n>>>0<r>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(o>>>0<l>>>0))break;o=o+1|0}return T(0|t),0|e}function ze(e,t){var n=0,r=0,i=0,s=0,a=0;if(r=0|Gt(0|(e|=0),0|(t|=0),52),w(),!(r&=15))return r=e,T(0|(n=t)),0|r;for(n=1;s=0|zt(7,0,0|(a=3*(15-n|0)|0)),i=t&~w(),t=0|Gt(0|e,0|t,0|a),w(),e=(t=0|zt(0|fe(7&t),0,0|a))|e&~s,t=w()|i,n>>>0<r>>>0;)n=n+1|0;return T(0|t),0|e}function Ve(e){return(0|(e|=0))%2|0}function He(e,t,n){n|=0;var r,s=0;return r=D,D=D+16|0,s=r,(t|=0)>>>0>15?(D=r,0|(s=4)):2146435072&~i[(e|=0)+4>>2]&&2146435072&~i[e+8+4>>2]?(function(e,t,n){var r,i;r=D,D=D+16|0,Te(e|=0,t|=0,n|=0,i=r),Z(i,n+4|0),D=r}(e,t,s),t=0|function(e,t){e|=0;var n,r=0,s=0,a=0,o=0,l=0,u=0,c=0,A=0;if(n=D,D=D+64|0,u=n+40|0,s=n+24|0,a=n+12|0,o=n,zt(0|(t|=0),0,52),r=134225919|w(),!t)return(0|i[e+4>>2])>2||(0|i[e+8>>2])>2||(0|i[e+12>>2])>2?(u=0,T(0|(l=0)),D=n,0|u):(zt(0|z(e),0,45),l=w()|r,u=-1,T(0|l),D=n,0|u);if(i[u>>2]=i[e>>2],i[u+4>>2]=i[e+4>>2],i[u+8>>2]=i[e+8>>2],i[u+12>>2]=i[e+12>>2],l=u+4|0,(0|t)>0)for(e=-1;i[s>>2]=i[l>>2],i[s+4>>2]=i[l+4>>2],i[s+8>>2]=i[l+8>>2],1&t?(oe(l),i[a>>2]=i[l>>2],i[a+4>>2]=i[l+4>>2],i[a+8>>2]=i[l+8>>2],ue(a)):(le(l),i[a>>2]=i[l>>2],i[a+4>>2]=i[l+4>>2],i[a+8>>2]=i[l+8>>2],ce(a)),ne(s,a,o),J(o),c=0|zt(7,0,0|(A=3*(15-t|0)|0)),r&=~w(),e=(A=0|zt(0|ie(o),0,0|A))|e&~c,r=w()|r,(0|t)>1;)t=t+-1|0;else e=-1;e:do{if((0|i[l>>2])<=2&&(0|i[u+8>>2])<=2&&(0|i[u+12>>2])<=2){if(t=0|zt(0|(s=0|z(u)),0,45),t|=e,e=w()|-1040385&r,o=0|V(u),!(0|q(s))){if((0|o)<=0)break;for(a=0;;){if(s=0|Gt(0|t,0|e,52),w(),s&=15)for(r=1;u=0|Gt(0|t,0|e,0|(A=3*(15-r|0)|0)),w(),c=0|zt(7,0,0|A),e&=~w(),t=t&~c|(A=0|zt(0|pe(7&u),0,0|A)),e|=w(),r>>>0<s>>>0;)r=r+1|0;if((0|(a=a+1|0))==(0|o))break e}}a=0|Gt(0|t,0|e,52),w(),a&=15;t:do{if(a){r=1;n:for(;;){switch(A=0|Gt(0|t,0|e,3*(15-r|0)|0),w(),7&A){case 1:break n;case 0:break;default:break t}if(!(r>>>0<a>>>0))break t;r=r+1|0}if(0|H(s,0|i[u>>2]))for(r=1;c=0|zt(7,0,0|(u=3*(15-r|0)|0)),A=e&~w(),e=0|Gt(0|t,0|e,0|u),w(),t=t&~c|(e=0|zt(0|fe(7&e),0,0|u)),e=A|w(),r>>>0<a>>>0;)r=r+1|0;else for(r=1;u=0|Gt(0|t,0|e,0|(A=3*(15-r|0)|0)),w(),c=0|zt(7,0,0|A),e&=~w(),t=t&~c|(A=0|zt(0|pe(7&u),0,0|A)),e|=w(),r>>>0<a>>>0;)r=r+1|0}}while(0);if((0|o)>0){r=0;do{t=0|ke(t,e),e=0|w(),r=r+1|0}while((0|r)!=(0|o))}}else t=0,e=0}while(0);return A=t,T(0|(c=e)),D=n,0|A}(s,t),s=0|w(),i[n>>2]=t,i[n+4>>2]=s,!(0|t)&!(0|s)&&M(23313,22674,786,22697),D=r,0|(s=0)):(D=r,0|(s=3))}function je(e,t,n){var r,s=0,a=0,o=0;if(r=(n|=0)+4|0,a=0|Gt(0|(e|=0),0|(t|=0),52),w(),a&=15,o=0|Gt(0|e,0|t,45),w(),s=!(0|a),0|q(127&o)){if(s)return 0|(o=1);s=1}else{if(s)return 0|(o=0);s=0|i[r>>2]||0|i[n+8>>2]?1:1&!!(0|i[n+12>>2])}for(n=1;1&n?ue(r):ce(r),o=0|Gt(0|e,0|t,3*(15-n|0)|0),w(),Ae(r,7&o),n>>>0<a>>>0;)n=n+1|0;return 0|s}function We(e,t,n){n|=0;var r,s,a=0,o=0,l=0,u=0,c=0,A=0;if(s=D,D=D+16|0,r=s,A=0|Gt(0|(e|=0),0|(t|=0),45),w(),(A&=127)>>>0>121)return i[n>>2]=0,i[n+4>>2]=0,i[n+8>>2]=0,i[n+12>>2]=0,D=s,0|(A=5);e:do{if(0|q(A)&&(l=0|Gt(0|e,0|t,52),w(),0|(l&=15))){a=1;t:for(;;){switch(c=0|Gt(0|e,0|t,3*(15-a|0)|0),w(),7&c){case 5:break t;case 0:break;default:a=t;break e}if(!(a>>>0<l>>>0)){a=t;break e}a=a+1|0}for(o=1,a=t;u=0|zt(7,0,0|(t=3*(15-o|0)|0)),c=a&~w(),a=0|Gt(0|e,0|a,0|t),w(),e=e&~u|(a=0|zt(0|fe(7&a),0,0|t)),a=c|w(),o>>>0<l>>>0;)o=o+1|0}else a=t}while(0);if(c=7696+(28*A|0)|0,i[n>>2]=i[c>>2],i[n+4>>2]=i[c+4>>2],i[n+8>>2]=i[c+8>>2],i[n+12>>2]=i[c+12>>2],!(0|je(e,a,n)))return D=s,0|(A=0);if(u=n+4|0,i[r>>2]=i[u>>2],i[r+4>>2]=i[u+4>>2],i[r+8>>2]=i[u+8>>2],l=0|Gt(0|e,0|a,52),w(),c=15&l,1&l?(ce(u),l=c+1|0):l=c,0|q(A)){e:do{if(c)for(t=1;;){if(o=0|Gt(0|e,0|a,3*(15-t|0)|0),w(),0|(o&=7)){a=o;break e}if(!(t>>>0<c>>>0)){a=0;break}t=t+1|0}else a=0}while(0);a=4==(0|a)&1}else a=0;if(0|Re(n,l,a,0)){if(0|q(A))do{}while(0|Re(n,l,0,0));(0|l)!=(0|c)&&le(u)}else(0|l)!=(0|c)&&(i[u>>2]=i[r>>2],i[u+4>>2]=i[r+4>>2],i[u+8>>2]=i[r+8>>2]);return D=s,0|(A=0)}function Xe(e,t,n){n|=0;var r,i,s=0;return i=D,D=D+16|0,0|(s=0|We(e|=0,t|=0,r=i))?(D=i,0|s):(s=0|Gt(0|e,0|t,52),w(),Me(r,15&s,n),D=i,0|(s=0))}function Qe(e,t,n){n|=0;var r,i=0,s=0,a=0;if(r=D,D=D+16|0,0|(i=0|We(e|=0,t|=0,a=r)))return D=r,0|(a=i);i=0|Gt(0|e,0|t,45),w(),i=!(0|q(127&i)),s=0|Gt(0|e,0|t,52),w(),s&=15;e:do{if(!i){if(0|s)for(i=1;;){if(!(!((0|zt(7,0,3*(15-i|0)|0))&e)&!(w()&t)))break e;if(!(i>>>0<s>>>0))break;i=i+1|0}return Ee(a,s,0,5,n),D=r,0|0}}while(0);return Pe(a,s,0,6,n),D=r,0|0}function Ye(e,t){t|=0;var n=0,r=0,s=0,a=0,o=0,l=0,u=0;if((e|=0)>>>0>15)return 0|(l=4);if(zt(0|e,0,52),l=134225919|w(),!e){n=0,r=0;do{0|q(r)&&(zt(0|r,0,45),o=l|w(),i[(e=t+(n<<3)|0)>>2]=-1,i[e+4>>2]=o,n=n+1|0),r=r+1|0}while(122!=(0|r));return 0|(n=0)}n=0,o=0;do{if(0|q(o)){for(zt(0|o,0,45),r=1,s=-1,a=l|w();s&=~(u=0|zt(7,0,3*(15-r|0)|0)),a&=~w(),(0|r)!=(0|e);)r=r+1|0;i[(u=t+(n<<3)|0)>>2]=s,i[u+4>>2]=a,n=n+1|0}o=o+1|0}while(122!=(0|o));return 0|(n=0)}function $e(e,t,n,r){e|=0,r|=0;var s=0,a=0;s=0|Gt(0|(t|=0),0|(n|=0),52),w(),!(0|t)&!(0|n)|(0|r)>15|(0|(s&=15))>(0|r)?(r=-1,s=-1,t=0,n=0):(a=0|function(e,t,n,r){return e|=0,t|=0,(0|(r|=0))<(0|(n|=0))?(r=e,T(0|(n=t)),0|r):(n=0|zt(-1,-1,3+(3*(r-n|0)|0)|0),r=0|zt(0|~n,0|~w(),3*(15-r|0)|0),n=~w()&t,r=~r&e,T(0|n),0|r)}(t,n,s+1|0,r),n=-15728641&w(),t=0|zt(0|r,0,52),r=(a=!(0|Oe(t|=a,n|=w())))?-1:r),i[(a=e)>>2]=t,i[a+4>>2]=n,i[e+8>>2]=s,i[e+12>>2]=r}function Ke(e){var t,n=0,r=0,s=0,a=0,o=0,l=0,u=0,c=0;if(!(!(0|(n=0|i[(r=e|=0)>>2]))&!(0|(r=0|i[r+4>>2]))||(s=0|Gt(0|n,0|r,52),w(),n=0|Dt(0|(u=0|zt(1,0,3*(15^(s&=15))|0)),0|w(),0|n,0|r),r=0|w(),i[(u=e)>>2]=n,i[u+4>>2]=r,(0|s)<(0|(l=0|i[(u=e+8|0)>>2]))))){for(t=e+12|0,o=s;;){if((0|o)==(0|l)){s=5;break}if(c=(0|o)==(0|i[t>>2]),s=0|Gt(0|n,0|r,0|(a=3*(15-o|0)|0)),w(),c&1==(0|(s&=7))&!0){s=7;break}if(!(7==(0|s)&!0)){s=10;break}if(n=0|Dt(0|n,0|r,0|(c=0|zt(1,0,0|a)),0|w()),r=0|w(),i[(c=e)>>2]=n,i[c+4>>2]=r,!((0|o)>(0|l))){s=10;break}o=o+-1|0}if(5==(0|s))return i[(c=e)>>2]=0,i[c+4>>2]=0,i[u>>2]=-1,void(i[t>>2]=-1);if(7==(0|s))return l=0|Dt(0|n,0|r,0|(l=0|zt(1,0,0|a)),0|w()),u=0|w(),i[(c=e)>>2]=l,i[c+4>>2]=u,void(i[t>>2]=o+-1)}}function Ze(e){var t;return t=(e=+e)<0?e+6.283185307179586:e,+(e>=6.283185307179586?t+-6.283185307179586:t)}function Je(e,t){return t|=0,+u(+(+s[(e|=0)>>3]-+s[t>>3]))<17453292519943298e-27?0|(t=+u(+(+s[e+8>>3]-+s[t+8>>3]))<17453292519943298e-27):0|(t=0)}function et(e,t){e|=0;var n,r,i,a=0;return r=+s[(t|=0)>>3],n=+s[e>>3],a=(i=+d(.5*(r-n)))*i+(a=+d(.5*(+s[t+8>>3]-+s[e+8>>3])))*(+h(+r)*+h(+n)*a),2*+v(+ +c(+a),+ +c(+(1-a)))*6371.007180918475}function tt(e,t){t|=0;var n=0;return(e|=0)>>>0>15?0|(t=4):(n=0|Ot(0|(n=0|At(7,0,e,((0|e)<0)<<31>>31)),0|w(),120,0),e=0|w(),i[t>>2]=2|n,i[t+4>>2]=e,0|(t=0))}function nt(e,t,n){e|=0,n|=0;var r,i,a,o,l=0,u=0,A=0,f=0,m=0,_=0;return _=+s[(t|=0)>>3],a=+s[e>>3],m=+d(.5*(_-a)),A=+s[t+8>>3],i=+s[e+8>>3],f=+d(.5*(A-i)),r=+h(+a),o=+h(+_),f=2*+v(+ +c(+(f=m*m+f*(o*r*f))),+ +c(+(1-f))),m=+s[n>>3],_=+d(.5*(m-_)),l=+s[n+8>>3],A=+d(.5*(l-A)),u=+h(+m),A=2*+v(+ +c(+(A=_*_+A*(o*u*A))),+ +c(+(1-A))),m=+d(.5*(a-m)),l=+d(.5*(i-l)),l=2*+v(+ +c(+(l=m*m+l*(r*u*l))),+ +c(+(1-l))),4*+g(+ +c(+ +p(.5*(u=.5*(f+A+l)))*+p(.5*(u-f))*+p(.5*(u-A))*+p(.5*(u-l))))}function rt(e,t,n){n|=0;var r,a,o,l=0,u=0;if(o=D,D=D+192|0,a=o,0|(u=0|Xe(e|=0,t|=0,r=o+168|0)))return D=o,0|(n=u);if(0|Qe(e,t,a)&&M(23313,22742,386,22751),(0|(t=0|i[a>>2]))>0){if(l=+nt(a+8|0,a+8+((1!=(0|t)&1)<<4)|0,r)+0,1!=(0|t)){e=1;do{l+=+nt(a+8+((u=e)<<4)|0,a+8+((0|(e=e+1|0))%(0|t)<<4)|0,r)}while((0|e)<(0|t))}}else l=0;return s[n>>3]=l,D=o,0|(n=0)}function it(e){e|=0;var t,n,r=0;return(t=0|Pt(1,12))||M(22832,22787,49,22845),0|(r=0|i[(n=e+4|0)>>2])?(i[(r=r+8|0)>>2]=t,i[n>>2]=t,0|t):(0|i[e>>2]&&M(22862,22787,61,22885),i[(r=e)>>2]=t,i[n>>2]=t,0|t)}function st(e,t){e|=0,t|=0;var n,r;return(r=0|Rt(24))||M(22899,22787,78,22913),i[r>>2]=i[t>>2],i[r+4>>2]=i[t+4>>2],i[r+8>>2]=i[t+8>>2],i[r+12>>2]=i[t+12>>2],i[r+16>>2]=0,0|(n=0|i[(t=e+4|0)>>2])?(i[n+16>>2]=r,i[t>>2]=r,0|r):(0|i[e>>2]&&M(22928,22787,82,22913),i[e>>2]=r,i[t>>2]=r,0|r)}function at(e){var t=0,n=0,r=0,s=0;if(e|=0)for(r=1;;){if(0|(t=0|i[e>>2]))do{if(0|(n=0|i[t>>2]))do{s=n,n=0|i[n+16>>2],Nt(s)}while(0|n);s=t,t=0|i[t+8>>2],Nt(s)}while(0|t);if(t=e,e=0|i[e+8>>2],r||Nt(t),!e)break;r=0}}function ot(e){var t,n,r=0,a=0,o=0,l=0,c=0,A=0,h=0,d=0,p=0,f=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0,S=0,T=0,w=0,E=0,C=0,R=0,N=0,P=0,D=0,L=0,I=0,U=0,B=0;if(0|i[(l=(e|=0)+8|0)>>2])return 0|(B=1);if(!(o=0|i[e>>2]))return 0|(B=0);r=o,a=0;do{a=a+1|0,r=0|i[r+8>>2]}while(0|r);if(a>>>0<2)return 0|(B=0);(n=0|Rt(a<<2))||M(22948,22787,317,22967),(t=0|Rt(a<<5))||M(22989,22787,321,22967),i[e>>2]=0,i[(C=e+4|0)>>2]=0,i[l>>2]=0,a=0,I=0,E=0,m=0;e:for(;;){if(f=0|i[o>>2]){c=0,A=f;do{if(d=+s[A+8>>3],r=A,A=0|i[A+16>>2],h=+s[(l=(p=!(0|A))?f:A)+8>>3],+u(+(d-h))>3.141592653589793){B=14;break}c+=(h-d)*(+s[r>>3]+ +s[l>>3])}while(!p);if(14==(0|B)){B=0,c=0,r=f;do{w=+s[r+8>>3],D=0|i[(L=r+16|0)>>2],T=+s[(D=0|D?D:f)+8>>3],c+=(+s[r>>3]+ +s[D>>3])*((T<0?T+6.283185307179586:T)-(w<0?w+6.283185307179586:w)),r=0|i[(0|r?L:o)>>2]}while(0|r)}c>0?(i[n+(I<<2)>>2]=o,I=I+1|0,l=E,r=m):B=19}else B=19;if(19==(0|B)){B=0;do{if(!a){if(m){l=C,A=m+8|0,r=o,a=e;break}if(0|i[e>>2]){B=27;break e}l=C,A=e,r=o,a=e;break}if(0|i[(r=a+8|0)>>2]){B=21;break e}if(!(a=0|Pt(1,12))){B=23;break e}i[r>>2]=a,l=a+4|0,A=a,r=m}while(0);if(i[A>>2]=o,i[l>>2]=o,A=t+(E<<5)|0,p=0|i[o>>2]){for(s[(f=t+(E<<5)+8|0)>>3]=17976931348623157e292,s[(m=t+(E<<5)+24|0)>>3]=17976931348623157e292,s[A>>3]=-17976931348623157e292,s[(g=t+(E<<5)+16|0)>>3]=-17976931348623157e292,b=17976931348623157e292,S=-17976931348623157e292,l=0,v=p,d=17976931348623157e292,y=17976931348623157e292,x=-17976931348623157e292,h=-17976931348623157e292;c=+s[v>>3],w=+s[v+8>>3],v=0|i[v+16>>2],T=+s[((_=!(0|v))?p:v)+8>>3],c<d&&(s[f>>3]=c,d=c),w<y&&(s[m>>3]=w,y=w),c>x?s[A>>3]=c:c=x,w>h&&(s[g>>3]=w,h=w),b=w>0&w<b?w:b,S=w<0&w>S?w:S,l|=+u(+(w-T))>3.141592653589793,!_;)x=c;l&&(s[g>>3]=S,s[m>>3]=b)}else i[A>>2]=0,i[A+4>>2]=0,i[A+8>>2]=0,i[A+12>>2]=0,i[A+16>>2]=0,i[A+20>>2]=0,i[A+24>>2]=0,i[A+28>>2]=0;l=E+1|0}if(o=0|i[(L=o+8|0)>>2],i[L>>2]=0,!o){B=45;break}E=l,m=r}if(21==(0|B))M(22765,22787,35,22799);else if(23==(0|B))M(22819,22787,37,22799);else if(27==(0|B))M(22862,22787,61,22885);else if(45==(0|B)){e:do{if((0|I)>0){for(L=!(0|l),P=l<<2,D=!(0|e),N=0,r=0;;){if(R=0|i[n+(N<<2)>>2],L)B=73;else{if(!(E=0|Rt(P))){B=50;break}if(!(C=0|Rt(P))){B=52;break}t:do{if(D)a=0;else{for(l=0,a=0,A=e;o=t+(l<<5)|0,0|lt(0|i[A>>2],o,0|i[R>>2])?(i[E+(a<<2)>>2]=A,i[C+(a<<2)>>2]=o,_=a+1|0):_=a,A=0|i[A+8>>2];)l=l+1|0,a=_;if((0|_)>0)if(o=0|i[E>>2],1==(0|_))a=o;else for(g=0,v=-1,a=o,m=o;;){for(p=0|i[m>>2],o=0,A=0;f=(0|(l=0|i[i[E+(A<<2)>>2]>>2]))==(0|p)?o:o+(1<(l,0|i[C+(A<<2)>>2],0|i[p>>2]))|0,(0|(A=A+1|0))!=(0|_);)o=f;if(a=(l=(0|f)>(0|v))?m:a,(0|(o=g+1|0))==(0|_))break t;g=o,v=l?f:v,m=0|i[E+(o<<2)>>2]}else a=0}}while(0);if(Nt(E),Nt(C),a){if(o=0|i[(l=a+4|0)>>2])a=o+8|0;else if(0|i[a>>2]){B=70;break}i[a>>2]=R,i[l>>2]=R}else B=73}if(73==(0|B)){if(B=0,0|(r=0|i[R>>2]))do{C=r,r=0|i[r+16>>2],Nt(C)}while(0|r);Nt(R),r=1}if((0|(N=N+1|0))>=(0|I)){U=r;break e}}50==(0|B)?M(23004,22787,249,23023):52==(0|B)?M(23042,22787,252,23023):70==(0|B)&&M(22862,22787,61,22885)}else U=0}while(0);return Nt(n),Nt(t),0|(B=U)}return 0}function lt(e,t,n){e|=0;var r=0,a=0,o=0,l=0,u=0,c=0,A=0,h=0;if(!(0|Q(t|=0,n|=0)))return 0|(e=0);if(t=0|X(t),r=+s[n>>3],a=t&(a=+s[n+8>>3])<0?a+6.283185307179586:a,!(e=0|i[e>>2]))return 0|(e=0);if(t){t=0,A=a,n=e;e:for(;;){for(;l=+s[n>>3],a=+s[n+8>>3],h=0|i[(n=n+16|0)>>2],o=+s[(h=0|h?h:e)>>3],u=+s[h+8>>3],l>o?(c=l,l=u):(c=o,o=l,l=a,a=u),(r=r==o|r==c?r+2220446049250313e-31:r)<o|r>c;)if(!(n=0|i[n>>2])){n=22;break e}if(((c=(u=l<0?l+6.283185307179586:l)+(r-o)/(c-o)*((l=a<0?a+6.283185307179586:a)-u))<0?c+6.283185307179586:c)>(A=u==A|l==A?A+-2220446049250313e-31:A)&&(t^=1),!(n=0|i[n>>2])){n=22;break}}if(22==(0|n))return 0|t}else{t=0,A=a,n=e;e:for(;;){for(;l=+s[n>>3],a=+s[n+8>>3],h=0|i[(n=n+16|0)>>2],o=+s[(h=0|h?h:e)>>3],u=+s[h+8>>3],l>o?(c=l,l=u):(c=o,o=l,l=a,a=u),(r=r==o|r==c?r+2220446049250313e-31:r)<o|r>c;)if(!(n=0|i[n>>2])){n=22;break e}if(l+(r-o)/(c-o)*(a-l)>(A=l==A|a==A?A+-2220446049250313e-31:A)&&(t^=1),!(n=0|i[n>>2])){n=22;break}}if(22==(0|n))return 0|t}return 0}function ut(e,t,n,s,a){n|=0,s|=0,a|=0;var o,l,u,c,A=0,h=0,d=0,p=0,f=0,m=0,g=0,v=0,_=0,y=0;if(c=D,D=D+32|0,y=c+16|0,u=c,A=0|Gt(0|(e|=0),0|(t|=0),52),w(),A&=15,g=0|Gt(0|n,0|s,52),w(),(0|A)!=(15&g))return D=c,0|(y=12);if(f=0|Gt(0|e,0|t,45),w(),f&=127,m=0|Gt(0|n,0|s,45),w(),f>>>0>121|(m&=127)>>>0>121)return D=c,0|(y=5);if(g=(0|f)!=(0|m)){if(7==(0|(d=0|W(f,m))))return D=c,0|(y=1);7==(0|(p=0|W(m,f)))?M(23066,23090,161,23100):(v=d,h=p)}else v=0,h=0;o=0|q(f),l=0|q(m),i[y>>2]=0,i[y+4>>2]=0,i[y+8>>2]=0,i[y+12>>2]=0;do{if(v){if(d=(0|(m=0|i[4272+(28*f|0)+(v<<2)>>2]))>0,l)if(d){f=0,p=n,d=s;do{p=0|Ge(p,d),d=0|w(),1==(0|(h=0|fe(h)))&&(h=0|fe(1)),f=f+1|0}while((0|f)!=(0|m));m=h,f=p,p=d}else m=h,f=n,p=s;else if(d){f=0,p=n,d=s;do{p=0|ze(p,d),d=0|w(),h=0|fe(h),f=f+1|0}while((0|f)!=(0|m));m=h,f=p,p=d}else m=h,f=n,p=s;if(je(f,p,y),g||M(23115,23090,191,23100),(d=!!(0|o))&(h=!!(0|l))&&M(23142,23090,192,23100),d){if(7==(0|(h=0|Fe(e,t)))){A=5;break}if(0|r[21872+(7*h|0)+v|0]){A=1;break}f=p=0|i[21040+(28*h|0)+(v<<2)>>2]}else if(h){if(7==(0|(h=0|Fe(f,p)))){A=5;break}if(0|r[21872+(7*h|0)+m|0]){A=1;break}f=0,p=0|i[21040+(28*m|0)+(h<<2)>>2]}else f=0,p=0;if((f|p)<0)A=5;else{if((0|p)>0){d=y+4|0,h=0;do{de(d),h=h+1|0}while((0|h)!=(0|p))}if(i[u>>2]=0,i[u+4>>2]=0,i[u+8>>2]=0,Ae(u,v),0|A)for(;0|Ve(A)?ue(u):ce(u),(0|A)>1;)A=A+-1|0;if((0|f)>0){A=0;do{de(u),A=A+1|0}while((0|A)!=(0|f))}te(_=y+4|0,u,_),J(_),_=51}}else if(je(n,s,y),!!(0|o)&!!(0|l))if((0|m)!=(0|f)&&M(23173,23090,261,23100),7==(0|(h=0|Fe(e,t)))|7==(0|(A=0|Fe(n,s))))A=5;else if(0|r[21872+(7*h|0)+A|0])A=1;else if((0|(h=0|i[21040+(28*h|0)+(A<<2)>>2]))>0){d=y+4|0,A=0;do{de(d),A=A+1|0}while((0|A)!=(0|h));_=51}else _=51;else _=51}while(0);return 51==(0|_)&&(A=y+4|0,i[a>>2]=i[A>>2],i[a+4>>2]=i[A+4>>2],i[a+8>>2]=i[A+8>>2],A=0),D=c,0|(y=A)}function ct(e,t,n,r){n|=0,r|=0;var s,a,o,l=0,u=0,c=0,A=0,h=0,d=0,p=0,f=0,m=0,g=0,v=0,_=0,y=0;if(o=D,D=D+48|0,s=o+36|0,c=o+24|0,A=o+12|0,h=o,l=0|Gt(0|(e|=0),0|(t|=0),52),w(),l&=15,p=0|Gt(0|e,0|t,45),w(),(p&=127)>>>0>121)return D=o,0|(r=5);if(a=0|q(p),zt(0|l,0,52),g=134225919|w(),i[(u=r)>>2]=-1,i[u+4>>2]=g,!l)return 7==(0|(l=0|ie(n)))||127==(0|(l=0|j(p,l)))?(D=o,0|(g=1)):(f=0|zt(0|l,0,45),m=0|w(),m=-1040385&i[(p=r)+4>>2]|m,i[(g=r)>>2]=i[p>>2]|f,i[g+4>>2]=m,D=o,0|(g=0));for(i[s>>2]=i[n>>2],i[s+4>>2]=i[n+4>>2],i[s+8>>2]=i[n+8>>2],n=l;;){if(u=n,n=n+-1|0,i[c>>2]=i[s>>2],i[c+4>>2]=i[s+4>>2],i[c+8>>2]=i[s+8>>2],0|Ve(u)){if(0|(l=0|se(s))){n=13;break}i[A>>2]=i[s>>2],i[A+4>>2]=i[s+4>>2],i[A+8>>2]=i[s+8>>2],ue(A)}else{if(0|(l=0|ae(s))){n=13;break}i[A>>2]=i[s>>2],i[A+4>>2]=i[s+4>>2],i[A+8>>2]=i[s+8>>2],ce(A)}if(ne(c,A,h),J(h),_=0|i[(l=r)>>2],l=0|i[l+4>>2],v=0|zt(7,0,0|(y=3*(15-u|0)|0)),l&=~w(),y=0|zt(0|ie(h),0,0|y),l=w()|l,i[(g=r)>>2]=y|_&~v,i[g+4>>2]=l,(0|u)<=1){n=14;break}}e:do{if(13!=(0|n)&&14==(0|n))if((0|i[s>>2])<=1&&(0|i[s+4>>2])<=1&&(0|i[s+8>>2])<=1){h=127==(0|(l=0|j(p,n=0|ie(s))))?0:0|q(l);t:do{if(n){if(a){if(7==(0|(l=0|Fe(e,t)))){l=5;break e}if((0|(u=0|i[21248+(28*l|0)+(n<<2)>>2]))>0){l=n,n=0;do{l=0|pe(l),n=n+1|0}while((0|n)!=(0|u))}else l=n;if(1==(0|l)){l=9;break e}127==(0|(n=0|j(p,l)))&&M(23200,23090,411,23230),0|q(n)?M(23245,23090,412,23230):(m=n,f=u,d=l)}else m=l,f=0,d=n;if((0|(A=0|i[4272+(28*p|0)+(d<<2)>>2]))<=-1&&M(23276,23090,419,23230),!h){if((0|f)<0){l=5;break e}if(0|f){l=0,n=0|i[(u=r)>>2],u=0|i[u+4>>2];do{n=0|qe(n,u),u=0|w(),i[(y=r)>>2]=n,i[y+4>>2]=u,l=l+1|0}while((0|l)<(0|f))}if((0|A)<=0){l=m,n=58;break}for(l=0,n=0|i[(u=r)>>2],u=0|i[u+4>>2];;)if(n=0|qe(n,u),u=0|w(),i[(y=r)>>2]=n,i[y+4>>2]=u,(0|(l=l+1|0))==(0|A)){l=m,n=58;break t}}if(7==(0|(c=0|W(m,p)))&&M(23066,23090,428,23230),n=0|i[(l=r)>>2],l=0|i[l+4>>2],(0|A)>0){u=0;do{n=0|qe(n,l),l=0|w(),i[(y=r)>>2]=n,i[y+4>>2]=l,u=u+1|0}while((0|u)!=(0|A))}if(7==(0|(l=0|Fe(n,l)))&&M(23313,23090,440,23230),n=0|G(m),(0|(n=0|i[(n?21664:21456)+(28*c|0)+(l<<2)>>2]))<0&&M(23313,23090,454,23230),n){l=0,u=0|i[(c=r)>>2],c=0|i[c+4>>2];do{u=0|ke(u,c),c=0|w(),i[(y=r)>>2]=u,i[y+4>>2]=c,l=l+1|0}while((0|l)<(0|n));l=m,n=58}else l=m,n=58}else if(!!(0|a)&!!(0|h)){if(7==(0|(n=0|Fe(e,t)))|7==(0|(u=0|Fe(0|i[(u=r)>>2],0|i[u+4>>2])))){l=5;break e}if((0|(u=0|i[21248+(28*n|0)+(u<<2)>>2]))<0){l=5;break e}if(u){n=0,c=0|i[(A=r)>>2],A=0|i[A+4>>2];do{c=0|qe(c,A),A=0|w(),i[(y=r)>>2]=c,i[y+4>>2]=A,n=n+1|0}while((0|n)<(0|u));n=58}else n=59}else n=58}while(0);if(58==(0|n)&&h&&(n=59),59==(0|n)&&1==(0|Fe(0|i[(y=r)>>2],0|i[y+4>>2]))){l=9;break}v=0|i[(y=r)>>2],y=-1040385&i[y+4>>2],_=0|zt(0|l,0,45),y|=w(),i[(l=r)>>2]=v|_,i[l+4>>2]=y,l=0}else l=1}while(0);return D=o,0|(y=l)}function At(e,t,n,r){e|=0,t|=0;var i=0,s=0,a=0;if(!(0|(n|=0))&!(0|(r|=0)))return s=1,T(0|(i=0)),0|s;s=e,i=t,e=1,t=0;do{e=0|Ot(0|((a=!0&!(1&n))?1:s),0|(a?0:i),0|e,0|t),t=0|w(),n=0|qt(0|n,0|r,1),r=0|w(),s=0|Ot(0|s,0|i,0|s,0|i),i=0|w()}while(!(!(0|n)&!(0|r)));return T(0|t),0|e}function ht(e,t,n){e|=0;var r,a=0,o=0,l=0,u=0,c=0,A=0,h=0,d=0,p=0;if(!(0|Q(t|=0,n|=0)))return 0|(p=0);if(t=0|X(t),a=+s[n>>3],o=t&(o=+s[n+8>>3])<0?o+6.283185307179586:o,(0|(p=0|i[e>>2]))<=0)return 0|(p=0);if(r=0|i[e+4>>2],t){t=0,d=o,n=-1,e=0;e:for(;;){for(h=e;u=+s[r+(h<<4)>>3],o=+s[r+(h<<4)+8>>3],l=+s[r+((e=(n+2|0)%(0|p)|0)<<4)>>3],c=+s[r+(e<<4)+8>>3],u>l?(A=u,u=c):(A=l,l=u,u=o,o=c),(a=a==l|a==A?a+2220446049250313e-31:a)<l|a>A;){if((0|(n=h+1|0))>=(0|p)){n=22;break e}e=h,h=n,n=e}if(((A=(c=u<0?u+6.283185307179586:u)+(a-l)/(A-l)*((u=o<0?o+6.283185307179586:o)-c))<0?A+6.283185307179586:A)>(d=c==d|u==d?d+-2220446049250313e-31:d)&&(t^=1),(0|(e=h+1|0))>=(0|p)){n=22;break}n=h}if(22==(0|n))return 0|t}else{t=0,d=o,n=-1,e=0;e:for(;;){for(h=e;u=+s[r+(h<<4)>>3],o=+s[r+(h<<4)+8>>3],l=+s[r+((e=(n+2|0)%(0|p)|0)<<4)>>3],c=+s[r+(e<<4)+8>>3],u>l?(A=u,u=c):(A=l,l=u,u=o,o=c),(a=a==l|a==A?a+2220446049250313e-31:a)<l|a>A;){if((0|(n=h+1|0))>=(0|p)){n=22;break e}e=h,h=n,n=e}if(u+(a-l)/(A-l)*(o-u)>(d=u==d|o==d?d+-2220446049250313e-31:d)&&(t^=1),(0|(e=h+1|0))>=(0|p)){n=22;break}n=h}if(22==(0|n))return 0|t}return 0}function dt(e,t){t|=0;var n,r,a,o,l,c=0,A=0,h=0,d=0,p=0,f=0,m=0,g=0,v=0,_=0,y=0,x=0;if(!(r=0|i[(e|=0)>>2]))return i[t>>2]=0,i[t+4>>2]=0,i[t+8>>2]=0,i[t+12>>2]=0,i[t+16>>2]=0,i[t+20>>2]=0,i[t+24>>2]=0,void(i[t+28>>2]=0);if(s[(a=t+8|0)>>3]=17976931348623157e292,s[(o=t+24|0)>>3]=17976931348623157e292,s[t>>3]=-17976931348623157e292,s[(l=t+16|0)>>3]=-17976931348623157e292,!((0|r)<=0)){for(n=0|i[e+4>>2],g=17976931348623157e292,v=-17976931348623157e292,_=0,e=-1,d=17976931348623157e292,p=17976931348623157e292,m=-17976931348623157e292,A=-17976931348623157e292,y=0;c=+s[n+(y<<4)>>3],f=+s[n+(y<<4)+8>>3],h=+s[n+(((0|(e=e+2|0))==(0|r)?0:e)<<4)+8>>3],c<d&&(s[a>>3]=c,d=c),f<p&&(s[o>>3]=f,p=f),c>m?s[t>>3]=c:c=m,f>A&&(s[l>>3]=f,A=f),g=f>0&f<g?f:g,v=f<0&f>v?f:v,_|=+u(+(f-h))>3.141592653589793,(0|(e=y+1|0))!=(0|r);)x=y,m=c,y=e,e=x;_&&(s[l>>3]=v,s[o>>3]=g)}}function pt(e,t){t|=0;var n,r=0,a=0,o=0,l=0,c=0,A=0,h=0,d=0,p=0,f=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0,S=0,T=0,w=0,M=0;if(v=0|i[(e|=0)>>2]){if(s[(_=t+8|0)>>3]=17976931348623157e292,s[(y=t+24|0)>>3]=17976931348623157e292,s[t>>3]=-17976931348623157e292,s[(x=t+16|0)>>3]=-17976931348623157e292,(0|v)>0){for(o=0|i[e+4>>2],m=17976931348623157e292,g=-17976931348623157e292,a=0,r=-1,h=17976931348623157e292,d=17976931348623157e292,f=-17976931348623157e292,c=-17976931348623157e292,b=0;l=+s[o+(b<<4)>>3],p=+s[o+(b<<4)+8>>3],A=+s[o+(((0|(w=r+2|0))==(0|v)?0:w)<<4)+8>>3],l<h&&(s[_>>3]=l,h=l),p<d&&(s[y>>3]=p,d=p),l>f?s[t>>3]=l:l=f,p>c&&(s[x>>3]=p,c=p),m=p>0&p<m?p:m,g=p<0&p>g?p:g,a|=+u(+(p-A))>3.141592653589793,(0|(r=b+1|0))!=(0|v);)w=b,f=l,b=r,r=w;a&&(s[x>>3]=g,s[y>>3]=m)}}else i[t>>2]=0,i[t+4>>2]=0,i[t+8>>2]=0,i[t+12>>2]=0,i[t+16>>2]=0,i[t+20>>2]=0,i[t+24>>2]=0,i[t+28>>2]=0;if(!((0|(r=0|i[(w=e+8|0)>>2]))<=0)){n=e+12|0,T=0;do{if(o=0|i[n>>2],a=T,y=t+((T=T+1|0)<<5)|0,x=0|i[o+(a<<3)>>2]){if(s[(b=t+(T<<5)+8|0)>>3]=17976931348623157e292,s[(e=t+(T<<5)+24|0)>>3]=17976931348623157e292,s[y>>3]=-17976931348623157e292,s[(S=t+(T<<5)+16|0)>>3]=-17976931348623157e292,(0|x)>0){for(v=0|i[o+(a<<3)+4>>2],m=17976931348623157e292,g=-17976931348623157e292,o=0,a=-1,_=0,h=17976931348623157e292,d=17976931348623157e292,p=-17976931348623157e292,c=-17976931348623157e292;l=+s[v+(_<<4)>>3],f=+s[v+(_<<4)+8>>3],A=+s[v+(((0|(a=a+2|0))==(0|x)?0:a)<<4)+8>>3],l<h&&(s[b>>3]=l,h=l),f<d&&(s[e>>3]=f,d=f),l>p?s[y>>3]=l:l=p,f>c&&(s[S>>3]=f,c=f),m=f>0&f<m?f:m,g=f<0&f>g?f:g,o|=+u(+(f-A))>3.141592653589793,(0|(a=_+1|0))!=(0|x);)M=_,_=a,p=l,a=M;o&&(s[S>>3]=g,s[e>>3]=m)}}else i[y>>2]=0,i[y+4>>2]=0,i[y+8>>2]=0,i[y+12>>2]=0,i[y+16>>2]=0,i[y+20>>2]=0,i[y+24>>2]=0,i[y+28>>2]=0,r=0|i[w>>2]}while((0|T)<(0|r))}}function ft(e,t,n){var r=0,s=0,a=0;if(!(0|ht(e|=0,t|=0,n|=0)))return 0|(s=0);if((0|i[(s=e+8|0)>>2])<=0)return 0|(s=1);for(r=e+12|0,e=0;;){if(a=e,e=e+1|0,0|ht((0|i[r>>2])+(a<<3)|0,t+(e<<5)|0,n)){e=0,r=6;break}if((0|e)>=(0|i[s>>2])){e=1,r=6;break}}return 6==(0|r)?0|e:0}function mt(e,t,n,r,i){t|=0,n|=0,r|=0,i|=0;var a,o,l,u,c,A,h,d=0;u=+s[(e|=0)>>3],l=+s[t>>3]-u,o=+s[e+8>>3],a=+s[t+8>>3]-o,A=+s[n>>3],d=((d=+s[r>>3]-A)*(o-(h=+s[n+8>>3]))-(u-A)*(c=+s[r+8>>3]-h))/(l*c-a*d),s[i>>3]=u+l*d,s[i+8>>3]=o+a*d}function gt(e,t){return t|=0,+u(+(+s[(e|=0)>>3]-+s[t>>3]))<1.1920928955078125e-7?0|(t=+u(+(+s[e+8>>3]-+s[t+8>>3]))<1.1920928955078125e-7):0|(t=0)}function vt(e,t){t|=0;var n,r,i;return+((i=+s[(e|=0)>>3]-+s[t>>3])*i+(r=+s[e+8>>3]-+s[t+8>>3])*r+(n=+s[e+16>>3]-+s[t+16>>3])*n)}function _t(e,t,n){n|=0;var r,s,a,o,l=0,u=0,c=0;if(o=D,D=D+32|0,c=o,0|(l=0|We(e|=0,t|=0,s=o+16|0)))return D=o,0|(n=l);r=0|Le(e,t),a=0|Fe(e,t),function(e,t){e=7696+(28*(e|=0)|0)|0,i[(t|=0)>>2]=i[e>>2],i[t+4>>2]=i[e+4>>2],i[t+8>>2]=i[e+8>>2],i[t+12>>2]=i[e+12>>2]}(r,c),l=0|function(e,t){e|=0;var n=0,r=0;if((t|=0)>>>0>20)return-1;do{if((0|i[11120+(216*t|0)>>2])!=(0|e))if((0|i[11120+(216*t|0)+8>>2])!=(0|e))if((0|i[11120+(216*t|0)+16>>2])!=(0|e))if((0|i[11120+(216*t|0)+24>>2])!=(0|e))if((0|i[11120+(216*t|0)+32>>2])!=(0|e))if((0|i[11120+(216*t|0)+40>>2])!=(0|e))if((0|i[11120+(216*t|0)+48>>2])!=(0|e))if((0|i[11120+(216*t|0)+56>>2])!=(0|e))if((0|i[11120+(216*t|0)+64>>2])!=(0|e))if((0|i[11120+(216*t|0)+72>>2])!=(0|e))if((0|i[11120+(216*t|0)+80>>2])!=(0|e))if((0|i[11120+(216*t|0)+88>>2])!=(0|e))if((0|i[11120+(216*t|0)+96>>2])!=(0|e))if((0|i[11120+(216*t|0)+104>>2])!=(0|e))if((0|i[11120+(216*t|0)+112>>2])!=(0|e))if((0|i[11120+(216*t|0)+120>>2])!=(0|e))if((0|i[11120+(216*t|0)+128>>2])!=(0|e)){if((0|i[11120+(216*t|0)+136>>2])!=(0|e)){if((0|i[11120+(216*t|0)+144>>2])==(0|e)){e=0,n=2,r=0;break}if((0|i[11120+(216*t|0)+152>>2])==(0|e)){e=0,n=2,r=1;break}if((0|i[11120+(216*t|0)+160>>2])==(0|e)){e=0,n=2,r=2;break}if((0|i[11120+(216*t|0)+168>>2])==(0|e)){e=1,n=2,r=0;break}if((0|i[11120+(216*t|0)+176>>2])==(0|e)){e=1,n=2,r=1;break}if((0|i[11120+(216*t|0)+184>>2])==(0|e)){e=1,n=2,r=2;break}if((0|i[11120+(216*t|0)+192>>2])==(0|e)){e=2,n=2,r=0;break}if((0|i[11120+(216*t|0)+200>>2])==(0|e)){e=2,n=2,r=1;break}if((0|i[11120+(216*t|0)+208>>2])==(0|e)){e=2,n=2,r=2;break}return-1}e=2,n=1,r=2}else e=2,n=1,r=1;else e=2,n=1,r=0;else e=1,n=1,r=2;else e=1,n=1,r=1;else e=1,n=1,r=0;else e=0,n=1,r=2;else e=0,n=1,r=1;else e=0,n=1,r=0;else e=2,n=0,r=2;else e=2,n=0,r=1;else e=2,n=0,r=0;else e=1,n=0,r=2;else e=1,n=0,r=1;else e=1,n=0,r=0;else e=0,n=0,r=2;else e=0,n=0,r=1;else e=0,n=0,r=0}while(0);return 0|i[11120+(216*t|0)+(72*n|0)+(24*e|0)+(r<<3)+4>>2]}(r,0|i[s>>2]);e:do{if(0|q(r)){switch(0|r){case 4:e=0;break;case 14:e=1;break;case 24:e=2;break;case 38:e=3;break;case 49:e=4;break;case 58:e=5;break;case 63:e=6;break;case 72:e=7;break;case 83:e=8;break;case 97:e=9;break;case 107:e=10;break;case 117:e=11;break;default:l=1;break e}if(u=0|i[22e3+(24*e|0)+8>>2],t=0|i[22e3+(24*e|0)+16>>2],(0|(e=0|i[s>>2]))!=(0|i[c>>2])&&(c=0|G(r))|(0|(e=0|i[s>>2]))==(0|t)&&(l=(l+1|0)%6|0),3==(0|a)&(0|e)==(0|t)){l=(l+5|0)%6|0,u=22;break}5==(0|a)&(0|e)==(0|u)?(l=(l+1|0)%6|0,u=22):u=22}else u=22}while(0);return 22==(0|u)&&(i[n>>2]=l,l=0),D=o,0|(n=l)}function yt(e,t,n,r){n|=0,r|=0;var s,a,o,l,u,c=0,A=0,h=0,d=0,p=0,f=0,m=0,g=0,v=0,_=0,y=0;if(u=D,D=D+32|0,y=u+24|0,l=u+20|0,o=u+8|0,a=u+16|0,s=u,p=(p=!(0|Oe(e|=0,t|=0)))?6:5,m=0|Gt(0|e,0|t,52),w(),p>>>0<=n>>>0)return D=u,0|(r=2);!(g=!(0|(m&=15)))&&!((v=0|zt(7,0,3*(15^m)|0))&e)&!(w()&t)?c=n:A=4;e:do{if(4==(0|A)){if((0|((c=!!(0|Oe(e,t)))?4:5))<(0|n))return D=u,0|(r=1);if(0|_t(e,t,y))return D=u,0|(r=1);if(A=(0|i[y>>2])+n|0,7==(0|(v=0|i[(c=c?22288+((0|A)%5<<2)|0:22320+((0|A)%6<<2)|0)>>2])))return D=u,0|(r=1);i[l>>2]=0,c=0|O(e,t,v,l,o);do{if(!c){if(f=0|i[(d=o)>>2],A=(h=(d=0|i[d+4>>2])>>>0<t>>>0|(0|d)==(0|t)&f>>>0<e>>>0)?f:e,h=h?d:t,!g&&!(f&(g=0|zt(7,0,3*(15^m)|0)))&!(d&w()))c=n;else{if(d=(n+-1+p|0)%(0|p)|0,c=0|Oe(e,t),(0|d)<0&&M(23313,23315,245,23324),(0|((p=!!(0|c))?4:5))<(0|d)&&M(23313,23315,245,23324),0|_t(e,t,y)&&M(23313,23315,245,23324),c=(0|i[y>>2])+d|0,7==(0|(d=0|i[(c=p?22288+((0|c)%5<<2)|0:22320+((0|c)%6<<2)|0)>>2]))&&M(23313,23315,245,23324),i[a>>2]=0,0|(c=0|O(e,t,d,a,s)))break;p=0|i[(f=s)>>2],f=0|i[f+4>>2];do{if(f>>>0<h>>>0|(0|f)==(0|h)&p>>>0<A>>>0){if(A=0|Oe(p,f)?0|F(p,f,e,t):0|i[22384+(((0|i[a>>2])+(0|i[22352+(d<<2)>>2])|0)%6<<2)>>2],c=0|Oe(p,f),(A+-1|0)>>>0>5){c=-1,A=p,h=f;break}if(1==(0|A)&(c=!!(0|c))){c=-1,A=p,h=f;break}do{if(!(0|_t(p,f,y))){if(c){c=(5+(0|i[21936+(A<<2)>>2])-(0|i[y>>2])|0)%5|0;break}c=(6+(0|i[21968+(A<<2)>>2])-(0|i[y>>2])|0)%6|0;break}c=-1}while(0);A=p,h=f}else c=n}while(0);f=0|i[(d=o)>>2],d=0|i[d+4>>2]}if((0|A)==(0|f)&(0|h)==(0|d)){if(e=(p=!!(0|Oe(f,d)))?0|F(f,d,e,t):0|i[22384+(((0|i[l>>2])+(0|i[22352+(v<<2)>>2])|0)%6<<2)>>2],c=0|Oe(f,d),(e+-1|0)>>>0<=5&&!(1==(0|e)&(_=!!(0|c))))do{if(!(0|_t(f,d,y))){if(_){c=(5+(0|i[21936+(e<<2)>>2])-(0|i[y>>2])|0)%5|0;break}c=(6+(0|i[21968+(e<<2)>>2])-(0|i[y>>2])|0)%6|0;break}c=-1}while(0);else c=-1;c=6==(0|(c=c+1|0))|p&5==(0|c)?0:c}t=h,e=A;break e}}while(0);return D=u,0|(r=c)}}while(0);return _=0|zt(0|c,0,56),y=w()|-2130706433&t|536870912,i[r>>2]=_|e,i[r+4>>2]=y,D=u,0|(r=0)}function xt(e,t,n){e|=0,n|=0;var r=0;(0|(t|=0))>0?(r=0|Pt(t,4),i[e>>2]=r,r||M(23337,23360,40,23374)):i[e>>2]=0,i[e+4>>2]=t,i[e+8>>2]=0,i[e+12>>2]=n}function bt(e){var t,n,r,a=0,o=0,l=0,c=0;t=(e|=0)+4|0,n=e+12|0,r=e+8|0;e:for(;;){for(o=0|i[t>>2],a=0;;){if((0|a)>=(0|o))break e;if(l=0|i[e>>2],c=0|i[l+(a<<2)>>2])break;a=a+1|0}a=l+(~~(+u(+ +A(10,+ +(15-(0|i[n>>2])|0))*(+s[c>>3]+ +s[c+8>>3]))%+(0|o))>>>0<<2)|0,o=0|i[a>>2];t:do{if(0|o){if(l=c+32|0,(0|o)==(0|c))i[a>>2]=i[l>>2];else{if(!(a=0|i[(o=o+32|0)>>2]))break;for(;(0|a)!=(0|c);)if(!(a=0|i[(o=a+32|0)>>2]))break t;i[o>>2]=i[l>>2]}Nt(c),i[r>>2]=(0|i[r>>2])-1}}while(0)}Nt(0|i[e>>2])}function St(e){var t,n=0,r=0;for(t=0|i[(e|=0)+4>>2],r=0;;){if((0|r)>=(0|t)){n=0,r=4;break}if(n=0|i[(0|i[e>>2])+(r<<2)>>2]){r=4;break}r=r+1|0}return 4==(0|r)?0|n:0}function Tt(e,t){t|=0;var n=0,r=0,a=0,o=0;if(n=~~(+u(+ +A(10,+ +(15-(0|i[(e|=0)+12>>2])|0))*(+s[t>>3]+ +s[t+8>>3]))%+(0|i[e+4>>2]))>>>0,n=(0|i[e>>2])+(n<<2)|0,!(r=0|i[n>>2]))return 0|(o=1);o=t+32|0;do{if((0|r)!=(0|t)){if(!(n=0|i[r+32>>2]))return 0|(o=1);for(a=n;;){if((0|a)==(0|t)){a=8;break}if(!(n=0|i[a+32>>2])){n=1,a=10;break}r=a,a=n}if(8==(0|a)){i[r+32>>2]=i[o>>2];break}if(10==(0|a))return 0|n}else i[n>>2]=i[o>>2]}while(0);return Nt(t),i[(o=e+8|0)>>2]=(0|i[o>>2])-1,0|(o=0)}function wt(e,t,n){e|=0,t|=0,n|=0;var r,a=0,o=0,l=0;(r=0|Rt(40))||M(23390,23360,98,23403),i[r>>2]=i[t>>2],i[r+4>>2]=i[t+4>>2],i[r+8>>2]=i[t+8>>2],i[r+12>>2]=i[t+12>>2],i[(o=r+16|0)>>2]=i[n>>2],i[o+4>>2]=i[n+4>>2],i[o+8>>2]=i[n+8>>2],i[o+12>>2]=i[n+12>>2],i[r+32>>2]=0,o=~~(+u(+ +A(10,+ +(15-(0|i[e+12>>2])|0))*(+s[t>>3]+ +s[t+8>>3]))%+(0|i[e+4>>2]))>>>0,o=(0|i[e>>2])+(o<<2)|0,a=0|i[o>>2];do{if(a){for(;!(0|Je(a,t)&&0|Je(a+16|0,n));)if(o=0|i[a+32>>2],!(0|i[(a=0|o?o:a)+32>>2])){l=10;break}if(10==(0|l)){i[a+32>>2]=r;break}return Nt(r),0|(l=a)}i[o>>2]=r}while(0);return i[(l=e+8|0)>>2]=1+(0|i[l>>2]),0|(l=r)}function Mt(e,t,n){t|=0,n|=0;var r=0,a=0;if(a=~~(+u(+ +A(10,+ +(15-(0|i[(e|=0)+12>>2])|0))*(+s[t>>3]+ +s[t+8>>3]))%+(0|i[e+4>>2]))>>>0,!(a=0|i[(0|i[e>>2])+(a<<2)>>2]))return 0|(n=0);if(!n){for(e=a;;){if(0|Je(e,t)){r=10;break}if(!(e=0|i[e+32>>2])){e=0,r=10;break}}if(10==(0|r))return 0|e}for(e=a;;){if(0|Je(e,t)&&0|Je(e+16|0,n)){r=10;break}if(!(e=0|i[e+32>>2])){e=0,r=10;break}}return 10==(0|r)?0|e:0}function Et(e,t){t|=0;var n=0;if(n=~~(+u(+ +A(10,+ +(15-(0|i[(e|=0)+12>>2])|0))*(+s[t>>3]+ +s[t+8>>3]))%+(0|i[e+4>>2]))>>>0,!(e=0|i[(0|i[e>>2])+(n<<2)>>2]))return 0|(n=0);for(;;){if(0|Je(e,t)){t=5;break}if(!(e=0|i[e+32>>2])){e=0,t=5;break}}return 5==(0|t)?0|e:0}function Ct(e){return 0|+function(e){return+ +Qt(+(e=+e))}(e=+e)}function Rt(e){e|=0;var t,n=0,r=0,s=0,a=0,o=0,l=0,u=0,c=0,A=0,h=0,d=0,p=0,f=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0;t=D,D=D+16|0,p=t;do{if(e>>>0<245){if(e=(A=e>>>0<11?16:e+11&-8)>>>3,3&(r=(d=0|i[5857])>>>e))return s=0|i[(r=(e=23468+((n=(1&r^1)+e|0)<<1<<2)|0)+8|0)>>2],(0|(o=0|i[(a=s+8|0)>>2]))==(0|e)?i[5857]=d&~(1<<n):(i[o+12>>2]=e,i[r>>2]=o),b=n<<3,i[s+4>>2]=3|b,i[(b=s+b+4|0)>>2]=1|i[b>>2],D=t,0|(b=a);if(A>>>0>(h=0|i[5859])>>>0){if(0|r)return n=((n=r<<e&((n=2<<e)|0-n))&0-n)-1|0,o=0|i[(e=(n=23468+((s=((r=(n>>>=u=n>>>12&16)>>>5&8)|u|(o=(n>>>=r)>>>2&4)|(e=(n>>>=o)>>>1&2)|(s=(n>>>=e)>>>1&1))+(n>>>s)|0)<<1<<2)|0)+8|0)>>2],(0|(r=0|i[(u=o+8|0)>>2]))==(0|n)?(e=d&~(1<<s),i[5857]=e):(i[r+12>>2]=n,i[e>>2]=r,e=d),l=(b=s<<3)-A|0,i[o+4>>2]=3|A,i[(a=o+A|0)+4>>2]=1|l,i[o+b>>2]=l,0|h&&(s=0|i[5862],r=23468+((n=h>>>3)<<1<<2)|0,e&(n=1<<n)?n=0|i[(e=r+8|0)>>2]:(i[5857]=e|n,n=r,e=r+8|0),i[e>>2]=s,i[n+12>>2]=s,i[s+8>>2]=n,i[s+12>>2]=r),i[5859]=l,i[5862]=a,D=t,0|(b=u);if(o=0|i[5858]){for(r=(o&0-o)-1|0,r=c=0|i[23732+(((s=(r>>>=a=r>>>12&16)>>>5&8)|a|(l=(r>>>=s)>>>2&4)|(u=(r>>>=l)>>>1&2)|(c=(r>>>=u)>>>1&1))+(r>>>c)<<2)>>2],u=c,c=(-8&i[c+4>>2])-A|0;(e=0|i[r+16>>2])||(e=0|i[r+20>>2]);)r=e,u=(a=(l=(-8&i[e+4>>2])-A|0)>>>0<c>>>0)?e:u,c=a?l:c;if((l=u+A|0)>>>0>u>>>0){a=0|i[u+24>>2],n=0|i[u+12>>2];do{if((0|n)==(0|u)){if(!(n=0|i[(e=u+20|0)>>2])&&!(n=0|i[(e=u+16|0)>>2])){r=0;break}for(;;)if(r=0|i[(s=n+20|0)>>2])n=r,e=s;else{if(!(r=0|i[(s=n+16|0)>>2]))break;n=r,e=s}i[e>>2]=0,r=n}else r=0|i[u+8>>2],i[r+12>>2]=n,i[n+8>>2]=r,r=n}while(0);do{if(0|a){if(n=0|i[u+28>>2],(0|u)==(0|i[(e=23732+(n<<2)|0)>>2])){if(i[e>>2]=r,!r){i[5858]=o&~(1<<n);break}}else if(i[((0|i[(b=a+16|0)>>2])==(0|u)?b:a+20)>>2]=r,!r)break;i[r+24>>2]=a,0|(n=0|i[u+16>>2])&&(i[r+16>>2]=n,i[n+24>>2]=r),0|(n=0|i[u+20>>2])&&(i[r+20>>2]=n,i[n+24>>2]=r)}}while(0);return c>>>0<16?(b=c+A|0,i[u+4>>2]=3|b,i[(b=u+b+4|0)>>2]=1|i[b>>2]):(i[u+4>>2]=3|A,i[l+4>>2]=1|c,i[l+c>>2]=c,0|h&&(s=0|i[5862],r=23468+((n=h>>>3)<<1<<2)|0,(n=1<<n)&d?n=0|i[(e=r+8|0)>>2]:(i[5857]=n|d,n=r,e=r+8|0),i[e>>2]=s,i[n+12>>2]=s,i[s+8>>2]=n,i[s+12>>2]=r),i[5859]=c,i[5862]=l),D=t,0|(b=u+8|0)}d=A}else d=A}else d=A}else if(e>>>0<=4294967231)if(A=-8&(e=e+11|0),s=0|i[5858]){a=0-A|0,c=(e>>>=8)?A>>>0>16777215?31:A>>>((c=14-((u=((g=e<<(d=(e+1048320|0)>>>16&8))+520192|0)>>>16&4)|d|(c=((g<<=u)+245760|0)>>>16&2))+(g<<c>>>15)|0)+7|0)&1|c<<1:0,r=0|i[23732+(c<<2)>>2];e:do{if(r)for(e=0,u=A<<(31==(0|c)?0:25-(c>>>1)),o=0;;){if((l=(-8&i[r+4>>2])-A|0)>>>0<a>>>0){if(!l){e=r,a=0,g=65;break e}e=r,a=l}if(o=!(0|(g=0|i[r+20>>2]))|(0|g)==(0|(r=0|i[r+16+(u>>>31<<2)>>2]))?o:g,!r){r=o,g=61;break}u<<=1}else r=0,e=0,g=61}while(0);if(61==(0|g)){if(!(0|r)&!(0|e)){if(!(e=((e=2<<c)|0-e)&s)){d=A;break}d=(e&0-e)-1|0,e=0,r=0|i[23732+(((o=(d>>>=l=d>>>12&16)>>>5&8)|l|(u=(d>>>=o)>>>2&4)|(c=(d>>>=u)>>>1&2)|(r=(d>>>=c)>>>1&1))+(d>>>r)<<2)>>2]}r?g=65:(u=e,l=a)}if(65==(0|g))for(o=r;;){if(a=(r=(d=(-8&i[o+4>>2])-A|0)>>>0<a>>>0)?d:a,e=r?o:e,(r=0|i[o+16>>2])||(r=0|i[o+20>>2]),!r){u=e,l=a;break}o=r}if(0|u&&l>>>0<((0|i[5859])-A|0)>>>0&&(h=u+A|0)>>>0>u>>>0){o=0|i[u+24>>2],n=0|i[u+12>>2];do{if((0|n)==(0|u)){if(!(n=0|i[(e=u+20|0)>>2])&&!(n=0|i[(e=u+16|0)>>2])){n=0;break}for(;;)if(r=0|i[(a=n+20|0)>>2])n=r,e=a;else{if(!(r=0|i[(a=n+16|0)>>2]))break;n=r,e=a}i[e>>2]=0}else b=0|i[u+8>>2],i[b+12>>2]=n,i[n+8>>2]=b}while(0);do{if(o){if(e=0|i[u+28>>2],(0|u)==(0|i[(r=23732+(e<<2)|0)>>2])){if(i[r>>2]=n,!n){s&=~(1<<e),i[5858]=s;break}}else if(i[((0|i[(b=o+16|0)>>2])==(0|u)?b:o+20)>>2]=n,!n)break;i[n+24>>2]=o,0|(e=0|i[u+16>>2])&&(i[n+16>>2]=e,i[e+24>>2]=n),(e=0|i[u+20>>2])&&(i[n+20>>2]=e,i[e+24>>2]=n)}}while(0);e:do{if(l>>>0<16)b=l+A|0,i[u+4>>2]=3|b,i[(b=u+b+4|0)>>2]=1|i[b>>2];else{if(i[u+4>>2]=3|A,i[h+4>>2]=1|l,i[h+l>>2]=l,n=l>>>3,l>>>0<256){r=23468+(n<<1<<2)|0,(e=0|i[5857])&(n=1<<n)?n=0|i[(e=r+8|0)>>2]:(i[5857]=e|n,n=r,e=r+8|0),i[e>>2]=h,i[n+12>>2]=h,i[h+8>>2]=n,i[h+12>>2]=r;break}if(n=23732+((r=(n=l>>>8)?l>>>0>16777215?31:l>>>((r=14-((y=((b=n<<(x=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|x|(r=((b<<=y)+245760|0)>>>16&2))+(b<<r>>>15)|0)+7|0)&1|r<<1:0)<<2)|0,i[h+28>>2]=r,i[(e=h+16|0)+4>>2]=0,i[e>>2]=0,!(s&(e=1<<r))){i[5858]=s|e,i[n>>2]=h,i[h+24>>2]=n,i[h+12>>2]=h,i[h+8>>2]=h;break}n=0|i[n>>2];t:do{if((-8&i[n+4>>2])!=(0|l)){for(s=l<<(31==(0|r)?0:25-(r>>>1));e=0|i[(r=n+16+(s>>>31<<2)|0)>>2];){if((-8&i[e+4>>2])==(0|l)){n=e;break t}s<<=1,n=e}i[r>>2]=h,i[h+24>>2]=n,i[h+12>>2]=h,i[h+8>>2]=h;break e}}while(0);b=0|i[(x=n+8|0)>>2],i[b+12>>2]=h,i[x>>2]=h,i[h+8>>2]=b,i[h+12>>2]=n,i[h+24>>2]=0}}while(0);return D=t,0|(b=u+8|0)}d=A}else d=A;else d=-1}while(0);if((r=0|i[5859])>>>0>=d>>>0)return n=r-d|0,e=0|i[5862],n>>>0>15?(b=e+d|0,i[5862]=b,i[5859]=n,i[b+4>>2]=1|n,i[e+r>>2]=n,i[e+4>>2]=3|d):(i[5859]=0,i[5862]=0,i[e+4>>2]=3|r,i[(b=e+r+4|0)>>2]=1|i[b>>2]),D=t,0|(b=e+8|0);if((l=0|i[5860])>>>0>d>>>0)return y=l-d|0,i[5860]=y,x=(b=0|i[5863])+d|0,i[5863]=x,i[x+4>>2]=1|y,i[b+4>>2]=3|d,D=t,0|(b=b+8|0);if(0|i[5975]?e=0|i[5977]:(i[5977]=4096,i[5976]=4096,i[5978]=-1,i[5979]=-1,i[5980]=0,i[5968]=0,i[5975]=-16&p^1431655768,e=4096),u=d+48|0,(A=(o=e+(c=d+47|0)|0)&(a=0-e|0))>>>0<=d>>>0)return D=t,0|(b=0);if(0|(e=0|i[5967])&&(p=(h=0|i[5965])+A|0)>>>0<=h>>>0|p>>>0>e>>>0)return D=t,0|(b=0);e:do{if(4&i[5968])n=0,g=143;else{r=0|i[5863];t:do{if(r){for(s=23876;!((p=0|i[s>>2])>>>0<=r>>>0&&(p+(0|i[s+4>>2])|0)>>>0>r>>>0);){if(!(e=0|i[s+8>>2])){g=128;break t}s=e}if((n=o-l&a)>>>0<2147483647)if((0|(e=0|Yt(0|n)))==((0|i[s>>2])+(0|i[s+4>>2])|0)){if(-1!=(0|e)){l=n,o=e,g=145;break e}}else s=e,g=136;else n=0}else g=128}while(0);do{if(128==(0|g))if(-1!=(0|(r=0|Yt(0)))&&(n=r,m=(n=((m=(f=0|i[5976])+-1|0)&n?(m+n&0-f)-n|0:0)+A|0)+(f=0|i[5965])|0,n>>>0>d>>>0&n>>>0<2147483647)){if(0|(p=0|i[5967])&&m>>>0<=f>>>0|m>>>0>p>>>0){n=0;break}if((0|(e=0|Yt(0|n)))==(0|r)){l=n,o=r,g=145;break e}s=e,g=136}else n=0}while(0);do{if(136==(0|g)){if(r=0-n|0,!(u>>>0>n>>>0&n>>>0<2147483647&-1!=(0|s))){if(-1==(0|s)){n=0;break}l=n,o=s,g=145;break e}if((e=c-n+(e=0|i[5977])&0-e)>>>0>=2147483647){l=n,o=s,g=145;break e}if(-1==(0|Yt(0|e))){Yt(0|r),n=0;break}l=e+n|0,o=s,g=145;break e}}while(0);i[5968]=4|i[5968],g=143}}while(0);if(143==(0|g)&&A>>>0<2147483647&&!(-1==(0|(y=0|Yt(0|A)))|1^(_=(v=(m=0|Yt(0))-y|0)>>>0>(d+40|0)>>>0)|y>>>0<m>>>0&-1!=(0|y)&-1!=(0|m)^1)&&(l=_?v:n,o=y,g=145),145==(0|g)){n=(0|i[5965])+l|0,i[5965]=n,n>>>0>(0|i[5966])>>>0&&(i[5966]=n),c=0|i[5863];e:do{if(c){for(n=23876;;){if((0|o)==((e=0|i[n>>2])+(r=0|i[n+4>>2])|0)){g=154;break}if(!(s=0|i[n+8>>2]))break;n=s}if(!(154!=(0|g)||(x=n+4|0,8&i[n+12>>2]))&&o>>>0>c>>>0&e>>>0<=c>>>0){i[x>>2]=r+l,x=c+(y=7&(y=c+8|0)?0-y&7:0)|0,y=(b=(0|i[5860])+l|0)-y|0,i[5863]=x,i[5860]=y,i[x+4>>2]=1|y,i[c+b+4>>2]=40,i[5864]=i[5979];break}for(o>>>0<(0|i[5861])>>>0&&(i[5861]=o),r=o+l|0,n=23876;;){if((0|i[n>>2])==(0|r)){g=162;break}if(!(e=0|i[n+8>>2]))break;n=e}if(162==(0|g)&&!(8&i[n+12>>2])){i[n>>2]=o,i[(h=n+4|0)>>2]=(0|i[h>>2])+l,A=(h=o+(7&(h=o+8|0)?0-h&7:0)|0)+d|0,u=(n=r+(7&(n=r+8|0)?0-n&7:0)|0)-h-d|0,i[h+4>>2]=3|d;t:do{if((0|c)==(0|n))b=(0|i[5860])+u|0,i[5860]=b,i[5863]=A,i[A+4>>2]=1|b;else{if((0|i[5862])==(0|n)){b=(0|i[5859])+u|0,i[5859]=b,i[5862]=A,i[A+4>>2]=1|b,i[A+b>>2]=b;break}if(1==(3&(e=0|i[n+4>>2]))){l=-8&e,s=e>>>3;n:do{if(e>>>0<256){if(e=0|i[n+8>>2],(0|(r=0|i[n+12>>2]))==(0|e)){i[5857]=i[5857]&~(1<<s);break}i[e+12>>2]=r,i[r+8>>2]=e;break}o=0|i[n+24>>2],e=0|i[n+12>>2];do{if((0|e)==(0|n)){if(e=0|i[(s=(r=n+16|0)+4|0)>>2])r=s;else if(!(e=0|i[r>>2])){e=0;break}for(;;)if(s=0|i[(a=e+20|0)>>2])e=s,r=a;else{if(!(s=0|i[(a=e+16|0)>>2]))break;e=s,r=a}i[r>>2]=0}else b=0|i[n+8>>2],i[b+12>>2]=e,i[e+8>>2]=b}while(0);if(!o)break;s=23732+((r=0|i[n+28>>2])<<2)|0;do{if((0|i[s>>2])==(0|n)){if(i[s>>2]=e,0|e)break;i[5858]=i[5858]&~(1<<r);break n}if(i[((0|i[(b=o+16|0)>>2])==(0|n)?b:o+20)>>2]=e,!e)break n}while(0);if(i[e+24>>2]=o,0|(s=0|i[(r=n+16|0)>>2])&&(i[e+16>>2]=s,i[s+24>>2]=e),!(r=0|i[r+4>>2]))break;i[e+20>>2]=r,i[r+24>>2]=e}while(0);n=n+l|0,a=l+u|0}else a=u;if(i[(n=n+4|0)>>2]=-2&i[n>>2],i[A+4>>2]=1|a,i[A+a>>2]=a,n=a>>>3,a>>>0<256){r=23468+(n<<1<<2)|0,(e=0|i[5857])&(n=1<<n)?n=0|i[(e=r+8|0)>>2]:(i[5857]=e|n,n=r,e=r+8|0),i[e>>2]=A,i[n+12>>2]=A,i[A+8>>2]=n,i[A+12>>2]=r;break}n=a>>>8;do{if(n){if(a>>>0>16777215){s=31;break}s=a>>>((s=14-((y=((b=n<<(x=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|x|(s=((b<<=y)+245760|0)>>>16&2))+(b<<s>>>15)|0)+7|0)&1|s<<1}else s=0}while(0);if(n=23732+(s<<2)|0,i[A+28>>2]=s,i[(e=A+16|0)+4>>2]=0,i[e>>2]=0,!((e=0|i[5858])&(r=1<<s))){i[5858]=e|r,i[n>>2]=A,i[A+24>>2]=n,i[A+12>>2]=A,i[A+8>>2]=A;break}n=0|i[n>>2];n:do{if((-8&i[n+4>>2])!=(0|a)){for(s=a<<(31==(0|s)?0:25-(s>>>1));e=0|i[(r=n+16+(s>>>31<<2)|0)>>2];){if((-8&i[e+4>>2])==(0|a)){n=e;break n}s<<=1,n=e}i[r>>2]=A,i[A+24>>2]=n,i[A+12>>2]=A,i[A+8>>2]=A;break t}}while(0);b=0|i[(x=n+8|0)>>2],i[b+12>>2]=A,i[x>>2]=A,i[A+8>>2]=b,i[A+12>>2]=n,i[A+24>>2]=0}}while(0);return D=t,0|(b=h+8|0)}for(n=23876;!((e=0|i[n>>2])>>>0<=c>>>0&&(b=e+(0|i[n+4>>2])|0)>>>0>c>>>0);)n=0|i[n+8>>2];n=(e=(e=(a=b+-47|0)+(7&(e=a+8|0)?0-e&7:0)|0)>>>0<(a=c+16|0)>>>0?c:e)+8|0,x=o+(y=7&(y=o+8|0)?0-y&7:0)|0,y=(r=l+-40|0)-y|0,i[5863]=x,i[5860]=y,i[x+4>>2]=1|y,i[o+r+4>>2]=40,i[5864]=i[5979],i[(r=e+4|0)>>2]=27,i[n>>2]=i[5969],i[n+4>>2]=i[5970],i[n+8>>2]=i[5971],i[n+12>>2]=i[5972],i[5969]=o,i[5970]=l,i[5972]=0,i[5971]=n,n=e+24|0;do{x=n,i[(n=n+4|0)>>2]=7}while((x+8|0)>>>0<b>>>0);if((0|e)!=(0|c)){if(o=e-c|0,i[r>>2]=-2&i[r>>2],i[c+4>>2]=1|o,i[e>>2]=o,n=o>>>3,o>>>0<256){r=23468+(n<<1<<2)|0,(e=0|i[5857])&(n=1<<n)?n=0|i[(e=r+8|0)>>2]:(i[5857]=e|n,n=r,e=r+8|0),i[e>>2]=c,i[n+12>>2]=c,i[c+8>>2]=n,i[c+12>>2]=r;break}if(r=23732+((s=(n=o>>>8)?o>>>0>16777215?31:o>>>((s=14-((y=((b=n<<(x=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|x|(s=((b<<=y)+245760|0)>>>16&2))+(b<<s>>>15)|0)+7|0)&1|s<<1:0)<<2)|0,i[c+28>>2]=s,i[c+20>>2]=0,i[a>>2]=0,!((n=0|i[5858])&(e=1<<s))){i[5858]=n|e,i[r>>2]=c,i[c+24>>2]=r,i[c+12>>2]=c,i[c+8>>2]=c;break}n=0|i[r>>2];t:do{if((-8&i[n+4>>2])!=(0|o)){for(s=o<<(31==(0|s)?0:25-(s>>>1));e=0|i[(r=n+16+(s>>>31<<2)|0)>>2];){if((-8&i[e+4>>2])==(0|o)){n=e;break t}s<<=1,n=e}i[r>>2]=c,i[c+24>>2]=n,i[c+12>>2]=c,i[c+8>>2]=c;break e}}while(0);b=0|i[(x=n+8|0)>>2],i[b+12>>2]=c,i[x>>2]=c,i[c+8>>2]=b,i[c+12>>2]=n,i[c+24>>2]=0}}else!(0|(b=0|i[5861]))|o>>>0<b>>>0&&(i[5861]=o),i[5969]=o,i[5970]=l,i[5972]=0,i[5866]=i[5975],i[5865]=-1,i[5870]=23468,i[5869]=23468,i[5872]=23476,i[5871]=23476,i[5874]=23484,i[5873]=23484,i[5876]=23492,i[5875]=23492,i[5878]=23500,i[5877]=23500,i[5880]=23508,i[5879]=23508,i[5882]=23516,i[5881]=23516,i[5884]=23524,i[5883]=23524,i[5886]=23532,i[5885]=23532,i[5888]=23540,i[5887]=23540,i[5890]=23548,i[5889]=23548,i[5892]=23556,i[5891]=23556,i[5894]=23564,i[5893]=23564,i[5896]=23572,i[5895]=23572,i[5898]=23580,i[5897]=23580,i[5900]=23588,i[5899]=23588,i[5902]=23596,i[5901]=23596,i[5904]=23604,i[5903]=23604,i[5906]=23612,i[5905]=23612,i[5908]=23620,i[5907]=23620,i[5910]=23628,i[5909]=23628,i[5912]=23636,i[5911]=23636,i[5914]=23644,i[5913]=23644,i[5916]=23652,i[5915]=23652,i[5918]=23660,i[5917]=23660,i[5920]=23668,i[5919]=23668,i[5922]=23676,i[5921]=23676,i[5924]=23684,i[5923]=23684,i[5926]=23692,i[5925]=23692,i[5928]=23700,i[5927]=23700,i[5930]=23708,i[5929]=23708,i[5932]=23716,i[5931]=23716,x=o+(y=7&(y=o+8|0)?0-y&7:0)|0,y=(b=l+-40|0)-y|0,i[5863]=x,i[5860]=y,i[x+4>>2]=1|y,i[o+b+4>>2]=40,i[5864]=i[5979]}while(0);if((n=0|i[5860])>>>0>d>>>0)return y=n-d|0,i[5860]=y,x=(b=0|i[5863])+d|0,i[5863]=x,i[x+4>>2]=1|y,i[b+4>>2]=3|d,D=t,0|(b=b+8|0)}return i[(b=23424)>>2]=12,D=t,0|(b=0)}function Nt(e){var t=0,n=0,r=0,s=0,a=0,o=0,l=0,u=0;if(e|=0){n=e+-8|0,s=0|i[5861],u=n+(t=-8&(e=0|i[e+-4>>2]))|0;do{if(1&e)l=n,o=n;else{if(r=0|i[n>>2],!(3&e))return;if(a=r+t|0,(o=n+(0-r)|0)>>>0<s>>>0)return;if((0|i[5862])==(0|o)){if(3&~(t=0|i[(e=u+4|0)>>2])){l=o,t=a;break}return i[5859]=a,i[e>>2]=-2&t,i[o+4>>2]=1|a,void(i[o+a>>2]=a)}if(n=r>>>3,r>>>0<256){if(e=0|i[o+8>>2],(0|(t=0|i[o+12>>2]))==(0|e)){i[5857]=i[5857]&~(1<<n),l=o,t=a;break}i[e+12>>2]=t,i[t+8>>2]=e,l=o,t=a;break}s=0|i[o+24>>2],e=0|i[o+12>>2];do{if((0|e)==(0|o)){if(e=0|i[(n=(t=o+16|0)+4|0)>>2])t=n;else if(!(e=0|i[t>>2])){e=0;break}for(;;)if(n=0|i[(r=e+20|0)>>2])e=n,t=r;else{if(!(n=0|i[(r=e+16|0)>>2]))break;e=n,t=r}i[t>>2]=0}else l=0|i[o+8>>2],i[l+12>>2]=e,i[e+8>>2]=l}while(0);if(s){if(t=0|i[o+28>>2],(0|i[(n=23732+(t<<2)|0)>>2])==(0|o)){if(i[n>>2]=e,!e){i[5858]=i[5858]&~(1<<t),l=o,t=a;break}}else if(i[((0|i[(l=s+16|0)>>2])==(0|o)?l:s+20)>>2]=e,!e){l=o,t=a;break}i[e+24>>2]=s,0|(n=0|i[(t=o+16|0)>>2])&&(i[e+16>>2]=n,i[n+24>>2]=e),(t=0|i[t+4>>2])?(i[e+20>>2]=t,i[t+24>>2]=e,l=o,t=a):(l=o,t=a)}else l=o,t=a}}while(0);if(!(o>>>0>=u>>>0)&&1&(r=0|i[(e=u+4|0)>>2])){if(2&r)i[e>>2]=-2&r,i[l+4>>2]=1|t,i[o+t>>2]=t,s=t;else{if((0|i[5863])==(0|u)){if(u=(0|i[5860])+t|0,i[5860]=u,i[5863]=l,i[l+4>>2]=1|u,(0|l)!=(0|i[5862]))return;return i[5862]=0,void(i[5859]=0)}if((0|i[5862])==(0|u))return u=(0|i[5859])+t|0,i[5859]=u,i[5862]=o,i[l+4>>2]=1|u,void(i[o+u>>2]=u);s=(-8&r)+t|0,n=r>>>3;do{if(r>>>0<256){if(t=0|i[u+8>>2],(0|(e=0|i[u+12>>2]))==(0|t)){i[5857]=i[5857]&~(1<<n);break}i[t+12>>2]=e,i[e+8>>2]=t;break}a=0|i[u+24>>2],e=0|i[u+12>>2];do{if((0|e)==(0|u)){if(e=0|i[(n=(t=u+16|0)+4|0)>>2])t=n;else if(!(e=0|i[t>>2])){n=0;break}for(;;)if(n=0|i[(r=e+20|0)>>2])e=n,t=r;else{if(!(n=0|i[(r=e+16|0)>>2]))break;e=n,t=r}i[t>>2]=0,n=e}else n=0|i[u+8>>2],i[n+12>>2]=e,i[e+8>>2]=n,n=e}while(0);if(0|a){if(e=0|i[u+28>>2],(0|i[(t=23732+(e<<2)|0)>>2])==(0|u)){if(i[t>>2]=n,!n){i[5858]=i[5858]&~(1<<e);break}}else if(i[((0|i[(r=a+16|0)>>2])==(0|u)?r:a+20)>>2]=n,!n)break;i[n+24>>2]=a,0|(t=0|i[(e=u+16|0)>>2])&&(i[n+16>>2]=t,i[t+24>>2]=n),0|(e=0|i[e+4>>2])&&(i[n+20>>2]=e,i[e+24>>2]=n)}}while(0);if(i[l+4>>2]=1|s,i[o+s>>2]=s,(0|l)==(0|i[5862]))return void(i[5859]=s)}if(e=s>>>3,s>>>0<256)return n=23468+(e<<1<<2)|0,(t=0|i[5857])&(e=1<<e)?e=0|i[(t=n+8|0)>>2]:(i[5857]=t|e,e=n,t=n+8|0),i[t>>2]=l,i[e+12>>2]=l,i[l+8>>2]=e,void(i[l+12>>2]=n);e=23732+((r=(e=s>>>8)?s>>>0>16777215?31:s>>>((r=14-((a=((u=e<<(o=(e+1048320|0)>>>16&8))+520192|0)>>>16&4)|o|(r=((u<<=a)+245760|0)>>>16&2))+(u<<r>>>15)|0)+7|0)&1|r<<1:0)<<2)|0,i[l+28>>2]=r,i[l+20>>2]=0,i[l+16>>2]=0,t=0|i[5858],n=1<<r;e:do{if(t&n){e=0|i[e>>2];t:do{if((-8&i[e+4>>2])!=(0|s)){for(r=s<<(31==(0|r)?0:25-(r>>>1));t=0|i[(n=e+16+(r>>>31<<2)|0)>>2];){if((-8&i[t+4>>2])==(0|s)){e=t;break t}r<<=1,e=t}i[n>>2]=l,i[l+24>>2]=e,i[l+12>>2]=l,i[l+8>>2]=l;break e}}while(0);u=0|i[(o=e+8|0)>>2],i[u+12>>2]=l,i[o>>2]=l,i[l+8>>2]=u,i[l+12>>2]=e,i[l+24>>2]=0}else i[5858]=t|n,i[e>>2]=l,i[l+24>>2]=e,i[l+12>>2]=l,i[l+8>>2]=l}while(0);if(u=(0|i[5865])-1|0,i[5865]=u,!(0|u)){for(e=23884;e=0|i[e>>2];)e=e+8|0;i[5865]=-1}}}}function Pt(e,t){t|=0;var n=0;return(e|=0)?(n=0|y(t,e),(t|e)>>>0>65535&&(n=((n>>>0)/(e>>>0)|0)==(0|t)?n:-1)):n=0,(e=0|Rt(n))&&3&i[e+-4>>2]?(Xt(0|e,0,0|n),0|e):0|e}function Dt(e,t,n,r){return 0|(T((t|=0)+(r|=0)+((n=(e|=0)+(n|=0)>>>0)>>>0<e>>>0|0)>>>0|0),n)}function Lt(e,t,n,r){return 0|(T(0|(r=(t|=0)-(r|=0)-((n|=0)>>>0>(e|=0)>>>0|0)>>>0)),e-n>>>0)}function It(e){return 0|((e|=0)?31-(0|S(e^e-1)):32)}function Ut(e,t,n,r,s){s|=0;var a=0,o=0,l=0,u=0,c=0,A=0,h=0,d=0,p=0,f=0;if(A=e|=0,o=n|=0,l=d=r|=0,!(c=u=t|=0))return a=!!(0|s),l?a?(i[s>>2]=0|e,i[s+4>>2]=0,s=0,0|(T(0|(d=0)),s)):(s=0,0|(T(0|(d=0)),s)):(a&&(i[s>>2]=(A>>>0)%(o>>>0),i[s+4>>2]=0),s=(A>>>0)/(o>>>0)>>>0,0|(T(0|(d=0)),s));a=!(0|l);do{if(o){if(!a){if((a=(0|S(0|l))-(0|S(0|c))|0)>>>0<=31){o=h=a+1|0,e=A>>>(h>>>0)&(t=a-31>>31)|c<<(l=31-a|0),t&=c>>>(h>>>0),a=0,l=A<<l;break}return s?(i[s>>2]=0|e,i[s+4>>2]=0|u,s=0,0|(T(0|(d=0)),s)):(s=0,0|(T(0|(d=0)),s))}if((a=o-1|0)&o){o=l=33+(0|S(0|o))-(0|S(0|c))|0,e=(h=32-l|0)-1>>31&c>>>((p=l-32|0)>>>0)|(c<<h|A>>>(l>>>0))&(t=p>>31),t&=c>>>(l>>>0),a=A<<(f=64-l|0)&(u=h>>31),l=(c<<f|A>>>(p>>>0))&u|A<<h&l-33>>31;break}return 0|s&&(i[s>>2]=a&A,i[s+4>>2]=0),1==(0|o)?(f=0|e,0|(T(0|(p=0|u)),f)):(p=c>>>((f=0|It(0|o))>>>0)|0,f=c<<32-f|A>>>(f>>>0),0|(T(0|p),f))}if(a)return 0|s&&(i[s>>2]=(c>>>0)%(o>>>0),i[s+4>>2]=0),f=(c>>>0)/(o>>>0)>>>0,0|(T(0|(p=0)),f);if(!A)return 0|s&&(i[s>>2]=0,i[s+4>>2]=(c>>>0)%(l>>>0)),f=(c>>>0)/(l>>>0)>>>0,0|(T(0|(p=0)),f);if(!((a=l-1|0)&l))return 0|s&&(i[s>>2]=0|e,i[s+4>>2]=a&c),p=0,f=c>>>((0|It(0|l))>>>0),0|(T(0|p),f);if((a=(0|S(0|l))-(0|S(0|c))|0)>>>0<=30){o=t=a+1|0,e=c<<(l=31-a|0)|A>>>(t>>>0),t=c>>>(t>>>0),a=0,l=A<<l;break}return s?(i[s>>2]=0|e,i[s+4>>2]=0|u,f=0,0|(T(0|(p=0)),f)):(f=0,0|(T(0|(p=0)),f))}while(0);if(o){c=0|Dt(0|(h=0|n),0|(A=0|d),-1,-1),n=0|w(),u=l,l=0;do{r=u,u=a>>>31|u<<1,a=l|a<<1,Lt(0|c,0|n,0|(r=e<<1|r>>>31),0|(d=e>>>31|t<<1)),l=1&(p=(f=0|w())>>31|((0|f)<0?-1:0)<<1),e=0|Lt(0|r,0|d,p&h,(((0|f)<0?-1:0)>>31|((0|f)<0?-1:0)<<1)&A),t=0|w(),o=o-1|0}while(0|o);c=u,u=0}else c=l,u=0,l=0;return o=0,0|s&&(i[s>>2]=e,i[s+4>>2]=t),f=a<<1&-2|l,0|(T(0|(p=(0|a)>>>31|(c|o)<<1|u)),f)}function Bt(e,t,n,r){n|=0;var i,s,a,o,l;return s=(r|=0)>>31|((0|r)<0?-1:0)<<1,i=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,a=0|Lt((l=(t|=0)>>31|((0|t)<0?-1:0)<<1)^(e|=0),(o=((0|t)<0?-1:0)>>31|((0|t)<0?-1:0)<<1)^t,0|l,0|o),e=s^l,t=i^o,0|Lt(Ut(a,0|w(),0|Lt(s^n,i^r,0|s,0|i),0|w(),0)^e,w()^t,0|e,0|t)}function Ot(e,t,n,r){t|=0,r|=0;var i,s;return n=0|function(e,t){var n,r,i,s=0;return e=((n=0|y(s=65535&(t|=0),i=65535&(e|=0)))>>>16)+(0|y(s,r=e>>>16))|0,t=0|y(s=t>>>16,i),0|(T((e>>>16)+(0|y(s,r))+(((65535&e)+t|0)>>>16)|0),e+t<<16|65535&n)}(i=e|=0,s=n|=0),e=0|w(),0|(T((0|y(t,s))+(0|y(r,i))+e|0),n)}function Ft(e,t,n,r){n|=0;var s,a,o,l,u,c;return s=D,D=D+16|0,l=0|s,c=(r|=0)>>31|((0|r)<0?-1:0)<<1,u=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,Ut(e=0|Lt((o=(t|=0)>>31|((0|t)<0?-1:0)<<1)^(e|=0),(a=((0|t)<0?-1:0)>>31|((0|t)<0?-1:0)<<1)^t,0|o,0|a),t=0|w(),0|Lt(c^n,u^r,0|c,0|u),0|w(),l),r=0|Lt(i[l>>2]^o,i[l+4>>2]^a,0|o,0|a),n=0|w(),D=s,0|(T(0|n),r)}function kt(e,t,n,r){var s,a;return a=D,D=D+16|0,Ut(e|=0,t|=0,n|=0,r|=0,s=0|a),D=a,0|(T(0|i[s+4>>2]),i[s>>2])}function qt(e,t,n){return e|=0,t|=0,(0|(n|=0))<32?(T(t>>n),e>>>n|(t&(1<<n)-1)<<32-n):(T(0|((0|t)<0?-1:0)),t>>n-32)}function Gt(e,t,n){return e|=0,t|=0,(0|(n|=0))<32?(T(t>>>n|0),e>>>n|(t&(1<<n)-1)<<32-n):(T(0),t>>>n-32|0)}function zt(e,t,n){return e|=0,t|=0,(0|(n|=0))<32?(T(t<<n|(e&(1<<n)-1<<32-n)>>>32-n),e<<n):(T(e<<n-32),0)}function Vt(e,t){return t=+t,(e=+e)!=e?+t:t!=t?+e:+b(+e,+t)}function Ht(e,t){return t=+t,(e=+e)!=e?+t:t!=t?+e:+x(+e,+t)}function jt(e){return(e=+e)>=0?+l(e+.5):+_(e-.5)}function Wt(e,t,n){e|=0,t|=0;var s,a,o=0;if((0|(n|=0))>=8192)return R(0|e,0|t,0|n),0|e;if(a=0|e,s=e+n|0,(3&e)==(3&t)){for(;3&e;){if(!n)return 0|a;r[e|0]=0|r[t|0],e=e+1|0,t=t+1|0,n=n-1|0}for(o=(n=-4&s)-64|0;(0|e)<=(0|o);)i[e>>2]=i[t>>2],i[e+4>>2]=i[t+4>>2],i[e+8>>2]=i[t+8>>2],i[e+12>>2]=i[t+12>>2],i[e+16>>2]=i[t+16>>2],i[e+20>>2]=i[t+20>>2],i[e+24>>2]=i[t+24>>2],i[e+28>>2]=i[t+28>>2],i[e+32>>2]=i[t+32>>2],i[e+36>>2]=i[t+36>>2],i[e+40>>2]=i[t+40>>2],i[e+44>>2]=i[t+44>>2],i[e+48>>2]=i[t+48>>2],i[e+52>>2]=i[t+52>>2],i[e+56>>2]=i[t+56>>2],i[e+60>>2]=i[t+60>>2],e=e+64|0,t=t+64|0;for(;(0|e)<(0|n);)i[e>>2]=i[t>>2],e=e+4|0,t=t+4|0}else for(n=s-4|0;(0|e)<(0|n);)r[e|0]=0|r[t|0],r[e+1|0]=0|r[t+1|0],r[e+2|0]=0|r[t+2|0],r[e+3|0]=0|r[t+3|0],e=e+4|0,t=t+4|0;for(;(0|e)<(0|s);)r[e|0]=0|r[t|0],e=e+1|0,t=t+1|0;return 0|a}function Xt(e,t,n){t|=0;var s,a=0,o=0,l=0;if(s=(e|=0)+(n|=0)|0,t&=255,(0|n)>=67){for(;3&e;)r[e|0]=t,e=e+1|0;for(l=t|t<<8|t<<16|t<<24,o=(a=-4&s)-64|0;(0|e)<=(0|o);)i[e>>2]=l,i[e+4>>2]=l,i[e+8>>2]=l,i[e+12>>2]=l,i[e+16>>2]=l,i[e+20>>2]=l,i[e+24>>2]=l,i[e+28>>2]=l,i[e+32>>2]=l,i[e+36>>2]=l,i[e+40>>2]=l,i[e+44>>2]=l,i[e+48>>2]=l,i[e+52>>2]=l,i[e+56>>2]=l,i[e+60>>2]=l,e=e+64|0;for(;(0|e)<(0|a);)i[e>>2]=l,e=e+4|0}for(;(0|e)<(0|s);)r[e|0]=t,e=e+1|0;return s-n|0}function Qt(e){return(e=+e)>=0?+l(e+.5):+_(e-.5)}function Yt(e){e|=0;var t,n,r;return r=0|C(),(0|e)>0&(0|(t=(n=0|i[o>>2])+e|0))<(0|n)|(0|t)<0?(P(0|t),E(12),-1):(0|t)>(0|r)&&!(0|N(0|t))?(E(12),-1):(i[o>>2]=t,0|n)}return{___divdi3:Bt,___muldi3:Ot,___remdi3:Ft,___uremdi3:kt,_areNeighborCells:function(e,t,n,r,s){s|=0;var a,o,l,u=0,c=0,A=0,h=0;if(l=D,D=D+64|0,o=l,a=l+56|0,!(!0&134217728==(2013265920&(t|=0))&!0&134217728==(2013265920&(r|=0))))return D=l,0|(s=5);if((0|(e|=0))==(0|(n|=0))&(0|t)==(0|r))return i[s>>2]=0,D=l,0|(s=0);if(c=0|Gt(0|e,0|t,52),w(),c&=15,h=0|Gt(0|n,0|r,52),w(),(0|c)!=(15&h))return D=l,0|(s=12);if(u=c+-1|0,c>>>0>1){Ue(e,t,u,o),Ue(n,r,u,a),A=0|i[(h=o)>>2],h=0|i[h+4>>2];e:do{if((0|A)==(0|i[a>>2])&&(0|h)==(0|i[a+4>>2])){u=0|Gt(0|e,0|t,0|(c=3*(15^c)|0)),w(),u&=7,c=0|Gt(0|n,0|r,0|c),w(),c&=7;do{if(!(0|u)|!(0|c))i[s>>2]=1,u=0;else if(7==(0|u))u=5;else{if(1==(0|u)|1==(0|c)&&0|Oe(A,h)){u=5;break}if((0|i[15536+(u<<2)>>2])!=(0|c)&&(0|i[15568+(u<<2)>>2])!=(0|c))break e;i[s>>2]=1,u=0}}while(0);return D=l,0|(s=u)}}while(0)}c=(u=o)+56|0;do{i[u>>2]=0,u=u+4|0}while((0|u)<(0|c));return L(e,t,1,o),u=(0|i[(t=o)>>2])==(0|n)&&(0|i[t+4>>2])==(0|r)||(0|i[(t=o+8|0)>>2])==(0|n)&&(0|i[t+4>>2])==(0|r)||(0|i[(t=o+16|0)>>2])==(0|n)&&(0|i[t+4>>2])==(0|r)||(0|i[(t=o+24|0)>>2])==(0|n)&&(0|i[t+4>>2])==(0|r)||(0|i[(t=o+32|0)>>2])==(0|n)&&(0|i[t+4>>2])==(0|r)||(0|i[(t=o+40|0)>>2])==(0|n)&&(0|i[t+4>>2])==(0|r)?1:1&((0|i[(u=o+48|0)>>2])==(0|n)?(0|i[u+4>>2])==(0|r):0),i[s>>2]=u,D=l,0|(s=0)},_bitshift64Ashr:qt,_bitshift64Lshr:Gt,_bitshift64Shl:zt,_calloc:Pt,_cellAreaKm2:function(e,t,n){return 0|(e=0|rt(e|=0,t|=0,n|=0))||(s[n>>3]=6371.007180918475*+s[n>>3]*6371.007180918475),0|e},_cellAreaM2:function(e,t,n){return 0|(e=0|rt(e|=0,t|=0,n|=0))||(s[n>>3]=6371.007180918475*+s[n>>3]*6371.007180918475*1e3*1e3),0|e},_cellAreaRads2:rt,_cellToBoundary:Qe,_cellToCenterChild:function(e,t,n,r){n|=0,r|=0;var s=0;return s=0|Gt(0|(e|=0),0|(t|=0),52),w(),(0|n)<16&(0|(s&=15))<=(0|n)?((0|s)<(0|n)&&(s=0|zt(-1,-1,3+(3*(n+-1-s|0)|0)|0),s=0|zt(0|~s,0|~w(),3*(15-n|0)|0),t=~w()&t,e&=~s),s=0|zt(0|n,0,52),n=-15728641&t|w(),i[r>>2]=e|s,i[r+4>>2]=n,0|(r=0)):0|(r=4)},_cellToChildPos:function(e,t,n,r){n|=0,r|=0;var s,a=0,o=0,l=0,u=0,c=0,A=0,h=0,d=0,p=0,f=0,m=0,g=0,v=0,_=0;if(s=D,D=D+16|0,v=s,_=0|Gt(0|(e|=0),0|(t|=0),52),w(),_&=15,n>>>0>15)return D=s,0|(_=4);if((0|_)<(0|n))return D=s,0|(_=12);if((0|_)!=(0|n))if(o=0|zt(0|n,0,52),o|=e,u=w()|-15728641&t,(0|_)>(0|n)){c=n;do{g=0|zt(7,0,3*(14-c|0)|0),c=c+1|0,o|=g,u=w()|u}while((0|c)<(0|_));g=o}else g=o;else g=e,u=t;m=0|Gt(0|g,0|u,45),w();e:do{if(0|q(127&m)){if(c=0|Gt(0|g,0|u,52),w(),0|(c&=15))for(o=1;;){if(!(!((m=0|zt(7,0,3*(15-o|0)|0))&g)&!(w()&u))){A=33;break e}if(!(o>>>0<c>>>0))break;o=o+1|0}if(i[(m=r)>>2]=0,i[m+4>>2]=0,(0|_)>(0|n)){for(m=-15728641&t,f=_;;){if(p=f,(f=f+-1|0)>>>0>15|(0|_)<(0|f)){A=19;break}if((0|_)!=(0|f))if(o=0|zt(0|f,0,52),o|=e,c=w()|m,(0|_)<(0|p))d=o;else{A=f;do{d=0|zt(7,0,3*(14-A|0)|0),A=A+1|0,o|=d,c=w()|c}while((0|A)<(0|_));d=o}else d=e,c=t;if(h=0|Gt(0|d,0|c,45),w(),0|q(127&h)){h=0|Gt(0|d,0|c,52),w(),h&=15;t:do{if(h)for(A=1;;){if(o=0|Gt(0|d,0|c,3*(15-A|0)|0),w(),0|(o&=7))break t;if(!(A>>>0<h>>>0)){o=0;break}A=A+1|0}else o=0}while(0);o=1&!(0|o)}else o=0;if(c=0|Gt(0|e,0|t,3*(15-p|0)|0),w(),7==(0|(c&=7))){a=5,A=42;break}if(1==(0|c)&(o=!!(0|o))){a=5,A=42;break}if(0|(d=c+((!!(0|c)&o)<<31>>31)|0)&&(A=0|At(7,0,A=_-p|0,((0|A)<0)<<31>>31),h=0|w(),o?(o=0|Dt(0|(o=0|Ot(0|A,0|h,5,0)),0|w(),-5,-1),o=0|Dt(0|(o=0|Bt(0|o,0|w(),6,0)),0|w(),1,0),c=0|w()):(o=A,c=h),p=0|Dt(0|o,0|c,0|(p=0|Ot(0|A,0|h,0|(p=d+-1|0),((0|p)<0)<<31>>31)),0|w()),h=0|Dt(0|p,0|(d=0|w()),0|i[(h=r)>>2],0|i[h+4>>2]),d=0|w(),i[(p=r)>>2]=h,i[p+4>>2]=d),(0|f)<=(0|n)){A=37;break}}if(19==(0|A))M(23313,22674,1099,22710);else{if(37==(0|A)){a=0|i[(l=r)+4>>2],l=0|i[l>>2];break}if(42==(0|A))return D=s,0|a}}else a=0,l=0}else A=33}while(0);e:do{if(33==(0|A)){if(i[(m=r)>>2]=0,i[m+4>>2]=0,(0|_)>(0|n)){for(o=_;;){if(a=0|Gt(0|e,0|t,3*(15-o|0)|0),w(),7==(0|(a&=7))){a=5;break}if(a=0|Ot(0|(l=0|At(7,0,l=_-o|0,((0|l)<0)<<31>>31)),0|w(),0|a,0),l=0|w(),l=0|Dt(0|i[(m=r)>>2],0|i[m+4>>2],0|a,0|l),a=0|w(),i[(m=r)>>2]=l,i[m+4>>2]=a,(0|(o=o+-1|0))<=(0|n))break e}return D=s,0|a}a=0,l=0}}while(0);return 0|Be(g,u,_,v)&&M(23313,22674,1063,22725),((0|a)>-1|-1==(0|a)&l>>>0>4294967295)&((0|(v=0|i[(_=v)+4>>2]))>(0|a)|((0|v)==(0|a)?(0|i[_>>2])>>>0>l>>>0:0))?(D=s,0|(_=0)):(M(23313,22674,1139,22710),0)},_cellToChildren:function(e,t,n,r){r|=0;var s,a,o=0,l=0;if(a=D,D=D+16|0,$e(s=a,e|=0,t|=0,n|=0),!(0|(e=0|i[(t=s)>>2]))&!(0|(t=0|i[t+4>>2])))return D=a,0;o=0,n=0;do{i[(l=r+(o<<3)|0)>>2]=e,i[l+4>>2]=t,o=0|Dt(0|o,0|n,1,0),n=0|w(),Ke(s),e=0|i[(l=s)>>2],t=0|i[l+4>>2]}while(!(!(0|e)&!(0|t)));return D=a,0},_cellToChildrenSize:Be,_cellToLatLng:Xe,_cellToLocalIj:function(e,t,n,r,i,s){var a,o;return e|=0,t|=0,n|=0,r|=0,s|=0,o=D,D=D+16|0,a=o,(i|=0)?e=15:(e=0|ut(e,t,n,r,a))||(_e(a,s),e=0),D=o,0|e},_cellToParent:Ue,_cellToVertex:yt,_cellToVertexes:function(e,t,n){n|=0;var r,s=0,a=0;return a=!(0|Oe(e|=0,t|=0)),r=!(0|(s=0|yt(e,t,0,n))),a?r?0|(s=0|yt(e,t,1,n+8|0))||0|(s=0|yt(e,t,2,n+16|0))||0|(s=0|yt(e,t,3,n+24|0))||(s=0|yt(e,t,4,n+32|0))?0|(a=s):0|yt(e,t,5,n+40|0):0|(a=s):r?0|(s=0|yt(e,t,1,n+8|0))||0|(s=0|yt(e,t,2,n+16|0))||0|(s=0|yt(e,t,3,n+24|0))||0|(s=0|yt(e,t,4,n+32|0))?0|(a=s):(i[(a=n+40|0)>>2]=0,i[a+4>>2]=0,0|(a=0)):0|(a=s)},_cellsToDirectedEdge:function(e,t,n,r,s){return s|=0,7==(0|(n=0|F(e|=0,t|=0,n|=0,r|=0)))?0|(s=11):(r=0|zt(0|n,0,56),t=-2130706433&t|w()|268435456,i[s>>2]=e|r,i[s+4>>2]=t,0|(s=0))},_cellsToLinkedMultiPolygon:function(e,t,n){n|=0;var r,s,a,o=0;if(a=D,D=D+32|0,r=a,e=0|function(e,t,n){e|=0,n|=0;var r,s,a=0,o=0,l=0,u=0,c=0,A=0;if(s=D,D=D+176|0,r=s,(0|(t|=0))<1)return xt(n,0,0),D=s,0;for(c=0|Gt(0|i[(c=e)>>2],0|i[c+4>>2],52),w(),xt(n,(0|t)>6?t:6,15&c),c=0;!(0|(a=0|Qe(0|i[(a=e+(c<<3)|0)>>2],0|i[a+4>>2],r)));){if((0|(a=0|i[r>>2]))>0){u=0;do{l=r+8+(u<<4)|0,(o=0|Mt(n,a=r+8+((0|(u=u+1|0))%(0|a)<<4)|0,l))?Tt(n,o):wt(n,l,a),a=0|i[r>>2]}while((0|u)<(0|a))}if((0|(c=c+1|0))>=(0|t)){a=0,A=13;break}}return 13==(0|A)?(D=s,0|a):(bt(n),D=s,0|(A=a))}(e|=0,t|=0,s=a+16|0),0|e)return D=a,0|(n=e);if(i[n>>2]=0,i[n+4>>2]=0,i[n+8>>2]=0,0|(e=0|St(s)))do{t=0|it(n);do{st(t,e),o=e+16|0,i[r>>2]=i[o>>2],i[r+4>>2]=i[o+4>>2],i[r+8>>2]=i[o+8>>2],i[r+12>>2]=i[o+12>>2],Tt(s,e),e=0|Et(s,r)}while(0|e);e=0|St(s)}while(0|e);return bt(s),(e=0|ot(n))?(at(n),D=a,0|(o=e)):(D=a,0|(o=0))},_childPosToCell:function(e,t,n,r,s,a){e|=0,t|=0,a|=0;var o,l=0,u=0,c=0,A=0,h=0,d=0,p=0,f=0,m=0;if(o=D,D=D+16|0,l=o,(s|=0)>>>0>15)return D=o,0|(a=4);if(u=0|Gt(0|(n|=0),0|(r|=0),52),w(),(0|(u&=15))>(0|s))return D=o,0|(a=12);if(0|Be(n,r,s,l)&&M(23313,22674,1063,22725),!(((0|t)>-1|-1==(0|t)&e>>>0>4294967295)&((0|(A=0|i[(h=l)+4>>2]))>(0|t)|((0|A)==(0|t)?(0|i[h>>2])>>>0>e>>>0:0))))return D=o,0|(a=2);h=s-u|0,s=0|zt(0|s,0,52),c=w()|-15728641&r,i[(A=a)>>2]=s|n,i[A+4>>2]=c,A=0|Gt(0|n,0|r,45),w();e:do{if(0|q(127&A)){if(0|u)for(l=1;;){if(!(!((A=0|zt(7,0,3*(15-l|0)|0))&n)&!(w()&r)))break e;if(!(l>>>0<u>>>0))break;l=l+1|0}if((0|h)<1)return D=o,0|(a=0);for(A=15^u,r=-1,c=1,l=1;;){u=0|At(7,0,u=h-c|0,((0|u)<0)<<31>>31),n=0|w();do{if(l){if(l=0|Bt(0|(l=0|Dt(0|(l=0|Ot(0|u,0|n,5,0)),0|w(),-5,-1)),0|w(),6,0),(0|t)>(0|(s=0|w()))|(0|t)==(0|s)&e>>>0>l>>>0){t=0|Lt(0|(t=0|Dt(0|e,0|t,-1,-1)),0|w(),0|l,0|s),l=0|w(),f=0|i[(d=a)>>2],d=0|i[d+4>>2],p=0|zt(7,0,0|(m=3*(A+r|0)|0)),d&=~w(),m=0|zt(0|(s=0|Dt(0|(r=0|Bt(0|t,0|l,0|u,0|n)),0|(e=0|w()),2,0)),0|w(),0|m),d=w()|d,i[(s=a)>>2]=m|f&~p,i[s+4>>2]=d,e=0|Lt(0|t,0|l,0|(e=0|Ot(0|r,0|e,0|u,0|n)),0|w()),l=0,t=0|w();break}p=0|i[(m=a)>>2],m=0|i[m+4>>2],f=0|zt(7,0,3*(A+r|0)|0),m&=~w(),i[(l=a)>>2]=p&~f,i[l+4>>2]=m,l=1;break}s=0|i[(p=a)>>2],p=0|i[p+4>>2],d=0|zt(7,0,0|(r=3*(A+r|0)|0)),p&=~w(),r=0|zt(0|(m=0|Bt(0|e,0|t,0|u,0|n)),0|(l=0|w()),0|r),p=w()|p,i[(f=a)>>2]=r|s&~d,i[f+4>>2]=p,e=0|Lt(0|e,0|t,0|(l=0|Ot(0|m,0|l,0|u,0|n)),0|w()),l=0,t=0|w()}while(0);if(!((0|h)>(0|c))){t=0;break}r=~c,c=c+1|0}return D=o,0|t}}while(0);if((0|h)<1)return D=o,0|(m=0);for(s=15^u,l=1;;){if(f=0|At(7,0,f=h-l|0,((0|f)<0)<<31>>31),m=0|w(),n=0|i[(c=a)>>2],c=0|i[c+4>>2],r=0|zt(7,0,0|(u=3*(s-l|0)|0)),c&=~w(),u=0|zt(0|(d=0|Bt(0|e,0|t,0|f,0|m)),0|(p=0|w()),0|u),c=w()|c,i[(A=a)>>2]=u|n&~r,i[A+4>>2]=c,e=0|Lt(0|e,0|t,0|(m=0|Ot(0|d,0|p,0|f,0|m)),0|w()),t=0|w(),(0|h)<=(0|l)){t=0;break}l=l+1|0}return D=o,0|t},_compactCells:function(e,t,n,r){t|=0;var s,a=0,o=0,l=0,u=0,c=0,A=0,h=0,d=0,p=0,f=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0,S=0,T=0,E=0;if(!(0|(n|=0))&!(0|(r|=0)))return 0|(T=0);if(o=0|i[(a=e|=0)>>2],!0&!(15728640&(a=0|i[a+4>>2]))){if(!((0|r)>0|!(0|r)&n>>>0>0))return 0|(T=0);if(i[(T=t)>>2]=o,i[T+4>>2]=a,1==(0|n)&!(0|r))return 0|(T=0);a=1;do{S=0|i[(b=e+(a<<3)|0)+4>>2],i[(T=t+(a<<3)|0)>>2]=i[b>>2],i[T+4>>2]=S,a=a+1|0}while(0<(0|r)|!(0|r)&a>>>0<n>>>0);return 0|(a=0)}if(!(S=0|Rt(s=n<<3)))return 0|(T=13);if(Wt(0|S,0|e,0|s),!(b=0|Pt(n,8)))return Nt(S),0|(T=13);e:do{if(0|n){t:for(;;){y=0|Gt(0|(_=0|i[(a=S)>>2]),0|(a=0|i[a+4>>2]),52),w(),x=(y&=15)+-1|0,v=(0|n)>0;n:do{if(!!(0|y)&v){if(f=((0|n)<0)<<31>>31,m=0|zt(0|x,0,52),g=0|w(),x>>>0>15){if(!(!(0|_)&!(0|a))){T=17;break t}for(o=0;;){if((0|(o=o+1|0))>=(0|n))break n;if(!(!(0|(g=0|i[(r=S+(o<<3)|0)>>2]))&!(0|(r=0|i[r+4>>2])))){a=r,T=17;break t}}}for(o=0,e=_,r=a;;){if(!(!(0|e)&!(0|r))){if(!(!0&!(117440512&r))){T=22;break t}if(u=0|Gt(0|e,0|r,52),w(),(0|(u&=15))<(0|x)){a=12,T=28;break t}if((0|u)!=(0|x)&&(e|=m,r=-15728641&r|g,u>>>0>=y>>>0)){l=x;do{p=0|zt(7,0,3*(14-l|0)|0),l=l+1|0,e|=p,r=w()|r}while(l>>>0<u>>>0)}if(l=0|kt(0|e,0|r,0|n,0|f),w(),!(0|(c=0|i[(u=A=b+(l<<3)|0)>>2]))&!(0|(u=0|i[u+4>>2])))l=A;else for(p=0;;){if((0|p)>(0|n)){T=32;break t}if((0|c)==(0|e)&(-117440513&u)==(0|r)){h=0|Gt(0|c,0|u,56),w(),d=(h&=7)+1|0,E=0|Gt(0|c,0|u,45),w();r:do{if(0|q(127&E)){if(c=0|Gt(0|c,0|u,52),w(),!(c&=15)){u=6;break}for(u=1;;){if(!(!((E=0|zt(7,0,3*(15-u|0)|0))&e)&!(w()&r))){u=7;break r}if(!(u>>>0<c>>>0)){u=6;break}u=u+1|0}}else u=7}while(0);if((h+2|0)>>>0>u>>>0){T=42;break t}E=0|zt(0|d,0,56),r=w()|-117440513&r,i[(d=A)>>2]=0,i[d+4>>2]=0,e|=E}else l=(l+1|0)%(0|n)|0;if(!(0|(c=0|i[(u=A=b+(l<<3)|0)>>2]))&!(0|(u=0|i[u+4>>2]))){l=A;break}p=p+1|0}i[(E=l)>>2]=e,i[E+4>>2]=r}if((0|(o=o+1|0))>=(0|n))break n;e=0|i[(r=S+(o<<3)|0)>>2],r=0|i[r+4>>2]}}}while(0);if((n+5|0)>>>0<11){T=85;break}if(!(g=0|Pt((0|n)/6|0,8))){T=49;break}n:do{if(v){p=0,d=0;do{if(!(!(0|(o=0|i[(r=u=b+(p<<3)|0)>>2]))&!(0|(r=0|i[r+4>>2])))){c=0|Gt(0|o,0|r,56),w(),e=(c&=7)+1|0,A=-117440513&r,E=0|Gt(0|o,0|r,45),w();r:do{if(0|q(127&E)){if(h=0|Gt(0|o,0|r,52),w(),0|(h&=15))for(l=1;;){if(!(!(o&(E=0|zt(7,0,3*(15-l|0)|0)))&!(A&w())))break r;if(!(l>>>0<h>>>0))break;l=l+1|0}o|=r=0|zt(0|e,0,56),r=w()|A,i[(e=u)>>2]=o,i[e+4>>2]=r,e=c+2|0}}while(0);7==(0|e)&&(i[(E=g+(d<<3)|0)>>2]=o,i[E+4>>2]=-117440513&r,d=d+1|0)}p=p+1|0}while((0|p)!=(0|n));if(v){if(p=((0|n)<0)<<31>>31,f=0|zt(0|x,0,52),m=0|w(),x>>>0>15){if(!(!(0|_)&!(0|a))){a=4,T=84;break t}for(a=0;;){if((0|(a=a+1|0))>=(0|n)){o=0,a=d;break n}if(!(!(0|i[(E=S+(a<<3)|0)>>2])&!(0|i[E+4>>2]))){a=4,T=84;break t}}}for(h=0,o=0,A=_;;){do{if(!(!(0|A)&!(0|a))){if(u=0|Gt(0|A,0|a,52),w(),(0|(u&=15))<(0|x)){a=12,T=84;break t}do{if((0|u)==(0|x))r=A,u=a;else{if(r=A|f,e=-15728641&a|m,u>>>0<y>>>0){u=e;break}l=x;do{E=0|zt(7,0,3*(14-l|0)|0),l=l+1|0,r|=E,e=w()|e}while(l>>>0<u>>>0);u=e}}while(0);for(l=0|kt(0|r,0|u,0|n,0|p),w(),e=0;;){if((0|e)>(0|n)){T=77;break t}if((-117440513&(c=0|i[(E=b+(l<<3)|0)+4>>2]))==(0|u)&&(0|i[E>>2])==(0|r)){T=79;break}if((0|i[(E=b+((l=(l+1|0)%(0|n)|0)<<3)|0)>>2])==(0|r)&&(0|i[E+4>>2])==(0|u))break;e=e+1|0}if(79==(0|T)&&(T=0,!0&100663296==(117440512&c)))break;i[(E=t+(o<<3)|0)>>2]=A,i[E+4>>2]=a,o=o+1|0}}while(0);if((0|(a=h+1|0))>=(0|n)){a=d;break n}h=a,A=0|i[(E=S+(a<<3)|0)>>2],a=0|i[E+4>>2]}}else o=0,a=d}else o=0,a=0}while(0);if(Xt(0|b,0,0|s),Wt(0|S,0|g,a<<3),Nt(g),!a)break e;t=t+(o<<3)|0,n=a}if(17==(0|T))!0&!(117440512&a)?(a=4,T=28):T=22;else if(32==(0|T))M(23313,22674,362,22684);else{if(42==(0|T))return Nt(S),Nt(b),0|(E=10);if(49==(0|T))return Nt(S),Nt(b),0|(E=13);if(77==(0|T))M(23313,22674,462,22684);else{if(84==(0|T))return Nt(g),Nt(S),Nt(b),0|(E=a);if(85==(0|T)){Wt(0|t,0|S,n<<3);break}}}if(22==(0|T))return Nt(S),Nt(b),0|(E=5);if(28==(0|T))return Nt(S),Nt(b),0|(E=a)}}while(0);return Nt(S),Nt(b),0|(E=0)},_destroyLinkedMultiPolygon:at,_directedEdgeToBoundary:Se,_directedEdgeToCells:function(e,t,n){e|=0;var r,s,a,o=0;return r=D,D=D+16|0,o=r,!0&268435456==(2013265920&(t|=0))?(s=-2130706433&t|134217728,i[(a=n|=0)>>2]=e,i[a+4>>2]=s,i[o>>2]=0,t=0|Gt(0|e,0|t,56),w(),o=0|O(e,s,7&t,o,n+8|0),D=r,0|o):(D=r,0|(o=6))},_edgeLengthKm:function(e,t,n){n|=0;var r,a=0,o=0,l=0,u=0,A=0,p=0,f=0;if(r=D,D=D+176|0,0|(e=0|Se(e|=0,t|=0,u=r)))return u=e,l=+s[n>>3],l*=6371.007180918475,s[n>>3]=l,D=r,0|u;if(s[n>>3]=0,(0|(e=0|i[u>>2]))<=1)return u=0,l=0,l*=6371.007180918475,s[n>>3]=l,D=r,0|u;t=e+-1|0,e=0,a=+s[u+8>>3],o=+s[u+16>>3],l=0;do{p=a,a=+s[u+8+((e=e+1|0)<<4)>>3],f=+d(.5*(a-p)),A=o,o=+s[u+8+(e<<4)+8>>3],A=f*f+(A=+d(.5*(o-A)))*(+h(+p)*+h(+a)*A),l+=2*+v(+ +c(+A),+ +c(+(1-A)))}while((0|e)!=(0|t));return s[n>>3]=l,u=0,f=l,f*=6371.007180918475,s[n>>3]=f,D=r,0|u},_edgeLengthM:function(e,t,n){n|=0;var r,a=0,o=0,l=0,u=0,A=0,p=0,f=0;if(r=D,D=D+176|0,0|(e=0|Se(e|=0,t|=0,u=r)))return u=e,l=+s[n>>3],l*=6371.007180918475,l*=1e3,s[n>>3]=l,D=r,0|u;if(s[n>>3]=0,(0|(e=0|i[u>>2]))<=1)return u=0,l=0,l*=6371.007180918475,l*=1e3,s[n>>3]=l,D=r,0|u;t=e+-1|0,e=0,a=+s[u+8>>3],o=+s[u+16>>3],l=0;do{p=a,a=+s[u+8+((e=e+1|0)<<4)>>3],f=+d(.5*(a-p)),A=o,o=+s[u+8+(e<<4)+8>>3],A=f*f+(A=+d(.5*(o-A)))*(+h(+p)*+h(+a)*A),l+=2*+v(+ +c(+A),+ +c(+(1-A)))}while((0|e)!=(0|t));return s[n>>3]=l,u=0,f=l,f*=6371.007180918475,f*=1e3,s[n>>3]=f,D=r,0|u},_edgeLengthRads:function(e,t,n){n|=0;var r,a=0,o=0,l=0,u=0,A=0,p=0,f=0;if(r=D,D=D+176|0,0|(e=0|Se(e|=0,t|=0,u=r)))return D=r,0|(u=e);if(s[n>>3]=0,(0|(e=0|i[u>>2]))<=1)return D=r,0|(u=0);t=e+-1|0,e=0,a=+s[u+8>>3],o=+s[u+16>>3],l=0;do{p=a,a=+s[u+8+((e=e+1|0)<<4)>>3],f=+d(.5*(a-p)),A=o,o=+s[u+8+(e<<4)+8>>3],A=f*f+(A=+d(.5*(o-A)))*(+h(+a)*+h(+p)*A),l+=2*+v(+ +c(+A),+ +c(+(1-A)))}while((0|e)<(0|t));return s[n>>3]=l,D=r,0|(u=0)},_emscripten_replace_memory:function(e){return r=new Int8Array(e),i=new Int32Array(e),s=new Float64Array(e),n=e,!0},_free:Nt,_getBaseCellNumber:Le,_getDirectedEdgeDestination:function(e,t,n){e|=0,t|=0,n|=0;var r,s,a=0;return r=D,D=D+16|0,i[(a=r)>>2]=0,!0&268435456==(2013265920&t)?(s=0|Gt(0|e,0|t,56),w(),a=0|O(e,-2130706433&t|134217728,7&s,a,n),D=r,0|a):(D=r,0|(a=6))},_getDirectedEdgeOrigin:function(e,t,n){return e|=0,n|=0,!0&268435456==(2013265920&(t|=0))?(i[n>>2]=e,i[n+4>>2]=-2130706433&t|134217728,0|(n=0)):0|(n=6)},_getHexagonAreaAvgKm2:function(e,t){return t|=0,(e|=0)>>>0>15?0|(t=4):(s[t>>3]=+s[20528+(e<<3)>>3],0|(t=0))},_getHexagonAreaAvgM2:function(e,t){return t|=0,(e|=0)>>>0>15?0|(t=4):(s[t>>3]=+s[20656+(e<<3)>>3],0|(t=0))},_getHexagonEdgeLengthAvgKm:function(e,t){return t|=0,(e|=0)>>>0>15?0|(t=4):(s[t>>3]=+s[20784+(e<<3)>>3],0|(t=0))},_getHexagonEdgeLengthAvgM:function(e,t){return t|=0,(e|=0)>>>0>15?0|(t=4):(s[t>>3]=+s[20912+(e<<3)>>3],0|(t=0))},_getIcosahedronFaces:function e(t,n,r){r|=0;var s,a=0,o=0,l=0,u=0,c=0,A=0,h=0,d=0;s=D,D=D+128|0,h=s+112|0,l=s+96|0,d=s,o=0|Gt(0|(t|=0),0|(n|=0),52),w(),c=15&o,i[h>>2]=c,u=0|Gt(0|t,0|n,45),w(),u&=127;e:do{if(0|q(u)){if(0|c)for(a=1;;){if(!(!((A=0|zt(7,0,3*(15-a|0)|0))&t)&!(w()&n))){o=0;break e}if(!(a>>>0<c>>>0))break;a=a+1|0}if(!(1&o))return A=0|zt(c+1|0,0,52),d=w()|-15728641&n,d=0|e((A|t)&~(h=0|zt(7,0,3*(14-c|0)|0)),d&~w(),r),D=s,0|d;o=1}else o=0}while(0);if(!(a=0|We(t,n,l))){o?(Ce(l,h,d),A=5):(De(l,h,d),A=6);e:do{if(0|q(u))if(c)for(a=1;;){if(!(!((u=0|zt(7,0,3*(15-a|0)|0))&t)&!(w()&n))){t=2;break e}if(!(a>>>0<c>>>0)){t=5;break}a=a+1|0}else t=5;else t=2}while(0);Xt(0|r,-1,t<<2);e:do{if(o)for(l=0;;){if(Ne(u=d+(l<<4)|0,0|i[h>>2]),u=0|i[u>>2],-1==(0|(c=0|i[r>>2]))|(0|c)==(0|u))a=r;else{o=0;do{if((o=o+1|0)>>>0>=t>>>0){a=1;break e}c=0|i[(a=r+(o<<2)|0)>>2]}while(!(-1==(0|c)|(0|c)==(0|u)))}if(i[a>>2]=u,(l=l+1|0)>>>0>=A>>>0){a=0;break}}else for(l=0;;){if(Re(u=d+(l<<4)|0,0|i[h>>2],0,1),u=0|i[u>>2],-1==(0|(c=0|i[r>>2]))|(0|c)==(0|u))a=r;else{o=0;do{if((o=o+1|0)>>>0>=t>>>0){a=1;break e}c=0|i[(a=r+(o<<2)|0)>>2]}while(!(-1==(0|c)|(0|c)==(0|u)))}if(i[a>>2]=u,(l=l+1|0)>>>0>=A>>>0){a=0;break}}}while(0)}return D=s,0|(d=a)},_getNumCells:tt,_getPentagons:Ye,_getRes0Cells:function(e){e|=0;var t=0,n=0,r=0;t=0;do{zt(0|t,0,45),r=134225919|w(),i[(n=e+(t<<3)|0)>>2]=-1,i[n+4>>2]=r,t=t+1|0}while(122!=(0|t));return 0},_getResolution:function(e,t){return t=0|Gt(0|(e|=0),0|(t|=0),52),w(),15&t},_greatCircleDistanceKm:et,_greatCircleDistanceM:function(e,t){e|=0;var n,r,i,a=0;return r=+s[(t|=0)>>3],n=+s[e>>3],a=(i=+d(.5*(r-n)))*i+(a=+d(.5*(+s[t+8>>3]-+s[e+8>>3])))*(+h(+r)*+h(+n)*a),2*+v(+ +c(+a),+ +c(+(1-a)))*6371.007180918475*1e3},_greatCircleDistanceRads:function(e,t){e|=0;var n,r,i,a=0;return r=+s[(t|=0)>>3],n=+s[e>>3],a=(i=+d(.5*(r-n)))*i+(a=+d(.5*(+s[t+8>>3]-+s[e+8>>3])))*(+h(+r)*+h(+n)*a),2*+v(+ +c(+a),+ +c(+(1-a)))},_gridDisk:L,_gridDiskDistances:I,_gridDistance:function(e,t,n,r,s){n|=0,r|=0,s|=0;var a,o,l=0,u=0;return o=D,D=D+32|0,u=o,0|(a=0|ut(e|=0,t|=0,e,t,l=o+12|0))?(D=o,0|(u=a)):0|(e=0|ut(e,t,n,r,u))?(D=o,0|(u=e)):(l=0|ve(l,u),i[(u=s)>>2]=l,i[u+4>>2]=((0|l)<0)<<31>>31,D=o,0|(u=0))},_gridPathCells:function(e,t,n,r,s){n|=0,r|=0,s|=0;var a,o=0,l=0,c=0,A=0,h=0,d=0,p=0,f=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0,S=0,T=0,E=0,C=0;if(a=D,D=D+48|0,c=a+12|0,E=a,!(o=0|ut(e|=0,t|=0,e,t,l=a+24|0))&&!(o=0|ut(e,t,n,r,c))){T=((0|(S=0|ve(l,c)))<0)<<31>>31,i[l>>2]=0,i[l+4>>2]=0,i[l+8>>2]=0,i[c>>2]=0,i[c+4>>2]=0,i[c+8>>2]=0,0|ut(e,t,e,t,l)&&M(23313,23090,691,23299),0|ut(e,t,n,r,c)&&M(23313,23090,696,23299),xe(l),xe(c),S?(g=+(0|S),b=l,r=p=0|i[l>>2],o=f=0|i[(y=l+4|0)>>2],n=m=0|i[(x=l+8|0)>>2],v=+((0|i[c>>2])-p|0)/g,_=+((0|i[c+4>>2])-f|0)/g,g=+((0|i[c+8>>2])-m|0)/g):(y=o=l+4|0,x=n=l+8|0,b=l,r=0|i[l>>2],o=0|i[o>>2],n=0|i[n>>2],v=0,_=0,g=0),i[E>>2]=r,i[(m=E+4|0)>>2]=o,i[(f=E+8|0)>>2]=n;e:do{if((0|S)<0)o=0;else for(d=0,p=0,o=r;;){C=v*(h=+(p>>>0)+4294967296*+(0|d))+ +(0|o),A=_*h+ +(0|i[y>>2]),h=g*h+ +(0|i[x>>2]),n=~~+jt(+C),l=~~+jt(+A),o=~~+jt(+h),C=+u(+(+(0|n)-C)),A=+u(+(+(0|l)-A)),h=+u(+(+(0|o)-h));do{if(!(C>A&C>h)){if(c=0-n|0,A>h){r=c-o|0;break}r=l,o=c-l|0;break}n=0-(l+o)|0,r=l}while(0);if(i[E>>2]=n,i[m>>2]=r,i[f>>2]=o,be(E),0|(o=0|ct(e,t,E,s+(p<<3)|0)))break e;if(!((0|d)<(0|T)|(0|d)==(0|T)&p>>>0<S>>>0)){o=0;break e}o=0|Dt(0|p,0|d,1,0),d=c=0|w(),p=o,o=0|i[b>>2]}}while(0);return D=a,0|(E=o)}return D=a,0|(E=o)},_gridPathCellsSize:function(e,t,n,r,s){n|=0,r|=0,s|=0;var a,o=0,l=0,u=0;return a=D,D=D+32|0,u=a,(o=0|ut(e|=0,t|=0,e,t,l=a+12|0))||(o=0|ut(e,t,n,r,u))?(D=a,0|(u=o)):(r=0|Dt(0|(r=0|ve(l,u)),((0|r)<0)<<31>>31,1,0),l=0|w(),i[(u=s)>>2]=r,i[u+4>>2]=l,D=a,0|(u=0))},_gridRingUnsafe:function(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var s,a,o=0,l=0,u=0,c=0,A=0,h=0,d=0,p=0,f=0;if(a=D,D=D+16|0,f=a+8|0,i[(p=s=a)>>2]=e,i[p+4>>2]=t,!n)return i[(f=r)>>2]=e,i[f+4>>2]=t,D=a,0|(f=0);i[f>>2]=0;e:do{if(0|Oe(e,t))e=9;else{if(l=(0|n)>0){o=0,p=e;do{if(0|(e=0|O(p,t,4,f,s)))break e;if(o=o+1|0,0|Oe(p=0|i[(t=s)>>2],t=0|i[t+4>>2])){e=9;break e}}while((0|o)<(0|n));if(i[(d=r)>>2]=p,i[d+4>>2]=t,d=n+-1|0,l){h=0,e=1;do{if(o=22384+(h<<2)|0,5==(0|h))for(u=0|i[o>>2],l=0,o=e;;){if(0|(e=0|O(0|i[(e=s)>>2],0|i[e+4>>2],u,f,s)))break e;if((0|l)!=(0|d)){if(c=0|i[(A=s)>>2],A=0|i[A+4>>2],i[(e=r+(o<<3)|0)>>2]=c,i[e+4>>2]=A,0|Oe(c,A)){e=9;break e}e=o+1|0}else e=o;if((0|(l=l+1|0))>=(0|n))break;o=e}else for(u=s,A=0|i[o>>2],c=0,o=e,l=0|i[u>>2],u=0|i[u+4>>2];;){if(0|(e=0|O(l,u,A,f,s)))break e;if(l=0|i[(u=s)>>2],u=0|i[u+4>>2],i[(e=r+(o<<3)|0)>>2]=l,i[e+4>>2]=u,e=o+1|0,0|Oe(l,u)){e=9;break e}if((0|(c=c+1|0))>=(0|n))break;o=e}h=h+1|0}while(h>>>0<6);u=p,o=0|i[(e=s)>>2],l=t,e=0|i[e+4>>2]}else u=p,o=p,l=t,e=t}else i[(u=r)>>2]=e,i[u+4>>2]=t,u=e,o=e,l=t,e=t;e=(0|u)==(0|o)&(0|l)==(0|e)?0:9}}while(0);return D=a,0|(f=e)},_i64Add:Dt,_i64Subtract:Lt,_isPentagon:Oe,_isResClassIII:function(e,t){return t=0|Gt(0|(e|=0),0|(t|=0),52),w(),1&t},_isValidCell:Ie,_isValidDirectedEdge:function(e,t){var n=0;switch(n=0|Gt(0|(e|=0),0|(t|=0),56),w(),7&n){case 0:case 7:return 0|(n=0)}return n=-2130706433&t|134217728,!0&268435456==(2013265920&t)?!0&16777216==(117440512&t)&!!(0|Oe(e,n))?0|(n=0):0|(n=0|Ie(e,n)):0|(n=0)},_isValidVertex:function(e,t){e|=0;var n,r,s=0,a=0;return r=D,D=D+16|0,n=r,!0&536870912==(2013265920&(t|=0))&&0|Ie(e,s=-2130706433&t|134217728)?(a=0|Gt(0|e,0|t,56),w(),s=(a=!(0|yt(e,s,7&a,n)))&((0|i[(s=n)>>2])==(0|e)?(0|i[s+4>>2])==(0|t):0)&1,D=r,0|s):(D=r,0|(s=0))},_latLngToCell:He,_llvm_maxnum_f64:Vt,_llvm_minnum_f64:Ht,_llvm_round_f64:jt,_localIjToCell:function(e,t,n,r,i){var s,a;return e|=0,t|=0,n|=0,i|=0,a=D,D=D+16|0,s=a,(r|=0)?n=15:(n=0|ye(n,s))||(n=0|ct(e,t,s,i)),D=a,0|n},_malloc:Rt,_maxFaceCount:function(e,t,n){n|=0;var r=0,s=0;if(s=0|Gt(0|(e|=0),0|(t|=0),45),w(),!(0|q(127&s)))return s=2,i[n>>2]=s,0;if(s=0|Gt(0|e,0|t,52),w(),!(s&=15))return s=5,i[n>>2]=s,0;for(r=1;;){if(!(!((0|zt(7,0,3*(15-r|0)|0))&e)&!(w()&t))){r=2,e=6;break}if(!(r>>>0<s>>>0)){r=5,e=6;break}r=r+1|0}return 6==(0|e)?(i[n>>2]=r,0):0},_maxGridDiskSize:function(e,t){t|=0;var n=0,r=0,s=0;return(0|(e|=0))<0?0|(t=2):(0|e)>13780509?0|(t=0|tt(15,t)):(s=0|Ot(0|e,0|(n=((0|e)<0)<<31>>31),3,0),r=0|w(),n=0|Dt(0|e,0|n,1,0),n=0|Dt(0|(n=0|Ot(0|s,0|r,0|n,0|w())),0|w(),1,0),e=0|w(),i[t>>2]=n,i[t+4>>2]=e,0|(t=0))},_maxPolygonToCellsSize:function(e,t,n,r){t|=0,r|=0;var s,a=0,o=0,l=0,u=0,c=0;if(s=D,D=D+48|0,a=s+16|0,o=s+8|0,l=s,0|(n|=0))return D=s,0|(l=15);if(u=0|i[(c=e|=0)+4>>2],i[(n=o)>>2]=i[c>>2],i[n+4>>2]=u,dt(o,a),!(t=0|Y(a,t,l))){if(n=0|i[o>>2],(0|(o=0|i[e+8>>2]))>0){a=0|i[e+12>>2],t=0;do{n=(0|i[a+(t<<3)>>2])+n|0,t=t+1|0}while((0|t)<(0|o))}a=0|i[(t=l)>>2],(0|(t=0|i[t+4>>2]))<(0|(o=((0|n)<0)<<31>>31))|(0|t)==(0|o)&a>>>0<n>>>0?(i[(t=l)>>2]=n,i[t+4>>2]=o,t=o):n=a,u=0|Dt(0|n,0|t,12,0),c=0|w(),i[(t=l)>>2]=u,i[t+4>>2]=c,i[(t=r)>>2]=u,i[t+4>>2]=c,t=0}return D=s,0|(c=t)},_memcpy:Wt,_memset:Xt,_originToDirectedEdges:function(e,t,n){n|=0;var r,s=0;return r=!(0|Oe(e|=0,t|=0)),t&=-2130706433,i[(s=n)>>2]=r?e:0,i[s+4>>2]=r?285212672|t:0,i[(s=n+8|0)>>2]=e,i[s+4>>2]=301989888|t,i[(s=n+16|0)>>2]=e,i[s+4>>2]=318767104|t,i[(s=n+24|0)>>2]=e,i[s+4>>2]=335544320|t,i[(s=n+32|0)>>2]=e,i[s+4>>2]=352321536|t,i[(n=n+40|0)>>2]=e,i[n+4>>2]=369098752|t,0},_pentagonCount:function(){return 12},_polygonToCells:function(e,t,n,r){t|=0,r|=0;var s,a,o,l,u=0,c=0,A=0,h=0,d=0,p=0,f=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0,S=0,T=0,M=0,E=0,C=0,R=0,N=0,P=0,L=0,I=0,O=0,F=0,q=0;if(l=D,D=D+112|0,s=l+80|0,d=l+72|0,a=l,o=l+56|0,0|(n|=0))return D=l,0|(q=15);if(!(q=0|Rt(32+(i[(p=(e|=0)+8|0)>>2]<<5)|0)))return D=l,0|(q=13);if(pt(e,q),F=0|i[(O=e)+4>>2],i[(n=d)>>2]=i[O>>2],i[n+4>>2]=F,dt(d,s),n=0|Y(s,t,a))O=0,F=0;else{if(n=0|i[d>>2],(0|(c=0|i[p>>2]))>0){A=0|i[e+12>>2],u=0;do{n=(0|i[A+(u<<3)>>2])+n|0,u=u+1|0}while((0|u)!=(0|c));u=n}else u=n;c=0|i[(n=a)>>2],(0|(n=0|i[n+4>>2]))<(0|(A=((0|u)<0)<<31>>31))|(0|n)==(0|A)&c>>>0<u>>>0?(i[(n=a)>>2]=u,i[n+4>>2]=A,n=A):u=c,O=0|Dt(0|u,0|n,12,0),F=0|w(),i[(n=a)>>2]=O,i[n+4>>2]=F,n=0}if(0|n)return Nt(q),D=l,0|(q=n);if(!(u=0|Pt(O,8)))return Nt(q),D=l,0|(q=13);if(!(h=0|Pt(O,8)))return Nt(q),Nt(u),D=l,0|(q=13);i[(L=s)>>2]=0,i[L+4>>2]=0,I=0|i[(L=e)+4>>2],i[(n=d)>>2]=i[L>>2],i[n+4>>2]=I,n=0|k(d,O,F,t,s,u,h);e:do{if(n)Nt(u),Nt(h),Nt(q);else{t:do{if((0|i[p>>2])>0){for(A=e+12|0,c=0;n=0|k((0|i[A>>2])+(c<<3)|0,O,F,t,s,u,h),c=c+1|0,!(0|n);)if((0|c)>=(0|i[p>>2]))break t;Nt(u),Nt(h),Nt(q);break e}}while(0);(0|F)>0|!(0|F)&O>>>0>0&&Xt(0|h,0,O<<3),L=0|i[(I=s)+4>>2];t:do{if((0|L)>0|!(0|L)&(0|i[I>>2])>>>0>0){R=u,N=h,P=u,L=h,I=u,n=u,M=u,E=h,C=h,u=h;n:for(;;){for(x=0,b=0,S=0,T=0,c=0,A=0;;){d=(h=a)+56|0;do{i[h>>2]=0,h=h+4|0}while((0|h)<(0|d));if(0|U(p=0|i[(t=R+(x<<3)|0)>>2],t=0|i[t+4>>2],1,a,0)){d=(h=a)+56|0;do{i[h>>2]=0,h=h+4|0}while((0|h)<(0|d));0|(h=0|Pt(7,4))&&(B(p,t,1,a,h,7,0,0),Nt(h))}for(y=0;;){v=0|i[(_=a+(y<<3)|0)>>2],_=0|i[_+4>>2];r:do{if(!(0|v)&!(0|_))h=c,d=A;else{if(f=0|kt(0|v,0|_,0|O,0|F),p=0|w(),!(!(0|(d=0|i[(t=h=r+(f<<3)|0)>>2]))&!(0|(t=0|i[t+4>>2])))){m=0,g=0;do{if((0|m)>(0|F)|(0|m)==(0|F)&g>>>0>O>>>0)break n;if((0|d)==(0|v)&(0|t)==(0|_)){h=c,d=A;break r}f=0|Ft(0|(h=0|Dt(0|f,0|p,1,0)),0|w(),0|O,0|F),p=0|w(),g=0|Dt(0|g,0|m,1,0),m=0|w(),d=0|i[(t=h=r+(f<<3)|0)>>2],t=0|i[t+4>>2]}while(!(!(0|d)&!(0|t)))}!(0|v)&!(0|_)?(h=c,d=A):(Xe(v,_,o),0|ft(e,q,o)&&(g=0|Dt(0|c,0|A,1,0),A=0|w(),i[(m=h)>>2]=v,i[m+4>>2]=_,i[(c=N+(c<<3)|0)>>2]=v,i[c+4>>2]=_,c=g),h=c,d=A)}}while(0);if((y=y+1|0)>>>0>=7)break;c=h,A=d}if(x=0|Dt(0|x,0|b,1,0),b=0|w(),S=0|Dt(0|S,0|T,1,0),T=0|w(),c=0|i[(A=s)>>2],!((0|T)<(0|(A=0|i[A+4>>2]))|(0|T)==(0|A)&S>>>0<c>>>0))break;c=h,A=d}if((0|A)>0|!(0|A)&c>>>0>0){c=0,A=0;do{i[(T=R+(c<<3)|0)>>2]=0,i[T+4>>2]=0,c=0|Dt(0|c,0|A,1,0),A=0|w(),S=0|i[(T=s)+4>>2]}while((0|A)<(0|S)|((0|A)==(0|S)?c>>>0<(0|i[T>>2])>>>0:0))}if(i[(T=s)>>2]=h,i[T+4>>2]=d,!((0|d)>0|!(0|d)&h>>>0>0))break t;y=u,x=C,b=I,S=E,T=N,u=M,C=n,E=P,M=y,n=x,I=L,L=b,P=S,N=R,R=T}Nt(P),Nt(L),Nt(q),n=1;break e}n=h}while(0);Nt(q),Nt(u),Nt(n),n=0}}while(0);return D=l,0|(q=n)},_readInt64AsDoubleFromPointer:function(e){return+(+((0|i[(e|=0)>>2])>>>0)+4294967296*+(0|i[e+4>>2]))},_res0CellCount:function(){return 122},_round:Qt,_sbrk:Yt,_sizeOfCellBoundary:function(){return 168},_sizeOfCoordIJ:function(){return 8},_sizeOfGeoLoop:function(){return 8},_sizeOfGeoPolygon:function(){return 16},_sizeOfH3Index:function(){return 8},_sizeOfLatLng:function(){return 16},_sizeOfLinkedGeoPolygon:function(){return 12},_uncompactCells:function(e,t,n,r,s,a,o){e|=0,r|=0,s|=0,a|=0;var l,u=0,c=0,A=0,h=0,d=0,p=0,f=0,m=0;if(l=D,D=D+16|0,m=l,!((0|(n|=0))>0|!(0|n)&(t|=0)>>>0>0))return D=l,0|(m=0);if((0|(o|=0))>=16)return D=l,0|(m=12);p=0,f=0,d=0,u=0;e:for(;;){if(h=0|Gt(0|(c=0|i[(A=e+(p<<3)|0)>>2]),0|(A=0|i[A+4>>2]),52),w(),(15&h)>(0|o)){u=12,c=11;break}if($e(m,c,A,o),!(0|(A=0|i[(h=m)>>2]))&!(0|(h=0|i[h+4>>2])))c=d;else{c=d;do{if(!((0|u)<(0|a)|(0|u)==(0|a)&c>>>0<s>>>0)){c=10;break e}i[(d=r+(c<<3)|0)>>2]=A,i[d+4>>2]=h,c=0|Dt(0|c,0|u,1,0),u=0|w(),Ke(m),A=0|i[(d=m)>>2],h=0|i[d+4>>2]}while(!(!(0|A)&!(0|h)))}if(p=0|Dt(0|p,0|f,1,0),!((0|(f=0|w()))<(0|n)|(0|f)==(0|n)&p>>>0<t>>>0)){u=0,c=11;break}d=c}return 10==(0|c)?(D=l,0|(m=14)):11==(0|c)?(D=l,0|u):0},_uncompactCellsSize:function(e,t,n,r,s){e|=0,t|=0,n|=0,r|=0,s|=0;var a,o,l=0,u=0,c=0,A=0,h=0,d=0;o=D,D=D+16|0,a=o;e:do{if((0|n)>0|!(0|n)&t>>>0>0){for(h=0,u=0,l=0,d=0;;){if(!(!(0|(c=0|i[(A=e+(h<<3)|0)>>2]))&!(0|(A=0|i[A+4>>2]))||(A=!(0|Be(c,A,r,a)),u=0|Dt(0|i[(c=a)>>2],0|i[c+4>>2],0|u,0|l),l=0|w(),A))){l=12;break}if(h=0|Dt(0|h,0|d,1,0),!((0|(d=0|w()))<(0|n)|(0|d)==(0|n)&h>>>0<t>>>0))break e}return D=o,0|l}u=0,l=0}while(0);return i[s>>2]=u,i[s+4>>2]=l,D=o,0|(s=0)},_vertexToLatLng:function(e,t,n){n|=0;var r,s,a,o,l=0,u=0;return o=D,D=D+192|0,s=o,a=o+168|0,l=0|Gt(0|(e|=0),0|(t|=0),56),w(),l&=7,0|(r=0|We(e,u=-2130706433&t|134217728,a))?(D=o,0|(u=r)):(t=0|Gt(0|e,0|t,52),w(),t&=15,0|Oe(e,u)?Ee(a,t,l,1,s):Pe(a,t,l,1,s),u=s+8|0,i[n>>2]=i[u>>2],i[n+4>>2]=i[u+4>>2],i[n+8>>2]=i[u+8>>2],i[n+12>>2]=i[u+12>>2],D=o,0|(u=0))},establishStackSpace:function(e,t){D=e|=0},stackAlloc:function(e){var t;return t=D,D=(D=D+(e|=0)|0)+15&-16,0|t},stackRestore:function(e){D=e|=0},stackSave:function(){return 0|D}}}({Math:Math,Int8Array:Int8Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Float32Array:Float32Array,Float64Array:Float64Array},{a:ge,b:function(e){g=e},c:function(){return g},d:function(e,t,n,r){ge("Assertion failed: "+N(e)+", at: "+[t?N(t):"unknown filename",n,r?N(r):"unknown function"])},e:function(e){return n.___errno_location&&(M[n.___errno_location()>>2]=e),e},f:J,g:function(e,t,n){T.set(T.subarray(t,t+n),e)},h:function(e){var t=J(),n=16777216,r=2130706432;if(e>r)return!1;for(var i=Math.max(t,16777216);i<e;)i=i<=536870912?P(2*i,n):Math.min(P((3*i+2147483648)/4,n),r);return!!ee(i)},i:function(e){ge("OOM")},j:$,k:K,l:ee,m:Z,n:function(){var e=Z();return n.extraStackTrace&&(e+="\n"+n.extraStackTrace()),K(e)},o:24144,p:24128},b);n.___divdi3=ie.___divdi3,n.___muldi3=ie.___muldi3,n.___remdi3=ie.___remdi3,n.___uremdi3=ie.___uremdi3,n._areNeighborCells=ie._areNeighborCells,n._bitshift64Ashr=ie._bitshift64Ashr,n._bitshift64Lshr=ie._bitshift64Lshr,n._bitshift64Shl=ie._bitshift64Shl,n._calloc=ie._calloc,n._cellAreaKm2=ie._cellAreaKm2,n._cellAreaM2=ie._cellAreaM2,n._cellAreaRads2=ie._cellAreaRads2,n._cellToBoundary=ie._cellToBoundary,n._cellToCenterChild=ie._cellToCenterChild,n._cellToChildPos=ie._cellToChildPos,n._cellToChildren=ie._cellToChildren,n._cellToChildrenSize=ie._cellToChildrenSize,n._cellToLatLng=ie._cellToLatLng,n._cellToLocalIj=ie._cellToLocalIj,n._cellToParent=ie._cellToParent,n._cellToVertex=ie._cellToVertex,n._cellToVertexes=ie._cellToVertexes,n._cellsToDirectedEdge=ie._cellsToDirectedEdge,n._cellsToLinkedMultiPolygon=ie._cellsToLinkedMultiPolygon,n._childPosToCell=ie._childPosToCell,n._compactCells=ie._compactCells,n._destroyLinkedMultiPolygon=ie._destroyLinkedMultiPolygon,n._directedEdgeToBoundary=ie._directedEdgeToBoundary,n._directedEdgeToCells=ie._directedEdgeToCells,n._edgeLengthKm=ie._edgeLengthKm,n._edgeLengthM=ie._edgeLengthM,n._edgeLengthRads=ie._edgeLengthRads;var se=n._emscripten_replace_memory=ie._emscripten_replace_memory;n._free=ie._free,n._getBaseCellNumber=ie._getBaseCellNumber,n._getDirectedEdgeDestination=ie._getDirectedEdgeDestination,n._getDirectedEdgeOrigin=ie._getDirectedEdgeOrigin,n._getHexagonAreaAvgKm2=ie._getHexagonAreaAvgKm2,n._getHexagonAreaAvgM2=ie._getHexagonAreaAvgM2,n._getHexagonEdgeLengthAvgKm=ie._getHexagonEdgeLengthAvgKm,n._getHexagonEdgeLengthAvgM=ie._getHexagonEdgeLengthAvgM,n._getIcosahedronFaces=ie._getIcosahedronFaces,n._getNumCells=ie._getNumCells,n._getPentagons=ie._getPentagons,n._getRes0Cells=ie._getRes0Cells,n._getResolution=ie._getResolution,n._greatCircleDistanceKm=ie._greatCircleDistanceKm,n._greatCircleDistanceM=ie._greatCircleDistanceM,n._greatCircleDistanceRads=ie._greatCircleDistanceRads,n._gridDisk=ie._gridDisk,n._gridDiskDistances=ie._gridDiskDistances,n._gridDistance=ie._gridDistance,n._gridPathCells=ie._gridPathCells,n._gridPathCellsSize=ie._gridPathCellsSize,n._gridRingUnsafe=ie._gridRingUnsafe,n._i64Add=ie._i64Add,n._i64Subtract=ie._i64Subtract,n._isPentagon=ie._isPentagon,n._isResClassIII=ie._isResClassIII,n._isValidCell=ie._isValidCell,n._isValidDirectedEdge=ie._isValidDirectedEdge,n._isValidVertex=ie._isValidVertex,n._latLngToCell=ie._latLngToCell,n._llvm_maxnum_f64=ie._llvm_maxnum_f64,n._llvm_minnum_f64=ie._llvm_minnum_f64,n._llvm_round_f64=ie._llvm_round_f64,n._localIjToCell=ie._localIjToCell,n._malloc=ie._malloc,n._maxFaceCount=ie._maxFaceCount,n._maxGridDiskSize=ie._maxGridDiskSize,n._maxPolygonToCellsSize=ie._maxPolygonToCellsSize,n._memcpy=ie._memcpy,n._memset=ie._memset,n._originToDirectedEdges=ie._originToDirectedEdges,n._pentagonCount=ie._pentagonCount,n._polygonToCells=ie._polygonToCells,n._readInt64AsDoubleFromPointer=ie._readInt64AsDoubleFromPointer,n._res0CellCount=ie._res0CellCount,n._round=ie._round,n._sbrk=ie._sbrk,n._sizeOfCellBoundary=ie._sizeOfCellBoundary,n._sizeOfCoordIJ=ie._sizeOfCoordIJ,n._sizeOfGeoLoop=ie._sizeOfGeoLoop,n._sizeOfGeoPolygon=ie._sizeOfGeoPolygon,n._sizeOfH3Index=ie._sizeOfH3Index,n._sizeOfLatLng=ie._sizeOfLatLng,n._sizeOfLinkedGeoPolygon=ie._sizeOfLinkedGeoPolygon,n._uncompactCells=ie._uncompactCells,n._uncompactCellsSize=ie._uncompactCellsSize,n._vertexToLatLng=ie._vertexToLatLng,n.establishStackSpace=ie.establishStackSpace;var ae,oe,le=n.stackAlloc=ie.stackAlloc,ue=n.stackRestore=ie.stackRestore,ce=n.stackSave=ie.stackSave;if(n.asm=ie,n.cwrap=function(e,t,n,r){var i=(n=n||[]).every((function(e){return"number"===e}));return"string"!==t&&i&&!r?y(e):function(){return x(e,t,n,arguments)}},n.setValue=function(e,t,n,r){switch("*"===(n=n||"i8").charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":S[e|0]=t;break;case"i16":w[e>>1]=t;break;case"i32":M[e>>2]=t;break;case"i64":W=[t>>>0,(j=t,+k(j)>=1?j>0?(0|z(+G(j/4294967296),4294967295))>>>0:~~+q((j-+(~~j>>>0))/4294967296)>>>0:0)],M[e>>2]=W[0],M[e+4>>2]=W[1];break;case"float":E[e>>2]=t;break;case"double":C[e>>3]=t;break;default:ge("invalid type for setValue: "+n)}},n.getValue=function(e,t,n){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return S[e|0];case"i16":return w[e>>1];case"i32":case"i64":return M[e>>2];case"float":return E[e>>2];case"double":return C[e>>3];default:ge("invalid type for getValue: "+t)}return null},X)if(Y(X)||(ae=X,X=n.locateFile?n.locateFile(ae,p):p+ae),a||l){var Ae=A(X);T.set(Ae,8)}else{V++,n.monitorRunDependencies&&n.monitorRunDependencies(V);var he=function(e){e.byteLength&&(e=new Uint8Array(e)),T.set(e,8),n.memoryInitializerRequest&&delete n.memoryInitializerRequest.response,function(){if(V--,n.monitorRunDependencies&&n.monitorRunDependencies(V),0==V&&H){var e=H;H=null,e()}}()},de=function(){c(X,he,(function(){throw"could not load memory initializer "+X}))},pe=re(X);if(pe)he(pe.buffer);else if(n.memoryInitializerRequest){var fe=function(){var e=n.memoryInitializerRequest,t=e.response;if(200!==e.status&&0!==e.status){var r=re(n.memoryInitializerRequestURL);if(!r)return console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+e.status+", retrying "+X),void de();t=r.buffer}he(t)};n.memoryInitializerRequest.response?setTimeout(fe,0):n.memoryInitializerRequest.addEventListener("load",fe)}else de()}function me(e){function t(){oe||(oe=!0,v||(I(B),I(O),n.onRuntimeInitialized&&n.onRuntimeInitialized(),function(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)e=n.postRun.shift(),F.unshift(e);var e;I(F)}()))}V>0||(!function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)e=n.preRun.shift(),U.unshift(e);var e;I(U)}(),V>0||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),t()}),1)):t()))}function ge(e){throw n.onAbort&&n.onAbort(e),f(e+=""),m(e),v=!0,"abort("+e+"). Build with -s ASSERTIONS=1 for more info."}if(H=function e(){oe||me(),oe||(H=e)},n.run=me,n.abort=ge,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return me(),e}("object"==typeof xv?xv:{}),bv="number",Sv={0:"Success",1:"The operation failed but a more specific error is not available",2:"Argument was outside of acceptable range",3:"Latitude or longitude arguments were outside of acceptable range",4:"Resolution argument was outside of acceptable range",5:"Cell argument was not valid",6:"Directed edge argument was not valid",7:"Undirected edge argument was not valid",8:"Vertex argument was not valid",9:"Pentagon distortion was encountered",10:"Duplicate input",11:"Cell arguments were not neighbors",12:"Cell arguments had incompatible resolutions",13:"Memory allocation failed",14:"Bounds of provided memory were insufficient",15:"Mode or flags argument was not valid"},Tv={1e3:"Unknown unit",1001:"Array length out of bounds",1002:"Got unexpected null value for H3 index"};function wv(e,t,n){var r=n&&"value"in n,i=new Error((e[t]||"Unknown error")+" (code: "+t+(r?", value: "+n.value:"")+")");return i.code=t,i}function Mv(e,t){return wv(Sv,e,2===arguments.length?{value:t}:{})}function Ev(e,t){return wv(Tv,e,2===arguments.length?{value:t}:{})}function Cv(e){if(0!==e)throw Mv(e)} 6 6 /* 7 7 * Copyright 2018-2019, 2022 Uber Technologies, Inc. … … 18 18 * See the License for the specific language governing permissions and 19 19 * limitations under the License. 20 */function Ig(t,e,n){var i=n&&"value"in n,r=new Error((t[e]||"Unknown error")+" (code: "+e+(i?", value: "+n.value:"")+")");return r.code=e,r}function Lg(t,e){return Ig(Pg,t,2===arguments.length?{value:e}:{})}function Bg(t,e){return Ig(Dg,t,2===arguments.length?{value:e}:{})}function Ug(t){if(0!==t)throw Lg(t)} 21 /* 22 * Copyright 2018-2019, 2022 Uber Technologies, Inc. 23 * 24 * Licensed under the Apache License, Version 2.0 (the "License"); 25 * you may not use this file except in compliance with the License. 26 * You may obtain a copy of the License at 27 * 28 * http://www.apache.org/licenses/LICENSE-2.0 29 * 30 * Unless required by applicable law or agreed to in writing, software 31 * distributed under the License is distributed on an "AS IS" BASIS, 32 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 33 * See the License for the specific language governing permissions and 34 * limitations under the License. 35 */var Og={};[["sizeOfH3Index",Ng],["sizeOfLatLng",Ng],["sizeOfCellBoundary",Ng],["sizeOfGeoLoop",Ng],["sizeOfGeoPolygon",Ng],["sizeOfLinkedGeoPolygon",Ng],["sizeOfCoordIJ",Ng],["readInt64AsDoubleFromPointer",Ng],["isValidCell",Ng,[Ng,Ng]],["latLngToCell",Ng,[Ng,Ng,Ng,Ng]],["cellToLatLng",Ng,[Ng,Ng,Ng]],["cellToBoundary",Ng,[Ng,Ng,Ng]],["maxGridDiskSize",Ng,[Ng,Ng]],["gridDisk",Ng,[Ng,Ng,Ng,Ng]],["gridDiskDistances",Ng,[Ng,Ng,Ng,Ng,Ng]],["gridRingUnsafe",Ng,[Ng,Ng,Ng,Ng]],["maxPolygonToCellsSize",Ng,[Ng,Ng,Ng,Ng]],["polygonToCells",Ng,[Ng,Ng,Ng,Ng]],["cellsToLinkedMultiPolygon",Ng,[Ng,Ng,Ng]],["destroyLinkedMultiPolygon",null,[Ng]],["compactCells",Ng,[Ng,Ng,Ng,Ng]],["uncompactCells",Ng,[Ng,Ng,Ng,Ng,Ng,Ng]],["uncompactCellsSize",Ng,[Ng,Ng,Ng,Ng,Ng]],["isPentagon",Ng,[Ng,Ng]],["isResClassIII",Ng,[Ng,Ng]],["getBaseCellNumber",Ng,[Ng,Ng]],["getResolution",Ng,[Ng,Ng]],["maxFaceCount",Ng,[Ng,Ng,Ng]],["getIcosahedronFaces",Ng,[Ng,Ng,Ng]],["cellToParent",Ng,[Ng,Ng,Ng,Ng]],["cellToChildren",Ng,[Ng,Ng,Ng,Ng]],["cellToCenterChild",Ng,[Ng,Ng,Ng,Ng]],["cellToChildrenSize",Ng,[Ng,Ng,Ng,Ng]],["cellToChildPos",Ng,[Ng,Ng,Ng,Ng]],["childPosToCell",Ng,[Ng,Ng,Ng,Ng,Ng,Ng]],["areNeighborCells",Ng,[Ng,Ng,Ng,Ng,Ng]],["cellsToDirectedEdge",Ng,[Ng,Ng,Ng,Ng,Ng]],["getDirectedEdgeOrigin",Ng,[Ng,Ng,Ng]],["getDirectedEdgeDestination",Ng,[Ng,Ng,Ng]],["isValidDirectedEdge",Ng,[Ng,Ng]],["directedEdgeToCells",Ng,[Ng,Ng,Ng]],["originToDirectedEdges",Ng,[Ng,Ng,Ng]],["directedEdgeToBoundary",Ng,[Ng,Ng,Ng]],["gridDistance",Ng,[Ng,Ng,Ng,Ng,Ng]],["gridPathCells",Ng,[Ng,Ng,Ng,Ng,Ng]],["gridPathCellsSize",Ng,[Ng,Ng,Ng,Ng,Ng]],["cellToLocalIj",Ng,[Ng,Ng,Ng,Ng,Ng,Ng]],["localIjToCell",Ng,[Ng,Ng,Ng,Ng,Ng]],["getHexagonAreaAvgM2",Ng,[Ng,Ng]],["getHexagonAreaAvgKm2",Ng,[Ng,Ng]],["getHexagonEdgeLengthAvgM",Ng,[Ng,Ng]],["getHexagonEdgeLengthAvgKm",Ng,[Ng,Ng]],["greatCircleDistanceM",Ng,[Ng,Ng]],["greatCircleDistanceKm",Ng,[Ng,Ng]],["greatCircleDistanceRads",Ng,[Ng,Ng]],["cellAreaM2",Ng,[Ng,Ng,Ng]],["cellAreaKm2",Ng,[Ng,Ng,Ng]],["cellAreaRads2",Ng,[Ng,Ng,Ng]],["edgeLengthM",Ng,[Ng,Ng,Ng]],["edgeLengthKm",Ng,[Ng,Ng,Ng]],["edgeLengthRads",Ng,[Ng,Ng,Ng]],["getNumCells",Ng,[Ng,Ng]],["getRes0Cells",Ng,[Ng]],["res0CellCount",Ng],["getPentagons",Ng,[Ng,Ng]],["pentagonCount",Ng],["cellToVertex",Ng,[Ng,Ng,Ng,Ng]],["cellToVertexes",Ng,[Ng,Ng,Ng]],["vertexToLatLng",Ng,[Ng,Ng,Ng]],["isValidVertex",Ng,[Ng,Ng]]].forEach((function(t){Og[t[0]]=Rg.cwrap.apply(Rg,t)}));var Fg=16,kg=Og.sizeOfH3Index(),zg=Og.sizeOfLatLng(),qg=Og.sizeOfCellBoundary(),Gg=Og.sizeOfGeoPolygon(),Vg=Og.sizeOfGeoLoop();Og.sizeOfLinkedGeoPolygon(),Og.sizeOfCoordIJ();var Hg=Math.pow(2,32)-1;var jg,Wg,Xg,Yg,Qg,$g,Zg,Kg,Jg=/[^0-9a-fA-F]/;function ty(t){if(Array.isArray(t)&&2===t.length&&Number.isInteger(t[0])&&Number.isInteger(t[1]))return t;if("string"!=typeof t||Jg.test(t))return[0,0];var e=parseInt(t.substring(0,t.length-8),Fg);return[parseInt(t.substring(t.length-8),Fg),e]}function ey(t){if(t>=0)return t.toString(Fg);var e=ny(8,(t&=2147483647).toString(Fg));return e=(parseInt(e[0],Fg)+8).toString(Fg)+e.substring(1)}function ny(t,e){for(var n=t-e.length,i="",r=0;r<n;r++)i+="0";return i+=e}function iy(t,e,n){for(var i=t.length,r=Rg._calloc(i,zg),s=n?1:0,a=n?0:1,o=0;o<2*i;o+=2)Rg.HEAPF64.set([t[o/2][s],t[o/2][a]].map(cy),r/8+o);return Rg.HEAPU32.set([i,r],e/4),e}function ry(t,e){void 0===e&&(e=0);var n=Rg.getValue(t+kg*e,"i32"),i=Rg.getValue(t+kg*e+4,"i32");return i?function(t,e){return ey(e)+ny(8,ey(t))}(n,i):null}function sy(t){return 180*Rg.getValue(t,"double")/Math.PI}function ay(t){return[sy(t+8),sy(t)]}function oy(t,e,n){var i=Rg._malloc(zg);Rg.HEAPF64.set([t,e].map(cy),i/8);var r=Rg._malloc(kg);try{return Ug(Og.latLngToCell(i,n,r)),function(t){if(!t)throw Bg(1002);return t}(ry(r))}finally{Rg._free(r),Rg._free(i)}}function ly(t){var e,n=Rg._malloc(zg),i=ty(t),r=i[0],s=i[1];try{return Ug(Og.cellToLatLng(r,s,n)),[sy(e=n),sy(e+8)]}finally{Rg._free(n)}}function uy(t,e){var n=Rg._malloc(qg),i=ty(t),r=i[0],s=i[1];try{return Ug(Og.cellToBoundary(r,s,n)),function(t){for(var e=Rg.getValue(t,"i32"),n=t+8,i=[],r=ay,s=0;s<2*e;s+=2)i.push(r(n+8*s));return i.push(i[0]),i}(n)}finally{Rg._free(n)}}function hy(t,e,n){if(function(t){if("number"!=typeof t||t<0||t>15||Math.floor(t)!==t)throw Lg(4,t)}(e),n=Boolean(n),0===t.length||0===t[0].length)return[];var i,r=function(t,e){var n,i=t.length-1,r=Rg._calloc(Gg),s=0+Vg,a=s+4;if(iy(t[0],r+0,e),i>0){n=Rg._calloc(i,Vg);for(var o=0;o<i;o++)iy(t[o+1],n+Vg*o,e)}return Rg.setValue(r+s,i,"i32"),Rg.setValue(r+a,n,"i32"),r}("number"==typeof t[0][0]?[t]:t,n),s=Rg._malloc(8);try{Ug(Og.maxPolygonToCellsSize(r,e,0,s));var a=function(t){if(t>Hg)throw Bg(1001,t);return t}((i=s,Og.readInt64AsDoubleFromPointer(i))),o=Rg._calloc(a,kg);try{return Ug(Og.polygonToCells(r,e,0,o)),function(t,e){for(var n=[],i=0;i<e;i++){var r=ry(t,i);null!==r&&n.push(r)}return n}(o,a)}finally{Rg._free(o)}}finally{Rg._free(s),function(t){var e=0+Vg,n=e+4;Rg._free(Rg.getValue(t+0+4,"i8*"));var i=Rg.getValue(t+e,"i32");if(i>0){for(var r=Rg.getValue(t+n,"i32"),s=0;s<i;s++)Rg._free(Rg.getValue(r+Vg*s+4,"i8*"));Rg._free(r)}Rg._free(t)}(r)}}function cy(t){return t*Math.PI/180}function Ay(){if(Wg)return jg;function t(t,e,n,i){this.x="number"==typeof t?t:0,this.y="number"==typeof e?e:0,this.z="number"==typeof n?n:0,this.half="number"==typeof i?i:0}return Wg=1,jg=t,t.prototype.contains=function(t,e,n){var i=this.half;return this.x-i<=t&&t<this.x+i&&this.y-i<=e&&e<this.y+i&&this.z-i<=n&&n<this.z+i},jg}var dy=function(){if(Kg)return Zg;Kg=1;var t=Ay(),e=function(){if(Yg)return Xg;Yg=1;var t=Ay();function e(t){this.bounds=t,this.q0=null,this.q1=null,this.q2=null,this.q3=null,this.q4=null,this.q5=null,this.q6=null,this.q7=null,this.items=null}return Xg=e,e.prototype.subdivide=function(){var n=this.bounds,i=n.half/2;this.q0=new e(new t(n.x-i,n.y-i,n.z-i,i)),this.q1=new e(new t(n.x+i,n.y-i,n.z-i,i)),this.q2=new e(new t(n.x-i,n.y+i,n.z-i,i)),this.q3=new e(new t(n.x+i,n.y+i,n.z-i,i)),this.q4=new e(new t(n.x-i,n.y-i,n.z+i,i)),this.q5=new e(new t(n.x+i,n.y-i,n.z+i,i)),this.q6=new e(new t(n.x-i,n.y+i,n.z+i,i)),this.q7=new e(new t(n.x+i,n.y+i,n.z+i,i))},e.prototype.insert=function(t,e,n){if(null===this.q0){if(null===this.items?this.items=[t]:this.items.push(t),this.items.length>=4&&n<16){this.subdivide();for(var i=0;i<this.items.length;++i)this.insert(this.items[i],e,n+1);this.items=null}}else{var r=e[t],s=e[t+1],a=e[t+2],o=this.bounds,l=0;r>o.x&&(l+=1),s>o.y&&(l+=2),a>o.z&&(l+=4);var u=function(t,e){return 0===e?t.q0:1===e?t.q1:2===e?t.q2:3===e?t.q3:4===e?t.q4:5===e?t.q5:6===e?t.q6:7===e?t.q7:void 0}(this,l);u.insert(t,e,n+1)}},e.prototype.query=function(t,e,n,i){if(n(this.bounds)){var r=this.items,s="function"==typeof i;if(r)for(var a=0;a<r.length;++a){var o=r[a];s?i(e[o],e[o+1],e[o+2])&&t.push(o):t.push(o)}this.q0&&(this.q0.query(t,e,n,i),this.q1.query(t,e,n,i),this.q2.query(t,e,n,i),this.q3.query(t,e,n,i),this.q4.query(t,e,n,i),this.q5.query(t,e,n,i),this.q6.query(t,e,n,i),this.q7.query(t,e,n,i))}},Xg}(),n=new t,i=($g||($g=1,Qg=function(t,e,n,i){var r=0,s=0,a=(i=i||{}).step||1,o=i.maxTimeMS||8,l=i.probeElements||5e3;setTimeout((function i(){var u=Math.min(t.length,r+l),h=r,c=new Date;for(h=r;h<u;h+=a)e(t[h],h,t);h<t.length?(s+=new Date-c,r=h,l=Math.round(r*o/s),setTimeout(i,0)):n(t)}),0)}),Qg);return Zg=function(r){var s,a,o=[],l={initAsync:function(t,e){h(t);var n=c(t);function r(e,i){n.insert(i,t,0)}function o(){a=t,s=n,"function"==typeof e&&e(l)}i(t,r,o,{step:3})},init:function(t){h(t),a=t,s=c(t);for(var e=0;e<t.length;e+=3)s.insert(e,a,0)},bounds:function(){return s?s.bounds:n},intersectRay:function(t,e,n,i){if(!s)return o;void 0===n&&(n=0);void 0===i&&(i=Number.POSITIVE_INFINITY);n*=n,i*=i;var r=[];return s.query(r,a,l,u),r.sort(h);function l(n){var r,s=n.half,a=(n.x-s-t.x)/e.x,o=(n.x+s-t.x)/e.x,l=(n.y+s-t.y)/e.y,u=(n.y-s-t.y)/e.y,h=(n.z-s-t.z)/e.z,c=(n.z+s-t.z)/e.z,A=Math.min(Math.min(Math.max(a,o),Math.max(l,u)),Math.max(h,c));return!(A<0)&&((r=Math.max(Math.max(Math.min(a,o),Math.min(l,u)),Math.min(h,c)))<=A&&r<=i)}function u(e,r,s){var a=(e-t.x)*(e-t.x)+(r-t.y)*(r-t.y)+(s-t.z)*(s-t.z);return n<=a&&a<=i}function h(e,n){var i=t[e],r=t[e+1],s=t[e+2],a=(i-t.x)*(i-t.x)+(r-t.y)*(r-t.y)+(s-t.z)*(s-t.z),o=t[n],l=t[n+1],u=t[n+2];return a-((o-t.x)*(o-t.x)+(l-t.y)*(l-t.y)+(u-t.z)*(u-t.z))}},intersectSphere:function(t,e,n,i){if(!s)return o;var r=[],l=i*i;return s.query(r,a,h,c),r;function h(i){var r=l,s=i.half;return t<i.x-s?r-=u(t-(i.x-s)):t>i.x+s&&(r-=u(t-(i.x+s))),e<i.y-s?r-=u(e-(i.y-s)):e>i.y+s&&(r-=u(e-(i.y+s))),n<i.z-s?r-=u(n-(i.z-s)):n>i.z+s&&(r-=u(n-(i.z+s))),r>0}function c(i,r,s){return u(i-t)+u(r-e)+u(s-n)<l}},getRoot:function(){return s}};return l;function u(t){return t*t}function h(t){if(!t)throw new Error("Points array is required for quadtree to work");if("number"!=typeof t.length)throw new Error("Points should be array-like object");if(t.length%3!=0)throw new Error("Points array should consist of series of x,y,z coordinates and be multiple of 3")}function c(n){if(0===n.length){var i=new t;return new e(i)}for(var r=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY,h=0;h<n.length;h+=3){var c=n[h],A=n[h+1],d=n[h+2];c<r&&(r=c),c>o&&(o=c),A<s&&(s=A),A>l&&(l=A),d<a&&(a=d),d>u&&(u=d)}var p=Math.max(Math.max(o-r,l-s),u-a),f=(p+=2)/2,m=new t((r-=1)+f,(s-=1)+f,(a-=1)+f,f);return new e(m)}},Zg}(),py=Tf(dy);const fy=new sn,my=new en;class gy extends Xl{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new Li([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new Li([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(t){const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==e&&(e.applyMatrix4(t),n.applyMatrix4(t),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}setPositions(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));const n=new $l(e,6,1);return this.setAttribute("instanceStart",new go(n,3,0)),this.setAttribute("instanceEnd",new go(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));const n=new $l(e,6,1);return this.setAttribute("instanceColorStart",new go(n,3,0)),this.setAttribute("instanceColorEnd",new go(n,3,3)),this}fromWireframeGeometry(t){return this.setPositions(t.attributes.position.array),this}fromEdgesGeometry(t){return this.setPositions(t.attributes.position.array),this}fromMesh(t){return this.fromWireframeGeometry(new Dl(t.geometry)),this}fromLineSegments(t){const e=t.geometry;return this.setPositions(e.attributes.position.array),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new sn);const t=this.attributes.instanceStart,e=this.attributes.instanceEnd;void 0!==t&&void 0!==e&&(this.boundingBox.setFromBufferAttribute(t),fy.setFromBufferAttribute(e),this.boundingBox.union(fy))}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Sn),null===this.boundingBox&&this.computeBoundingBox();const t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==t&&void 0!==e){const n=this.boundingSphere.center;this.boundingBox.getCenter(n);let i=0;for(let r=0,s=t.count;r<s;r++)my.fromBufferAttribute(t,r),i=Math.max(i,n.distanceToSquared(my)),my.fromBufferAttribute(e,r),i=Math.max(i,n.distanceToSquared(my));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(t){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(t)}}Cr.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Ee(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}},Rr.line={uniforms:ar.merge([Cr.common,Cr.fog,Cr.line]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\t#ifdef WORLD_UNITS\n\n\t\t\tvarying vec4 worldPos;\n\t\t\tvarying vec3 worldStart;\n\t\t\tvarying vec3 worldEnd;\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t#endif\n\n\t\t#else\n\n\t\t\tvarying vec2 vUv;\n\n\t\t#endif\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\t\t\t\tvUv = uv;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\tworldStart = start.xyz;\n\t\t\t\tworldEnd = end.xyz;\n\n\t\t\t#else\n\n\t\t\t\tvUv = uv;\n\n\t\t\t#endif\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec3 ndcStart = clipStart.xyz / clipStart.w;\n\t\t\tvec3 ndcEnd = clipEnd.xyz / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd.xy - ndcStart.xy;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\tvec3 worldDir = normalize( end.xyz - start.xyz );\n\t\t\t\tvec3 tmpFwd = normalize( mix( start.xyz, end.xyz, 0.5 ) );\n\t\t\t\tvec3 worldUp = normalize( cross( worldDir, tmpFwd ) );\n\t\t\t\tvec3 worldFwd = cross( worldDir, worldUp );\n\t\t\t\tworldPos = position.y < 0.5 ? start: end;\n\n\t\t\t\t// height offset\n\t\t\t\tfloat hw = linewidth * 0.5;\n\t\t\t\tworldPos.xyz += position.x < 0.0 ? hw * worldUp : - hw * worldUp;\n\n\t\t\t\t// don't extend the line if we're rendering dashes because we\n\t\t\t\t// won't be rendering the endcaps\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t// cap extension\n\t\t\t\t\tworldPos.xyz += position.y < 0.5 ? - hw * worldDir : hw * worldDir;\n\n\t\t\t\t\t// add width to the box\n\t\t\t\t\tworldPos.xyz += worldFwd * hw;\n\n\t\t\t\t\t// endcaps\n\t\t\t\t\tif ( position.y > 1.0 || position.y < 0.0 ) {\n\n\t\t\t\t\t\tworldPos.xyz -= worldFwd * 2.0 * hw;\n\n\t\t\t\t\t}\n\n\t\t\t\t#endif\n\n\t\t\t\t// project the worldpos\n\t\t\t\tvec4 clip = projectionMatrix * worldPos;\n\n\t\t\t\t// shift the depth of the projected points so the line\n\t\t\t\t// segments overlap neatly\n\t\t\t\tvec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;\n\t\t\t\tclip.z = clipPose.z * clip.w;\n\n\t\t\t#else\n\n\t\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\t\t\t\t// undo aspect ratio adjustment\n\t\t\t\tdir.x /= aspect;\n\t\t\t\toffset.x /= aspect;\n\n\t\t\t\t// sign flip\n\t\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t\t// endcaps\n\t\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\t\toffset += - dir;\n\n\t\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\t\toffset += dir;\n\n\t\t\t\t}\n\n\t\t\t\t// adjust for linewidth\n\t\t\t\toffset *= linewidth;\n\n\t\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\t\toffset /= resolution.y;\n\n\t\t\t\t// select end\n\t\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t\t// back to clip space\n\t\t\t\toffset *= clip.w;\n\n\t\t\t\tclip.xy += offset;\n\n\t\t\t#endif\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\t\tuniform float linewidth;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashOffset;\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#ifdef WORLD_UNITS\n\n\t\t\tvarying vec4 worldPos;\n\t\t\tvarying vec3 worldStart;\n\t\t\tvarying vec3 worldEnd;\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t#endif\n\n\t\t#else\n\n\t\t\tvarying vec2 vUv;\n\n\t\t#endif\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {\n\n\t\t\tfloat mua;\n\t\t\tfloat mub;\n\n\t\t\tvec3 p13 = p1 - p3;\n\t\t\tvec3 p43 = p4 - p3;\n\n\t\t\tvec3 p21 = p2 - p1;\n\n\t\t\tfloat d1343 = dot( p13, p43 );\n\t\t\tfloat d4321 = dot( p43, p21 );\n\t\t\tfloat d1321 = dot( p13, p21 );\n\t\t\tfloat d4343 = dot( p43, p43 );\n\t\t\tfloat d2121 = dot( p21, p21 );\n\n\t\t\tfloat denom = d2121 * d4343 - d4321 * d4321;\n\n\t\t\tfloat numer = d1343 * d4321 - d1321 * d4343;\n\n\t\t\tmua = numer / denom;\n\t\t\tmua = clamp( mua, 0.0, 1.0 );\n\t\t\tmub = ( d1343 + d4321 * ( mua ) ) / d4343;\n\t\t\tmub = clamp( mub, 0.0, 1.0 );\n\n\t\t\treturn vec2( mua, mub );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tfloat alpha = opacity;\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t// Find the closest points on the view ray and the line segment\n\t\t\t\tvec3 rayEnd = normalize( worldPos.xyz ) * 1e5;\n\t\t\t\tvec3 lineDir = worldEnd - worldStart;\n\t\t\t\tvec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );\n\n\t\t\t\tvec3 p1 = worldStart + lineDir * params.x;\n\t\t\t\tvec3 p2 = rayEnd * params.y;\n\t\t\t\tvec3 delta = p1 - p2;\n\t\t\t\tfloat len = length( delta );\n\t\t\t\tfloat norm = len / linewidth;\n\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t#ifdef USE_ALPHA_TO_COVERAGE\n\n\t\t\t\t\t\tfloat dnorm = fwidth( norm );\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tif ( norm > 0.5 ) {\n\n\t\t\t\t\t\t\tdiscard;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t#endif\n\n\t\t\t\t#endif\n\n\t\t\t#else\n\n\t\t\t\t#ifdef USE_ALPHA_TO_COVERAGE\n\n\t\t\t\t\t// artifacts appear on some hardware if a derivative is taken within a conditional\n\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\tfloat len2 = a * a + b * b;\n\t\t\t\t\tfloat dlen = fwidth( len2 );\n\n\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t#else\n\n\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t\t\t}\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, alpha );\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, alpha );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <colorspace_fragment>\n\t\t\t#include <fog_fragment>\n\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t}\n\t\t"};class yy extends or{constructor(t){super({type:"LineMaterial",uniforms:ar.clone(Rr.line.uniforms),vertexShader:Rr.line.vertexShader,fragmentShader:Rr.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(t)}get color(){return this.uniforms.diffuse.value}set color(t){this.uniforms.diffuse.value=t}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(t){!0===t?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(t){this.uniforms.linewidth&&(this.uniforms.linewidth.value=t)}get dashed(){return"USE_DASH"in this.defines}set dashed(t){!0===t!==this.dashed&&(this.needsUpdate=!0),!0===t?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(t){this.uniforms.dashScale.value=t}get dashSize(){return this.uniforms.dashSize.value}set dashSize(t){this.uniforms.dashSize.value=t}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(t){this.uniforms.dashOffset.value=t}get gapSize(){return this.uniforms.gapSize.value}set gapSize(t){this.uniforms.gapSize.value=t}get opacity(){return this.uniforms.opacity.value}set opacity(t){this.uniforms&&(this.uniforms.opacity.value=t)}get resolution(){return this.uniforms.resolution.value}set resolution(t){this.uniforms.resolution.value.copy(t)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(t){this.defines&&(!0===t!==this.alphaToCoverage&&(this.needsUpdate=!0),!0===t?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const vy=new Qe,_y=new en,xy=new en,by=new Qe,Sy=new Qe,My=new Qe,wy=new en,Ty=new Dn,Ey=new class{constructor(t=new en,e=new en){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){eu.subVectors(t,this.start),nu.subVectors(this.end,this.start);const n=nu.dot(nu);let i=nu.dot(eu)/n;return e&&(i=xe(i,0,1)),i}closestPointToPoint(t,e,n){const i=this.closestPointToPointParameter(t,e);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}},Cy=new en,Ry=new sn,Ny=new Sn,Py=new Qe;let Dy,Iy;function Ly(t,e,n){return Py.set(0,0,-e,1).applyMatrix4(t.projectionMatrix),Py.multiplyScalar(1/Py.w),Py.x=Iy/n.width,Py.y=Iy/n.height,Py.applyMatrix4(t.projectionMatrixInverse),Py.multiplyScalar(1/Py.w),Math.abs(Math.max(Py.x,Py.y))}class By extends tr{constructor(t=new gy,e=new yy({color:16777215*Math.random()})){super(t,e),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const t=this.geometry,e=t.attributes.instanceStart,n=t.attributes.instanceEnd,i=new Float32Array(2*e.count);for(let t=0,r=0,s=e.count;t<s;t++,r+=2)_y.fromBufferAttribute(e,t),xy.fromBufferAttribute(n,t),i[r]=0===r?0:i[r-1],i[r+1]=i[r]+_y.distanceTo(xy);const r=new $l(i,2,1);return t.setAttribute("instanceDistanceStart",new go(r,1,0)),t.setAttribute("instanceDistanceEnd",new go(r,1,1)),this}raycast(t,e){const n=this.material.worldUnits,i=t.camera;null!==i||n||console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const r=void 0!==t.params.Line2&&t.params.Line2.threshold||0;Dy=t.ray;const s=this.matrixWorld,a=this.geometry,o=this.material;let l,u;if(Iy=o.linewidth+r,null===a.boundingSphere&&a.computeBoundingSphere(),Ny.copy(a.boundingSphere).applyMatrix4(s),n)l=.5*Iy;else{l=Ly(i,Math.max(i.near,Ny.distanceToPoint(Dy.origin)),o.resolution)}if(Ny.radius+=l,!1!==Dy.intersectsSphere(Ny)){if(null===a.boundingBox&&a.computeBoundingBox(),Ry.copy(a.boundingBox).applyMatrix4(s),n)u=.5*Iy;else{u=Ly(i,Math.max(i.near,Ry.distanceToPoint(Dy.origin)),o.resolution)}Ry.expandByScalar(u),!1!==Dy.intersectsBox(Ry)&&(n?function(t,e){const n=t.matrixWorld,i=t.geometry,r=i.attributes.instanceStart,s=i.attributes.instanceEnd;for(let a=0,o=Math.min(i.instanceCount,r.count);a<o;a++){Ey.start.fromBufferAttribute(r,a),Ey.end.fromBufferAttribute(s,a),Ey.applyMatrix4(n);const i=new en,o=new en;Dy.distanceSqToSegment(Ey.start,Ey.end,o,i),o.distanceTo(i)<.5*Iy&&e.push({point:o,pointOnLine:i,distance:Dy.origin.distanceTo(o),object:t,face:null,faceIndex:a,uv:null,uv1:null})}}(this,e):function(t,e,n){const i=e.projectionMatrix,r=t.material.resolution,s=t.matrixWorld,a=t.geometry,o=a.attributes.instanceStart,l=a.attributes.instanceEnd,u=Math.min(a.instanceCount,o.count),h=-e.near;Dy.at(1,My),My.w=1,My.applyMatrix4(e.matrixWorldInverse),My.applyMatrix4(i),My.multiplyScalar(1/My.w),My.x*=r.x/2,My.y*=r.y/2,My.z=0,wy.copy(My),Ty.multiplyMatrices(e.matrixWorldInverse,s);for(let e=0,a=u;e<a;e++){if(by.fromBufferAttribute(o,e),Sy.fromBufferAttribute(l,e),by.w=1,Sy.w=1,by.applyMatrix4(Ty),Sy.applyMatrix4(Ty),by.z>h&&Sy.z>h)continue;if(by.z>h){const t=by.z-Sy.z,e=(by.z-h)/t;by.lerp(Sy,e)}else if(Sy.z>h){const t=Sy.z-by.z,e=(Sy.z-h)/t;Sy.lerp(by,e)}by.applyMatrix4(i),Sy.applyMatrix4(i),by.multiplyScalar(1/by.w),Sy.multiplyScalar(1/Sy.w),by.x*=r.x/2,by.y*=r.y/2,Sy.x*=r.x/2,Sy.y*=r.y/2,Ey.start.copy(by),Ey.start.z=0,Ey.end.copy(Sy),Ey.end.z=0;const a=Ey.closestPointToPointParameter(wy,!0);Ey.at(a,Cy);const u=Te.lerp(by.z,Sy.z,a),c=u>=-1&&u<=1,A=wy.distanceTo(Cy)<.5*Iy;if(c&&A){Ey.start.fromBufferAttribute(o,e),Ey.end.fromBufferAttribute(l,e),Ey.start.applyMatrix4(s),Ey.end.applyMatrix4(s);const i=new en,r=new en;Dy.distanceSqToSegment(Ey.start,Ey.end,r,i),n.push({point:r,pointOnLine:i,distance:Dy.origin.distanceTo(r),object:t,face:null,faceIndex:e,uv:null,uv1:null})}}}(this,i,e))}}onBeforeRender(t){const e=this.material.uniforms;e&&e.resolution&&(t.getViewport(vy),this.material.uniforms.resolution.value.set(vy.z,vy.w))}}class Uy extends gy{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(t){const e=t.length-3,n=new Float32Array(2*e);for(let i=0;i<e;i+=3)n[2*i]=t[i],n[2*i+1]=t[i+1],n[2*i+2]=t[i+2],n[2*i+3]=t[i+3],n[2*i+4]=t[i+4],n[2*i+5]=t[i+5];return super.setPositions(n),this}setColors(t){const e=t.length-3,n=new Float32Array(2*e);for(let i=0;i<e;i+=3)n[2*i]=t[i],n[2*i+1]=t[i+1],n[2*i+2]=t[i+2],n[2*i+3]=t[i+3],n[2*i+4]=t[i+4],n[2*i+5]=t[i+5];return super.setColors(n),this}fromLine(t){const e=t.geometry;return this.setPositions(e.attributes.position.array),this}}class Oy extends By{constructor(t=new Uy,e=new yy({color:16777215*Math.random()})){super(t,e),this.isLine2=!0,this.type="Line2"}}class Fy extends Cl{constructor(t,e={}){const n=e.font;if(void 0===n)super();else{const i=n.generateShapes(t,e.size);void 0===e.depth&&void 0!==e.height&&console.warn("THREE.TextGeometry: .height is now depreciated. Please use .depth instead"),e.depth=void 0!==e.depth?e.depth:void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),super(i,e)}this.type="TextGeometry"}}function ky(t,e,n,i,r){const s=r.glyphs[t]||r.glyphs["?"];if(!s)return void console.error('THREE.Font: character "'+t+'" does not exists in font family '+r.familyName+".");const a=new iu;let o,l,u,h,c,A,d,p;if(s.o){const t=s._cachedOutline||(s._cachedOutline=s.o.split(" "));for(let r=0,s=t.length;r<s;){switch(t[r++]){case"m":o=t[r++]*e+n,l=t[r++]*e+i,a.moveTo(o,l);break;case"l":o=t[r++]*e+n,l=t[r++]*e+i,a.lineTo(o,l);break;case"q":u=t[r++]*e+n,h=t[r++]*e+i,c=t[r++]*e+n,A=t[r++]*e+i,a.quadraticCurveTo(c,A,u,h);break;case"b":u=t[r++]*e+n,h=t[r++]*e+i,c=t[r++]*e+n,A=t[r++]*e+i,d=t[r++]*e+n,p=t[r++]*e+i,a.bezierCurveTo(c,A,d,p,u,h)}}}return{offsetX:s.ha*e,path:a}}function zy(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function qy(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}function Gy(t,e,n){return e=Zy(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Jy()?Reflect.construct(e,n||[],Zy(t).constructor):e.apply(t,n))}function Vy(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Hy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function jy(t,e){return t.get(qy(t,e))}function Wy(t,e,n){Vy(t,e),e.set(t,n)}function Xy(t,e,n){return t.set(qy(t,e),n),n}function Yy(t,e,n){if(Jy())return Reflect.construct.apply(null,arguments);var i=[null];return i.push.apply(i,e),new(t.bind.apply(t,i))}function Qy(t,e,n){return e&&function(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,sv(i.key),i)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function $y(t,e,n){return(e=sv(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zy(t){return Zy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Zy(t)}function Ky(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&nv(t,e)}function Jy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Jy=function(){return!!t})()}function tv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function ev(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?tv(Object(n),!0).forEach((function(e){$y(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tv(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function nv(t,e){return nv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},nv(t,e)}function iv(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=s.call(n)).done)&&(o.push(i.value),o.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return o}}(t,e)||av(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rv(t){return function(t){if(Array.isArray(t))return zy(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||av(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sv(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function av(t,e){if(t){if("string"==typeof t)return zy(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zy(t,e):void 0}}var ov=function(t){t instanceof Array?t.forEach(ov):(t.map&&t.map.dispose(),t.dispose())},lv=function(t){t.geometry&&t.geometry.dispose(),t.material&&ov(t.material),t.texture&&t.texture.dispose(),t.children&&t.children.forEach(lv)},uv=function(t){if(t&&t.children)for(;t.children.length;){var e=t.children[0];t.remove(e),lv(e)}};function hv(t,e){var n=new e;return{linkProp:function(e){return{default:n[e](),onChange:function(n,i){i[t][e](n)},triggerUpdate:!1}},linkMethod:function(e){return function(n){for(var i=n[t],r=arguments.length,s=new Array(r>1?r-1:0),a=1;a<r;a++)s[a-1]=arguments[a];var o=i[e].apply(i,s);return o===i?this:o}}}}var cv=100;function Av(){return cv}function dv(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=(90-t)*Math.PI/180,r=(90-e)*Math.PI/180,s=cv*(1+n);return{x:s*Math.sin(i)*Math.cos(r),y:s*Math.cos(i),z:s*Math.sin(i)*Math.sin(r)}}function pv(t){var e=t.x,n=t.y,i=t.z,r=Math.sqrt(e*e+n*n+i*i),s=Math.acos(n/r),a=Math.atan2(i,e);return{lat:90-180*s/Math.PI,lng:90-180*a/Math.PI-(a<-Math.PI/2?360:0),altitude:r/cv-1}}function fv(t){return t*Math.PI/180}var mv=window.THREE?window.THREE:{BackSide:1,BufferAttribute:Pi,Color:Mi,Mesh:tr,ShaderMaterial:or},gv={backside:!0,coefficient:.5,color:"gold",size:2,power:1};function yv(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:gv,n=e.backside,i=e.coefficient,r=e.color,s=e.size,a=e.power,o=function(t,e){for(var n=t.clone(),i=new Float32Array(3*t.attributes.position.count),r=0,s=i.length;r<s;r++){var a=t.attributes.normal.array[r],o=t.attributes.position.array[r];i[r]=o+a*e}return n.setAttribute("position",new mv.BufferAttribute(i,3)),n}(t,s),l=function(t,e,n){return new mv.ShaderMaterial({depthWrite:!1,fragmentShader:"\nuniform vec3 color;\nuniform float coefficient;\nuniform float power;\nvarying vec3 vVertexNormal;\nvarying vec3 vVertexWorldPosition;\nvoid main() {\n vec3 worldCameraToVertex = vVertexWorldPosition - cameraPosition;\n vec3 viewCameraToVertex\t= (viewMatrix * vec4(worldCameraToVertex, 0.0)).xyz;\n viewCameraToVertex = normalize(viewCameraToVertex);\n float intensity\t= pow(\n coefficient + dot(vVertexNormal, viewCameraToVertex),\n power\n );\n gl_FragColor = vec4(color, intensity);\n}",transparent:!0,uniforms:{coefficient:{value:t},color:{value:new mv.Color(e)},power:{value:n}},vertexShader:"\nvarying vec3 vVertexWorldPosition;\nvarying vec3 vVertexNormal;\nvoid main() {\n vVertexNormal\t= normalize(normalMatrix * normal);\n vVertexWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n gl_Position\t= projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"})}(i,r,a);return n&&(l.side=mv.BackSide),new mv.Mesh(o,l)}var vv=window.THREE?window.THREE:{Color:Mi,LineBasicMaterial:vo,LineSegments:Po,Mesh:tr,MeshPhongMaterial:class extends Ei{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Mi(16777215),this.specular=new Mi(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Mi(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Ee(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Gn,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}},SphereGeometry:Nl,SRGBColorSpace:Yt,TextureLoader:zl},_v=Fu({props:{globeImageUrl:{},bumpImageUrl:{},showGlobe:{default:!0,onChange:function(t,e){e.globeObj.visible=!!t},triggerUpdate:!1},showGraticules:{default:!1,onChange:function(t,e){e.graticulesObj.visible=!!t},triggerUpdate:!1},showAtmosphere:{default:!0,onChange:function(t,e){e.atmosphereObj&&(e.atmosphereObj.visible=!!t)},triggerUpdate:!1},atmosphereColor:{default:"lightskyblue"},atmosphereAltitude:{default:.15},onReady:{default:function(){},triggerUpdate:!1}},methods:{globeMaterial:function(t,e){return void 0!==e?(t.globeObj.material=e||t.defaultGlobeMaterial,this):t.globeObj.material},_destructor:function(t){uv(t.globeObj),uv(t.graticulesObj)}},stateInit:function(){var t=new vv.SphereGeometry(cv,75,75),e=new vv.MeshPhongMaterial({color:0}),n=new vv.Mesh(t,e);return n.rotation.y=-Math.PI/2,n.__globeObjType="globe",{globeObj:n,graticulesObj:new vv.LineSegments(new zd(cd(),cv,2),new vv.LineBasicMaterial({color:"lightgrey",transparent:!0,opacity:.1})),defaultGlobeMaterial:e}},init:function(t,e){uv(t),e.scene=t,e.scene.add(e.globeObj),e.scene.add(e.graticulesObj),e.ready=!1},update:function(t,e){var n=t.globeObj.material;if(e.hasOwnProperty("globeImageUrl")&&(t.globeImageUrl?(new vv.TextureLoader).load(t.globeImageUrl,(function(e){e.colorSpace=vv.SRGBColorSpace,n.map=e,n.color=null,n.needsUpdate=!0,!t.ready&&(t.ready=!0)&&setTimeout(t.onReady)})):!n.color&&(n.color=new vv.Color(0))),e.hasOwnProperty("bumpImageUrl")&&(t.bumpImageUrl?t.bumpImageUrl&&(new vv.TextureLoader).load(t.bumpImageUrl,(function(t){n.bumpMap=t,n.needsUpdate=!0})):(n.bumpMap=null,n.needsUpdate=!0)),(e.hasOwnProperty("atmosphereColor")||e.hasOwnProperty("atmosphereAltitude"))&&(t.atmosphereObj&&(t.scene.remove(t.atmosphereObj),uv(t.atmosphereObj)),t.atmosphereColor&&t.atmosphereAltitude)){var i=t.atmosphereObj=yv(t.globeObj.geometry,{backside:!0,color:t.atmosphereColor,size:cv*t.atmosphereAltitude,power:3.5,coefficient:.1});i.visible=!!t.showAtmosphere,i.__globeObjType="atmosphere",t.scene.add(i)}t.ready||t.globeImageUrl||(t.ready=!0,t.onReady())}}),xv=function(t){return isNaN(t)?parseInt(Pp(t).toHex(),16):t},bv=function(t){return t&&isNaN(t)?Ap(t).opacity:1},Sv=function(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=1,s=/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.eE+-]+)\s*\)$/.exec(t.trim().toLowerCase());if(s){var a=iv(s.slice(1),4),o=a[0],l=a[1],u=a[2],h=a[3];e=new Mi("rgb(".concat(+o,",").concat(+l,",").concat(+u,")")),r=Math.min(+h,1)}else e=new Mi(t);i&&e.convertLinearToSRGB();var c=e.toArray();return n?[].concat(rv(c),[r]):c};var Mv=window.THREE?window.THREE:{Float32BufferAttribute:Li};function wv(t,e){var n=new(arguments.length>2&&void 0!==arguments[2]?arguments[2]:Mv.Float32BufferAttribute)(t.length*e,e);return 1===e?t.forEach((function(t,e){return n.setX(e,t)})):t.forEach((function(t,i){return n.set(t,i*e)})),n}function Tv(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).removeDelay,r=void 0===i?0:i;return wf(t,e.children,(function(t){return e.add(t)}),(function(t){var n=function(){e.remove(t),uv(t),t&&t.hasOwnProperty("__data")&&delete t.__data.__currentTargetD};r?setTimeout(n,r):n()}),ev({objBindAttr:"__threeObj"},n))}var Ev=window.THREE?window.THREE:{BufferGeometry:Gi,Color:Mi,CylinderGeometry:Ko,Matrix4:Dn,Mesh:tr,MeshLambertMaterial:Ll,Object3D:si,Vector3:en},Cv=Object.assign({},Wd),Rv=Cv.BufferGeometryUtils||Cv,Nv=Fu({props:{pointsData:{default:[]},pointLat:{default:"lat"},pointLng:{default:"lng"},pointColor:{default:function(){return"#ffffaa"}},pointAltitude:{default:.1},pointRadius:{default:.25},pointResolution:{default:12,triggerUpdate:!1},pointsMerge:{default:!1},pointsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e,n){var i=n.tweenGroup;uv(t),e.scene=t,e.tweenGroup=i},update:function(t){var e=Xd(t.pointLat),n=Xd(t.pointLng),i=Xd(t.pointAltitude),r=Xd(t.pointRadius),s=Xd(t.pointColor),a=new Ev.CylinderGeometry(1,1,1,t.pointResolution);a.applyMatrix4((new Ev.Matrix4).makeRotationX(Math.PI/2)),a.applyMatrix4((new Ev.Matrix4).makeTranslation(0,0,-.5));var o=2*Math.PI*cv/360,l={},u=t.pointsMerge?new Ev.Object3D:t.scene;if(Tv(t.pointsData,u,{createObj:function(){var t=new Ev.Mesh(a);return t.__globeObjType="point",t},updateObj:function(a,u){var h=function(e){var n=a.__currentTargetD=e,i=n.r,r=n.alt,s=n.lat,l=n.lng;Object.assign(a.position,dv(s,l));var u=t.pointsMerge?new Ev.Vector3(0,0,0):t.scene.localToWorld(new Ev.Vector3(0,0,0));a.lookAt(u),a.scale.x=a.scale.y=Math.min(30,i)*o,a.scale.z=Math.max(r*cv,.1)},c={alt:+i(u),r:+r(u),lat:+e(u),lng:+n(u)},A=a.__currentTargetD||Object.assign({},c,{alt:-.001});Object.keys(c).some((function(t){return A[t]!==c[t]}))&&(t.pointsMerge||!t.pointsTransitionDuration||t.pointsTransitionDuration<0?h(c):t.tweenGroup.add(new Wu(A).to(c,t.pointsTransitionDuration).easing(zu.Quadratic.InOut).onUpdate(h).start()));if(!t.pointsMerge){var d=s(u),p=d?bv(d):0,f=!!p;a.visible=f,f&&(l.hasOwnProperty(d)||(l[d]=new Ev.MeshLambertMaterial({color:xv(d),transparent:p<1,opacity:p})),a.material=l[d])}}}),t.pointsMerge){var h=t.pointsData.length?(Rv.mergeGeometries||Rv.mergeBufferGeometries)(t.pointsData.map((function(t){var e=t.__threeObj;t.__threeObj=void 0;var n=e.geometry.clone();e.updateMatrix(),n.applyMatrix4(e.matrix);var i=Sv(s(t));return n.setAttribute("color",wv(rv(new Array(n.getAttribute("position").count)).map((function(){return i})),4)),n}))):new Ev.BufferGeometry,c=new Ev.Mesh(h,new Ev.MeshLambertMaterial({color:16777215,transparent:!0,vertexColors:!0}));c.__globeObjType="points",c.__data=t.pointsData,uv(t.scene),t.scene.add(c)}}}),Pv=["stroke"],Dv=window.THREE?window.THREE:{BufferGeometry:Gi,CubicBezierCurve3:Vo,Curve:Do,Group:so,Line:Eo,Mesh:tr,NormalBlending:1,QuadraticBezierCurve3:Wo,ShaderMaterial:or,TubeGeometry:Pl,Vector3:en},Iv=Nf.default||Nf,Lv={uniforms:{dashOffset:{value:0},dashSize:{value:1},gapSize:{value:0},dashTranslate:{value:0}},vertexShader:"\n uniform float dashTranslate; \n\n attribute vec4 vertexColor;\n varying vec4 vColor;\n \n attribute float vertexRelDistance;\n varying float vRelDistance;\n\n void main() {\n // pass through colors and distances\n vColor = vertexColor;\n vRelDistance = vertexRelDistance + dashTranslate;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",fragmentShader:"\n uniform float dashOffset; \n uniform float dashSize;\n uniform float gapSize; \n \n varying vec4 vColor;\n varying float vRelDistance;\n \n void main() {\n // ignore pixels in the gap\n if (vRelDistance < dashOffset) discard;\n if (mod(vRelDistance - dashOffset, dashSize + gapSize) > dashSize) discard;\n \n // set px color: [r, g, b, a], interpolated between vertices \n gl_FragColor = vColor; \n }\n "},Bv=Fu({props:{arcsData:{default:[]},arcStartLat:{default:"startLat"},arcStartLng:{default:"startLng"},arcEndLat:{default:"endLat"},arcEndLng:{default:"endLng"},arcColor:{default:function(){return"#ffffaa"}},arcAltitude:{},arcAltitudeAutoScale:{default:.5},arcStroke:{},arcCurveResolution:{default:64,triggerUpdate:!1},arcCircularResolution:{default:6,triggerUpdate:!1},arcDashLength:{default:1},arcDashGap:{default:0},arcDashInitialGap:{default:0},arcDashAnimateTime:{default:0},arcsTransitionDuration:{default:1e3,triggerUpdate:!1}},methods:{pauseAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.pause()},resumeAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.resume()},_destructor:function(t){var e;null===(e=t.ticker)||void 0===e||e.dispose()}},init:function(t,e,n){var i=n.tweenGroup;uv(t),e.scene=t,e.tweenGroup=i,e.ticker=new Iv,e.ticker.onTick.add((function(t,n){e.arcsData.filter((function(t){return t.__threeObj&&t.__threeObj.children.length&&t.__threeObj.children[0].material&&t.__threeObj.children[0].__dashAnimateStep})).forEach((function(t){var e=t.__threeObj.children[0],i=e.__dashAnimateStep*n,r=e.material.uniforms.dashTranslate.value%1e9;e.material.uniforms.dashTranslate.value=r+i}))}))},update:function(t){var e=Xd(t.arcStartLat),n=Xd(t.arcStartLng),i=Xd(t.arcEndLat),r=Xd(t.arcEndLng),s=Xd(t.arcAltitude),a=Xd(t.arcAltitudeAutoScale),o=Xd(t.arcStroke),l=Xd(t.arcColor),u=Xd(t.arcDashLength),h=Xd(t.arcDashGap),c=Xd(t.arcDashInitialGap),A=Xd(t.arcDashAnimateTime),d=new Dv.ShaderMaterial(ev(ev({},Lv),{},{transparent:!0,blending:Dv.NormalBlending}));Tv(t.arcsData,t.scene,{createObj:function(){var t=new Dv.Group;return t.__globeObjType="arc",t},updateObj:function(p,f){var m=o(f),g=null!=m;if(!p.children.length||g!==("Mesh"===p.children[0].type)){uv(p);var y=g?new Dv.Mesh:new Dv.Line(new Dv.BufferGeometry);y.material=d.clone(),p.add(y)}var v=p.children[0];Object.assign(v.material.uniforms,{dashSize:{value:u(f)},gapSize:{value:h(f)},dashOffset:{value:c(f)}});var _=A(f);v.__dashAnimateStep=_>0?1e3/_:0;var x=function(t,e){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=e+1;if(t instanceof Array||t instanceof Function){var s=t instanceof Array?ym().domain(t.map((function(e,n){return n/(t.length-1)}))).range(t):t;n=function(t){return Sv(s(t),!0,!0)}}else{var a=Sv(t,!0,!0);n=function(){return a}}for(var o=[],l=0,u=r;l<u;l++)for(var h=n(l/(u-1)),c=0;c<i;c++)o.push(h);return wv(o,4)}(l(f),t.arcCurveResolution,g?t.arcCircularResolution+1:1),b=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=[],r=0,s=t+1;r<s;r++)for(var a=r/(s-1),o=0;o<e;o++)i.push(a);return n&&i.reverse(),wv(i,1)}(t.arcCurveResolution,g?t.arcCircularResolution+1:1,!0);v.geometry.setAttribute("vertexColor",x),v.geometry.setAttribute("vertexRelDistance",b);var S=function(e){var n=f.__currentTargetD=e,i=n.stroke,r=function(t){var e=t.alt,n=t.altAutoScale,i=t.startLat,r=t.startLng,s=t.endLat,a=t.endLng,o=function(t){var e=iv(t,3),n=e[0],i=dv(e[1],n,e[2]),r=i.x,s=i.y,a=i.z;return new Dv.Vector3(r,s,a)},l=[r,i],u=[a,s],h=e;if(null==h&&(h=td(l,u)/2*n),h){var c=Ad(l,u),A=iv([.25,.75].map((function(t){return[].concat(rv(c(t)),[1.5*h])})),2),d=A[0],p=A[1];return Yy(Dv.CubicBezierCurve3,rv([l,d,p,u].map(o)))}var f=.001;return m.apply(void 0,rv([[].concat(l,[f]),[].concat(u,[f])].map(o)));function m(t,e){var n=t.angleTo(e),i=0===n?function(){return t.clone()}:function(i){return(new Dv.Vector3).addVectors(t.clone().multiplyScalar(Math.sin((1-i)*n)),e.clone().multiplyScalar(Math.sin(i*n))).divideScalar(Math.sin(n))},r=new Dv.Curve;return r.getPoint=i,r}}(function(t,e){if(null==t)return{};var n,i,r=function(t,e){if(null==t)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.includes(i))continue;n[i]=t[i]}return n}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],e.includes(n)||{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(n,Pv));g?(v.geometry&&v.geometry.dispose(),v.geometry=new Dv.TubeGeometry(r,t.arcCurveResolution,i/2,t.arcCircularResolution),v.geometry.setAttribute("vertexColor",x),v.geometry.setAttribute("vertexRelDistance",b)):v.geometry.setFromPoints(r.getPoints(t.arcCurveResolution))},M={stroke:m,alt:s(f),altAutoScale:+a(f),startLat:+e(f),startLng:+n(f),endLat:+i(f),endLng:+r(f)},w=f.__currentTargetD||Object.assign({},M,{altAutoScale:-.001});Object.keys(M).some((function(t){return w[t]!==M[t]}))&&(!t.arcsTransitionDuration||t.arcsTransitionDuration<0?S(M):t.tweenGroup.add(new Wu(w).to(M,t.arcsTransitionDuration).easing(zu.Quadratic.InOut).onUpdate(S).start()))}})}}),Uv=window.THREE?window.THREE:{BufferGeometry:Gi,Color:Mi,DoubleSide:2,Mesh:tr,MeshLambertMaterial:Ll,Object3D:si},Ov=Object.assign({},Wd),Fv=Ov.BufferGeometryUtils||Ov,kv=Fu({props:{hexBinPointsData:{default:[]},hexBinPointLat:{default:"lat"},hexBinPointLng:{default:"lng"},hexBinPointWeight:{default:1},hexBinResolution:{default:4},hexMargin:{default:.2},hexTopCurvatureResolution:{default:5},hexTopColor:{default:function(){return"#ffffaa"}},hexSideColor:{default:function(){return"#ffffaa"}},hexAltitude:{default:function(t){return.01*t.sumWeight}},hexBinMerge:{default:!1},hexTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e,n){var i=n.tweenGroup;uv(t),e.scene=t,e.tweenGroup=i},update:function(t){var e=Xd(t.hexBinPointLat),n=Xd(t.hexBinPointLng),i=Xd(t.hexBinPointWeight),r=Xd(t.hexAltitude),s=Xd(t.hexTopColor),a=Xd(t.hexSideColor),o=Xd(t.hexMargin),l=ff(t.hexBinPointsData.map((function(i){return ev(ev({},i),{},{h3Idx:oy(e(i),n(i),t.hexBinResolution)})})),"h3Idx"),u=Object.entries(l).map((function(t){var e=iv(t,2),n=e[0],r=e[1];return{h3Idx:n,points:r,sumWeight:r.reduce((function(t,e){return t+ +i(e)}),0)}})),h={};if(Tv(u,t.hexBinMerge?new Uv.Object3D:t.scene,{createObj:function(t){var e=new Uv.Mesh;e.__hexCenter=ly(t.h3Idx),e.__hexGeoJson=uy(t.h3Idx).reverse();var n=e.__hexCenter[1];return e.__hexGeoJson.forEach((function(t){var e=t[0];Math.abs(n-e)>170&&(t[0]+=n>e?360:-360)})),e.__globeObjType="hexbin",e},updateObj:function(e,n){var i=Math.max(0,Math.min(1,+o(n))),l=iv(e.__hexCenter,2),u=l[0],c=l[1],A=0===i?e.__hexGeoJson:e.__hexGeoJson.map((function(t){var e=iv(t,2),n=e[0],r=e[1];return[[n,c],[r,u]].map((function(t){var e=iv(t,2);return function(t,e,n){return t-(t-e)*n}(e[0],e[1],i)}))})),d=t.hexTopCurvatureResolution;e.geometry&&e.geometry.dispose(),e.geometry=new Cg([A],0,cv,!1,!0,!0,d);var p={alt:+r(n)},f=function(t){var n=(e.__currentTargetD=t).alt;e.scale.x=e.scale.y=e.scale.z=1+n},m=e.__currentTargetD||Object.assign({},p,{alt:-.001});Object.keys(p).some((function(t){return m[t]!==p[t]}))&&(t.hexBinMerge||!t.hexTransitionDuration||t.hexTransitionDuration<0?f(p):t.tweenGroup.add(new Wu(m).to(p,t.hexTransitionDuration).easing(zu.Quadratic.InOut).onUpdate(f).start()));if(!t.hexBinMerge){var g=a(n),y=s(n);[g,y].forEach((function(t){if(!h.hasOwnProperty(t)){var e=bv(t);h[t]=new Uv.MeshLambertMaterial({color:xv(t),transparent:e<1,opacity:e,side:Uv.DoubleSide})}})),e.material=[g,y].map((function(t){return h[t]}))}},idAccessor:function(t){return t.h3Idx}}),t.hexBinMerge){var c=u.length?(Fv.mergeGeometries||Fv.mergeBufferGeometries)(u.map((function(t){var e=t.__threeObj;t.__threeObj=void 0;var n=e.geometry.toNonIndexed();e.updateMatrix(),n.applyMatrix4(e.matrix);var i=Sv(s(t)),r=Sv(a(t)),o=n.getAttribute("position").count,l=n.groups[0].count;return n.setAttribute("color",wv(rv(new Array(o)).map((function(t,e){return e>=l?i:r})),4)),n}))):new Uv.BufferGeometry,A=new Uv.Mesh(c,new Uv.MeshLambertMaterial({color:16777215,transparent:!0,vertexColors:!0,side:Uv.DoubleSide}));A.__globeObjType="hexBinPoints",A.__data=u,uv(t.scene),t.scene.add(A)}}}),zv=function(t){return t*t};var qv=Math.sqrt(2*Math.PI);var Gv=function(t){var e=iv(t,2),n=e[0],i=e[1],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=s.lngAccessor,o=void 0===a?function(t){return t[0]}:a,l=s.latAccessor,u=void 0===l?function(t){return t[1]}:l,h=s.weightAccessor,c=void 0===h?function(){return 1}:h,A=s.bandwidth,d=[n,i],p=A*Math.PI/180;return function(t){let e=0;for(let n of t)(n=+n)&&(e+=n);return e}(r.map((function(t){var e=c(t);if(!e)return 0;var n,i,r=function(t,e){var n=Math.sqrt,i=Math.cos,r=function(t){return t*Math.PI/180},s=function(t){return zv(Math.sin(t/2))},a=r(t[1]),o=r(e[1]),l=r(t[0]),u=r(e[0]);return 2*Math.asin(n(s(o-a)+i(a)*i(o)*s(u-l)))}(d,[o(t),u(t)]);return n=r,i=p,Math.exp(-zv(n/i)/2)/(i*qv)*e})))},Vv=window.THREE?window.THREE:{Mesh:tr,MeshLambertMaterial:Ll,SphereGeometry:Nl},Hv=new WeakSet,jv=new WeakMap,Wv=new WeakMap,Xv=new WeakMap,Yv=function(){return Qy((function t(e,n){Hy(this,t),function(t,e){Vy(t,e),e.add(t)}(this,Hv),Wy(this,jv,void 0),Wy(this,Wv,void 0),Wy(this,Xv,void 0),Xy(jv,this,e),Xy(Wv,this,py()),jy(Wv,this).init(e.map((function(t){return[t.x,t.y,t.z]})).flat()),Xy(Xv,this,qy(Hv,this,Qv).call(this,dv(0,0),dv(0,Math.min(180,n))))}),[{key:"getNearPoints",value:function(t,e,n){var i=this;return jy(Wv,this).intersectSphere(t,e,n,jy(Xv,this)).map((function(t){return jy(jv,i)[t/3]}))}}])}();function Qv(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)+Math.pow(t.z-e.z,2))}var $v=function(t){var e=Ap(function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"}(t));return e.opacity=Math.cbrt(t),e.formatRgb()},Zv=Fu({props:{heatmapsData:{default:[]},heatmapPoints:{default:function(t){return t}},heatmapPointLat:{default:function(t){return t[0]}},heatmapPointLng:{default:function(t){return t[1]}},heatmapPointWeight:{default:1},heatmapBandwidth:{default:4},heatmapColorFn:{default:function(){return $v}},heatmapColorSaturation:{default:1.5},heatmapBaseAltitude:{default:.01},heatmapTopAltitude:{},heatmapsTransitionDuration:{default:0,triggerUpdate:!1}},init:function(t,e,n){var i=n.tweenGroup;uv(t),e.scene=t,e.tweenGroup=i},update:function(t){var e=Xd(t.heatmapPoints),n=Xd(t.heatmapPointLat),i=Xd(t.heatmapPointLng),r=Xd(t.heatmapPointWeight),s=Xd(t.heatmapBandwidth),a=Xd(t.heatmapColorFn),o=Xd(t.heatmapColorSaturation),l=Xd(t.heatmapBaseAltitude),u=Xd(t.heatmapTopAltitude);Tv(t.heatmapsData,t.scene,{createObj:function(t){var e=new Vv.Mesh(new Vv.SphereGeometry(cv),new Vv.MeshLambertMaterial({vertexColors:!0,transparent:!0}));return e.__globeObjType="heatmap",e},updateObj:function(h,c){var A=s(c),d=a(c),p=o(c),f=l(c),m=u(c),g=e(c).map((function(t){var e=n(t),s=i(t),a=dv(e,s);return{x:a.x,y:a.y,z:a.z,lat:e,lng:s,weight:r(t)}})),y=Math.max(.1,A/3.5),v=Math.ceil(360/(y||-1));h.geometry.parameters.widthSegments!==v&&(h.geometry.dispose(),h.geometry=new Vv.SphereGeometry(cv,v,v/2));var _=function(t){for(var e=t.itemSize,n=[],i=0;i<t.count;i++)n.push(t.array.slice(i*e,(i+1)*e));return n}(h.geometry.getAttribute("position")),x=_.map((function(t){var e=iv(t,3),n=pv({x:e[0],y:e[1],z:e[2]});return[n.lng,n.lat]})),b=new Yv(g,3.5*A),S=x.map((function(t,e){var n=iv(_[e],3),i=n[0],r=n[1],s=n[2];return Gv(t,b.getNearPoints(i,r,s),{latAccessor:function(t){return t.lat},lngAccessor:function(t){return t.lng},weightAccessor:function(t){return t.weight},bandwidth:A})})),M=function(t){var e=h.__currentTargetD=t,n=e.kdeVals,i=e.topAlt,r=e.saturation,s=function(t){let e;for(const n of t)null!=n&&(e<n||void 0===e&&n>=n)&&(e=n);return e}(n.map(Math.abs))||1e-15;h.geometry.setAttribute("color",wv(n.map((function(t){return Sv(d(t/s*r))})),4));var a=ym([0,s],[f,i||f]);h.geometry.setAttribute("position",wv(n.map((function(t,e){var n=iv(x[e],2),i=n[0],r=dv(n[1],i,a(Math.abs(t)));return[r.x,r.y,r.z]})),3))},w={kdeVals:S,topAlt:m,saturation:p},T=h.__currentTargetD||Object.assign({},w,{kdeVals:S.map((function(){return 0})),topAlt:m?f:m,saturation:.5});T.kdeVals.length!==S.length&&(T.kdeVals=S.slice()),Object.keys(w).some((function(t){return T[t]!==w[t]}))&&(!t.heatmapsTransitionDuration||t.heatmapsTransitionDuration<0?M(w):t.tweenGroup.add(new Wu(T).to(w,t.heatmapsTransitionDuration).easing(zu.Quadratic.InOut).onUpdate(M).start()))}})}}),Kv=window.THREE?window.THREE:{DoubleSide:2,Group:so,LineBasicMaterial:vo,LineSegments:Po,Mesh:tr,MeshBasicMaterial:Ci},Jv=Fu({props:{polygonsData:{default:[]},polygonGeoJsonGeometry:{default:"geometry"},polygonSideColor:{default:function(){return"#ffffaa"}},polygonSideMaterial:{},polygonCapColor:{default:function(){return"#ffffaa"}},polygonCapMaterial:{},polygonStrokeColor:{},polygonAltitude:{default:.01},polygonCapCurvatureResolution:{default:5},polygonsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e,n){var i=n.tweenGroup;uv(t),e.scene=t,e.tweenGroup=i},update:function(t){var e=Xd(t.polygonGeoJsonGeometry),n=Xd(t.polygonAltitude),i=Xd(t.polygonCapCurvatureResolution),r=Xd(t.polygonCapColor),s=Xd(t.polygonCapMaterial),a=Xd(t.polygonSideColor),o=Xd(t.polygonSideMaterial),l=Xd(t.polygonStrokeColor),u=[];t.polygonsData.forEach((function(t){var h={data:t,capColor:r(t),capMaterial:s(t),sideColor:a(t),sideMaterial:o(t),strokeColor:l(t),altitude:+n(t),capCurvatureResolution:+i(t)},c=e(t),A=t.__id||"".concat(Math.round(1e9*Math.random()));t.__id=A,"Polygon"===c.type?u.push(ev({id:"".concat(A,"_0"),coords:c.coordinates},h)):"MultiPolygon"===c.type?u.push.apply(u,rv(c.coordinates.map((function(t,e){return ev({id:"".concat(A,"_").concat(e),coords:t},h)})))):console.warn("Unsupported GeoJson geometry type: ".concat(c.type,". Skipping geometry..."))})),Tv(u,t.scene,{idAccessor:function(t){return t.id},createObj:function(){var t=new Kv.Group;return t.__defaultSideMaterial=new Kv.MeshBasicMaterial({side:Kv.DoubleSide,depthWrite:!0}),t.__defaultCapMaterial=new Kv.MeshBasicMaterial({side:Kv.DoubleSide,depthWrite:!0}),t.add(new Kv.Mesh(void 0,[t.__defaultSideMaterial,t.__defaultCapMaterial])),t.add(new Kv.LineSegments(void 0,new Kv.LineBasicMaterial)),t.__globeObjType="polygon",t},updateObj:function(e,n){var i=n.coords,r=n.capColor,s=n.capMaterial,a=n.sideColor,o=n.sideMaterial,l=n.strokeColor,u=n.altitude,h=n.capCurvatureResolution,c=iv(e.children,2),A=c[0],d=c[1],p=!!l;if(d.visible=p,function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return function(t,e){return t===e}};return Object.entries(e).every((function(e){var i=iv(e,2),r=i[0],s=i[1];return t.hasOwnProperty(r)&&n(r)(t[r],s)}))}(A.geometry.parameters||{},{polygonGeoJson:i,curvatureResolution:h})||(A.geometry&&A.geometry.dispose(),A.geometry=new Cg(i,0,cv,!1,!0,!0,h)),!p||d.geometry.parameters&&d.geometry.parameters.geoJson.coordinates===i&&d.geometry.parameters.resolution===h||(d.geometry&&d.geometry.dispose(),d.geometry=new zd({type:"Polygon",coordinates:i},cv,h)),A.material[0]=o||e.__defaultSideMaterial,A.material[1]=s||e.__defaultCapMaterial,[!o&&a,!s&&r].forEach((function(t,e){if(t){var n=A.material[e],i=bv(t);n.color.set(xv(t)),n.transparent=i<1,n.opacity=i}})),p){var f=d.material,m=bv(l);f.color.set(xv(l)),f.transparent=m<1,f.opacity=m}var g={alt:u},y=function(t){var n=(e.__currentTargetD=t).alt;A.scale.x=A.scale.y=A.scale.z=1+n,p&&(d.scale.x=d.scale.y=d.scale.z=1+n+1e-4)},v=e.__currentTargetD||Object.assign({},g,{alt:-.001});Object.keys(g).some((function(t){return v[t]!==g[t]}))&&(!t.polygonsTransitionDuration||t.polygonsTransitionDuration<0||v.alt===g.alt?y(g):t.tweenGroup.add(new Wu(v).to(g,t.polygonsTransitionDuration).easing(zu.Quadratic.InOut).onUpdate(y).start()))}})}});var t_=window.THREE?window.THREE:{BufferGeometry:Gi,CircleGeometry:Zo,DoubleSide:2,Mesh:tr,MeshLambertMaterial:Ll,Vector3:en},e_=Object.assign({},Wd),n_=e_.BufferGeometryUtils||e_,i_=Fu({props:{hexPolygonsData:{default:[]},hexPolygonGeoJsonGeometry:{default:"geometry"},hexPolygonColor:{default:function(){return"#ffffaa"}},hexPolygonAltitude:{default:.001},hexPolygonResolution:{default:3},hexPolygonMargin:{default:.2},hexPolygonUseDots:{default:!1},hexPolygonCurvatureResolution:{default:5},hexPolygonDotResolution:{default:12},hexPolygonsTransitionDuration:{default:0,triggerUpdate:!1}},init:function(t,e,n){var i=n.tweenGroup;uv(t),e.scene=t,e.tweenGroup=i},update:function(t){var e=Xd(t.hexPolygonGeoJsonGeometry),n=Xd(t.hexPolygonColor),i=Xd(t.hexPolygonAltitude),r=Xd(t.hexPolygonResolution),s=Xd(t.hexPolygonMargin),a=Xd(t.hexPolygonUseDots),o=Xd(t.hexPolygonCurvatureResolution),l=Xd(t.hexPolygonDotResolution);Tv(t.hexPolygonsData,t.scene,{createObj:function(t){var e=new t_.Mesh(void 0,new t_.MeshLambertMaterial({side:t_.DoubleSide}));return e.__globeObjType="hexPolygon",e},updateObj:function(u,h){var c=e(h),A=r(h),d=i(h),p=Math.max(0,Math.min(1,+s(h))),f=a(h),m=o(h),g=l(h),y=n(h),v=bv(y);u.material.color.set(xv(y)),u.material.transparent=v<1,u.material.opacity=v;var _={alt:d,margin:p,curvatureResolution:m},x={geoJson:c,h3Res:A},b=u.__currentTargetD||Object.assign({},_,{alt:-.001}),S=u.__currentMemD||x;if(Object.keys(_).some((function(t){return b[t]!==_[t]}))||Object.keys(x).some((function(t){return S[t]!==x[t]}))){u.__currentMemD=x;var M=[];"Polygon"===c.type?hy(c.coordinates,A,!0).forEach((function(t){return M.push(t)})):"MultiPolygon"===c.type?c.coordinates.forEach((function(t){return hy(t,A,!0).forEach((function(t){return M.push(t)}))})):console.warn("Unsupported GeoJson geometry type: ".concat(c.type,". Skipping geometry..."));var w=M.map((function(t){var e=ly(t),n=uy(t).reverse(),i=e[1];return n.forEach((function(t){var e=t[0];Math.abs(i-e)>170&&(t[0]+=i>e?360:-360)})),{h3Idx:t,hexCenter:e,hexGeoJson:n}})),T=function(t){var e=u.__currentTargetD=t,n=e.alt,i=e.margin,r=e.curvatureResolution;u.geometry&&u.geometry.dispose(),u.geometry=w.length?(n_.mergeGeometries||n_.mergeBufferGeometries)(w.map((function(t){var e=iv(t.hexCenter,2),s=e[0],a=e[1];if(f){var o=dv(s,a,n),l=dv(t.hexGeoJson[0][1],t.hexGeoJson[0][0],n),u=.85*(1-i)*new t_.Vector3(o.x,o.y,o.z).distanceTo(new t_.Vector3(l.x,l.y,l.z)),h=new Zo(u,g);return h.rotateX(fv(-s)),h.rotateY(fv(a)),h.translate(o.x,o.y,o.z),h}var c=0===i?t.hexGeoJson:t.hexGeoJson.map((function(t){var e=iv(t,2),n=e[0],r=e[1];return[[n,a],[r,s]].map((function(t){var e=iv(t,2);return function(t,e,n){return t-(t-e)*n}(e[0],e[1],i)}))}));return new Cg([c],cv,cv*(1+n),!1,!0,!1,r)}))):new t_.BufferGeometry};!t.hexPolygonsTransitionDuration||t.hexPolygonsTransitionDuration<0?T(_):t.tweenGroup.add(new Wu(b).to(_,t.hexPolygonsTransitionDuration).easing(zu.Quadratic.InOut).onUpdate(T).start())}}})}}),r_=window.THREE?window.THREE:{Vector3:en};function s_(t,e){var n=Math.max(t.length,e.length),i=Ff.apply(void 0,rv([t,e].map((function(t){return t.map((function(t){return[t.x,t.y,t.z]}))})).map((function(t){return function(t,e){var n=t[t.length-1];return[].concat(rv(t),rv(rv(new Array(e-t.length)).map((function(){return n}))))}(t,n)}))));return function(n){return 0===n?t:1===n?e:i(n).map((function(t){var e=iv(t,3),n=e[0],i=e[1],r=e[2];return new r_.Vector3(n,i,r)}))}}var a_=window.THREE?window.THREE:{BufferGeometry:Gi,Color:Mi,Group:so,Line:Eo,NormalBlending:1,ShaderMaterial:or,Vector3:en},o_=Nf.default||Nf,l_={uniforms:{dashOffset:{value:0},dashSize:{value:1},gapSize:{value:0},dashTranslate:{value:0}},vertexShader:"\n uniform float dashTranslate;\n\n attribute vec4 vertexColor;\n varying vec4 vColor;\n\n attribute float vertexRelDistance;\n varying float vRelDistance;\n\n void main() {\n // pass through colors and distances\n vColor = vertexColor;\n vRelDistance = vertexRelDistance + dashTranslate;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",fragmentShader:"\n uniform float dashOffset;\n uniform float dashSize;\n uniform float gapSize;\n\n varying vec4 vColor;\n varying float vRelDistance;\n\n void main() {\n // ignore pixels in the gap\n if (vRelDistance < dashOffset) discard;\n if (mod(vRelDistance - dashOffset, dashSize + gapSize) > dashSize) discard;\n\n // set px color: [r, g, b, a], interpolated between vertices\n gl_FragColor = vColor;\n }\n "},u_=Fu({props:{pathsData:{default:[]},pathPoints:{default:function(t){return t}},pathPointLat:{default:function(t){return t[0]}},pathPointLng:{default:function(t){return t[1]}},pathPointAlt:{default:.001},pathResolution:{default:2},pathColor:{default:function(){return"#ffffaa"}},pathStroke:{},pathDashLength:{default:1},pathDashGap:{default:0},pathDashInitialGap:{default:0},pathDashAnimateTime:{default:0},pathTransitionDuration:{default:1e3,triggerUpdate:!1},rendererSize:{}},methods:{pauseAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.pause()},resumeAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.resume()},_destructor:function(t){var e;null===(e=t.ticker)||void 0===e||e.dispose()}},init:function(t,e,n){var i=n.tweenGroup;uv(t),e.scene=t,e.tweenGroup=i,e.ticker=new o_,e.ticker.onTick.add((function(t,n){e.pathsData.filter((function(t){return t.__threeObj&&t.__threeObj.children.length&&t.__threeObj.children[0].material&&t.__threeObj.children[0].__dashAnimateStep})).forEach((function(t){var e=t.__threeObj.children[0],i=e.__dashAnimateStep*n;if("Line"===e.type){var r=e.material.uniforms.dashTranslate.value%1e9;e.material.uniforms.dashTranslate.value=r+i}else if("Line2"===e.type){for(var s=e.material.dashOffset-i,a=e.material.dashSize+e.material.gapSize;s<=-a;)s+=a;e.material.dashOffset=s}}))}))},update:function(t){var e=Xd(t.pathPoints),n=Xd(t.pathPointLat),i=Xd(t.pathPointLng),r=Xd(t.pathPointAlt),s=Xd(t.pathStroke),a=Xd(t.pathColor),o=Xd(t.pathDashLength),l=Xd(t.pathDashGap),u=Xd(t.pathDashInitialGap),h=Xd(t.pathDashAnimateTime),c=new a_.ShaderMaterial(ev(ev({},l_),{},{transparent:!0,blending:a_.NormalBlending}));function A(t,e){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=e+1;if(t instanceof Array||t instanceof Function){var a=t instanceof Array?ym().domain(t.map((function(e,n){return n/(t.length-1)}))).range(t):t;n=function(t){return Sv(a(t),r,!0)}}else{var o=Sv(t,r,!0);n=function(){return o}}for(var l=[],u=0,h=s;u<h;u++)for(var c=n(u/(h-1)),A=0;A<i;A++)l.push(c);return wv(l,r?4:3)}Tv(t.pathsData,t.scene,{createObj:function(){var t=new a_.Group;return t.__globeObjType="path",t},updateObj:function(d,p){var f=s(p),m=null!=f;if(!d.children.length||m===("Line"===d.children[0].type)){uv(d);var g=m?new Oy(new Uy,new yy):new a_.Line(new a_.BufferGeometry,c.clone());d.add(g)}var y,v,_=d.children[0],x=function(t,e,n,i,r){var s=function(t,e,n){for(var i=[],r=1;r<=n;r++)i.push(t+(e-t)*r/(n+1));return i},a=function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,e=[],n=null;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(i){if(n){for(;Math.abs(n[1]-i[1])>180;)n[1]+=360*(n[1]<i[1]?1:-1);var r=Math.sqrt(Math.pow(i[0]-n[0],2)+Math.pow(i[1]-n[1],2));if(r>t)for(var a=Math.floor(r/t),o=s(n[0],i[0],a),l=s(n[1],i[1],a),u=s(n[2],i[2],a),h=0,c=o.length;h<c;h++)e.push([o[h],l[h],u[h]])}e.push(n=i)})),e},o=function(t){var e=iv(t,3),n=dv(e[0],e[1],e[2]),i=n.x,r=n.y,s=n.z;return new a_.Vector3(i,r,s)};return a(t.map((function(t){return[e(t),n(t),i(t)]})),r).map(o)}(e(p),n,i,r,t.pathResolution),b=h(p);if(_.__dashAnimateStep=b>0?1e3/b:0,m){_.material.resolution=t.rendererSize;var S=o(p),M=l(p),w=u(p);_.material.dashed=M>0,_.material.dashed?_.material.defines.USE_DASH="":delete _.material.defines.USE_DASH,_.material.dashed&&(_.material.dashScale=1/(v=0,x.forEach((function(t){y&&(v+=y.distanceTo(t)),y=t})),v),_.material.dashSize=S,_.material.gapSize=M,_.material.dashOffset=-w);var T=a(p);if(T instanceof Array){var E=A(a(p),x.length-1,1,!1);_.geometry.setColors(E.array),_.material.vertexColors=!0}else{var C=T,R=bv(C);_.material.color=new a_.Color(xv(C)),_.material.transparent=R<1,_.material.opacity=R,_.material.vertexColors=!1}_.material.needsUpdate=!0}else{Object.assign(_.material.uniforms,{dashSize:{value:o(p)},gapSize:{value:l(p)},dashOffset:{value:u(p)}});var N=A(a(p),x.length),P=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=[],r=0,s=t+1;r<s;r++)for(var a=r/(s-1),o=0;o<e;o++)i.push(a);return n&&i.reverse(),wv(i,1)}(x.length,1,!0);_.geometry.setAttribute("vertexColor",N),_.geometry.setAttribute("vertexRelDistance",P)}var D=s_(p.__currentTargetD&&p.__currentTargetD.points||[x[0]],x),I=function(t){var e,n=p.__currentTargetD=t,i=n.stroke,r=n.interpolK,s=p.__currentTargetD.points=D(r);m?(_.geometry.setPositions((e=[]).concat.apply(e,rv(s.map((function(t){return[t.x,t.y,t.z]}))))),_.material.linewidth=i,_.material.dashed&&_.computeLineDistances()):(_.geometry.setFromPoints(s),_.geometry.computeBoundingSphere())},L={stroke:f,interpolK:1},B=Object.assign({},p.__currentTargetD||L,{interpolK:0});Object.keys(L).some((function(t){return B[t]!==L[t]}))&&(!t.pathTransitionDuration||t.pathTransitionDuration<0?I(L):t.tweenGroup.add(new Wu(B).to(L,t.pathTransitionDuration).easing(zu.Quadratic.InOut).onUpdate(I).start()))}})}}),h_=window.THREE?window.THREE:{Euler:Gn,Mesh:tr,MeshLambertMaterial:Ll,SphereGeometry:Nl},c_=Fu({props:{tilesData:{default:[]},tileLat:{default:"lat"},tileLng:{default:"lng"},tileAltitude:{default:.01},tileWidth:{default:1},tileHeight:{default:1},tileUseGlobeProjection:{default:!0},tileMaterial:{default:function(){return new h_.MeshLambertMaterial({color:"#ffbb88",opacity:.4,transparent:!0})}},tileCurvatureResolution:{default:5},tilesTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e,n){var i=n.tweenGroup;uv(t),e.scene=t,e.tweenGroup=i},update:function(t){var e=Xd(t.tileLat),n=Xd(t.tileLng),i=Xd(t.tileAltitude),r=Xd(t.tileWidth),s=Xd(t.tileHeight),a=Xd(t.tileUseGlobeProjection),o=Xd(t.tileMaterial),l=Xd(t.tileCurvatureResolution);Tv(t.tilesData,t.scene,{createObj:function(){var t=new h_.Mesh;return t.__globeObjType="tile",t},updateObj:function(u,h){u.material=o(h);var c=a(h),A=l(h),d=function(t){var e=u.__currentTargetD=t,n=e.lat,i=e.lng,r=e.alt,s=e.width,a=e.height,o=A_(i),l=A_(-n);u.geometry&&u.geometry.dispose(),u.geometry=new h_.SphereGeometry(cv*(1+r),Math.ceil(s/(A||-1)),Math.ceil(a/(A||-1)),A_(90-s/2)+(c?o:0),A_(s),A_(90-a/2)+(c?l:0),A_(a)),c||u.setRotationFromEuler(new h_.Euler(l,o,0,"YXZ"))},p={lat:+e(h),lng:+n(h),alt:+i(h),width:+r(h),height:+s(h)},f=u.__currentTargetD||Object.assign({},p,{width:0,height:0});Object.keys(p).some((function(t){return f[t]!==p[t]}))&&(!t.tilesTransitionDuration||t.tilesTransitionDuration<0?d(p):t.tweenGroup.add(new Wu(f).to(p,t.tilesTransitionDuration).easing(zu.Quadratic.InOut).onUpdate(d).start()))}})}}),A_=function(t){return t*Math.PI/180},d_={glyphs:{0:{x_min:73,x_max:715,ha:792,o:"m 394 -29 q 153 129 242 -29 q 73 479 73 272 q 152 829 73 687 q 394 989 241 989 q 634 829 545 989 q 715 479 715 684 q 635 129 715 270 q 394 -29 546 -29 m 394 89 q 546 211 489 89 q 598 479 598 322 q 548 748 598 640 q 394 871 491 871 q 241 748 298 871 q 190 479 190 637 q 239 211 190 319 q 394 89 296 89 "},1:{x_min:215.671875,x_max:574,ha:792,o:"m 574 0 l 442 0 l 442 697 l 215 697 l 215 796 q 386 833 330 796 q 475 986 447 875 l 574 986 l 574 0 "},2:{x_min:59,x_max:731,ha:792,o:"m 731 0 l 59 0 q 197 314 59 188 q 457 487 199 315 q 598 691 598 580 q 543 819 598 772 q 411 867 488 867 q 272 811 328 867 q 209 630 209 747 l 81 630 q 182 901 81 805 q 408 986 271 986 q 629 909 536 986 q 731 694 731 826 q 613 449 731 541 q 378 316 495 383 q 201 122 235 234 l 731 122 l 731 0 "},3:{x_min:54,x_max:737,ha:792,o:"m 737 284 q 635 55 737 141 q 399 -25 541 -25 q 156 52 248 -25 q 54 308 54 140 l 185 308 q 245 147 185 202 q 395 96 302 96 q 539 140 484 96 q 602 280 602 190 q 510 429 602 390 q 324 454 451 454 l 324 565 q 487 584 441 565 q 565 719 565 617 q 515 835 565 791 q 395 879 466 879 q 255 824 307 879 q 203 661 203 769 l 78 661 q 166 909 78 822 q 387 992 250 992 q 603 921 513 992 q 701 723 701 844 q 669 607 701 656 q 578 524 637 558 q 696 434 655 499 q 737 284 737 369 "},4:{x_min:48,x_max:742.453125,ha:792,o:"m 742 243 l 602 243 l 602 0 l 476 0 l 476 243 l 48 243 l 48 368 l 476 958 l 602 958 l 602 354 l 742 354 l 742 243 m 476 354 l 476 792 l 162 354 l 476 354 "},5:{x_min:54.171875,x_max:738,ha:792,o:"m 738 314 q 626 60 738 153 q 382 -23 526 -23 q 155 47 248 -23 q 54 256 54 125 l 183 256 q 259 132 204 174 q 382 91 314 91 q 533 149 471 91 q 602 314 602 213 q 538 469 602 411 q 386 528 475 528 q 284 506 332 528 q 197 439 237 484 l 81 439 l 159 958 l 684 958 l 684 840 l 254 840 l 214 579 q 306 627 258 612 q 407 643 354 643 q 636 552 540 643 q 738 314 738 457 "},6:{x_min:53,x_max:739,ha:792,o:"m 739 312 q 633 62 739 162 q 400 -31 534 -31 q 162 78 257 -31 q 53 439 53 206 q 178 859 53 712 q 441 986 284 986 q 643 912 559 986 q 732 713 732 833 l 601 713 q 544 830 594 786 q 426 875 494 875 q 268 793 331 875 q 193 517 193 697 q 301 597 240 570 q 427 624 362 624 q 643 540 552 624 q 739 312 739 451 m 603 298 q 540 461 603 400 q 404 516 484 516 q 268 461 323 516 q 207 300 207 401 q 269 137 207 198 q 405 83 325 83 q 541 137 486 83 q 603 298 603 197 "},7:{x_min:58.71875,x_max:730.953125,ha:792,o:"m 730 839 q 469 448 560 641 q 335 0 378 255 l 192 0 q 328 441 235 252 q 593 830 421 630 l 58 830 l 58 958 l 730 958 l 730 839 "},8:{x_min:55,x_max:736,ha:792,o:"m 571 527 q 694 424 652 491 q 736 280 736 358 q 648 71 736 158 q 395 -26 551 -26 q 142 69 238 -26 q 55 279 55 157 q 96 425 55 359 q 220 527 138 491 q 120 615 153 562 q 88 726 88 668 q 171 904 88 827 q 395 986 261 986 q 618 905 529 986 q 702 727 702 830 q 670 616 702 667 q 571 527 638 565 m 394 565 q 519 610 475 565 q 563 717 563 655 q 521 823 563 781 q 392 872 474 872 q 265 824 312 872 q 224 720 224 783 q 265 613 224 656 q 394 565 312 565 m 395 91 q 545 150 488 91 q 597 280 597 204 q 546 408 597 355 q 395 465 492 465 q 244 408 299 465 q 194 280 194 356 q 244 150 194 203 q 395 91 299 91 "},9:{x_min:53,x_max:739,ha:792,o:"m 739 524 q 619 94 739 241 q 362 -32 516 -32 q 150 47 242 -32 q 59 244 59 126 l 191 244 q 246 129 191 176 q 373 82 301 82 q 526 161 466 82 q 597 440 597 255 q 363 334 501 334 q 130 432 216 334 q 53 650 53 521 q 134 880 53 786 q 383 986 226 986 q 659 841 566 986 q 739 524 739 719 m 388 449 q 535 514 480 449 q 585 658 585 573 q 535 805 585 744 q 388 873 480 873 q 242 809 294 873 q 191 658 191 745 q 239 514 191 572 q 388 449 292 449 "},"ο":{x_min:0,x_max:712,ha:815,o:"m 356 -25 q 96 88 192 -25 q 0 368 0 201 q 92 642 0 533 q 356 761 192 761 q 617 644 517 761 q 712 368 712 533 q 619 91 712 201 q 356 -25 520 -25 m 356 85 q 527 175 465 85 q 583 369 583 255 q 528 562 583 484 q 356 651 466 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 356 85 250 85 "},S:{x_min:0,x_max:788,ha:890,o:"m 788 291 q 662 54 788 144 q 397 -26 550 -26 q 116 68 226 -26 q 0 337 0 168 l 131 337 q 200 152 131 220 q 384 85 269 85 q 557 129 479 85 q 650 270 650 183 q 490 429 650 379 q 194 513 341 470 q 33 739 33 584 q 142 964 33 881 q 388 1041 242 1041 q 644 957 543 1041 q 756 716 756 867 l 625 716 q 561 874 625 816 q 395 933 497 933 q 243 891 309 933 q 164 759 164 841 q 325 609 164 656 q 625 526 475 568 q 788 291 788 454 "},"¦":{x_min:343,x_max:449,ha:792,o:"m 449 462 l 343 462 l 343 986 l 449 986 l 449 462 m 449 -242 l 343 -242 l 343 280 l 449 280 l 449 -242 "},"/":{x_min:183.25,x_max:608.328125,ha:792,o:"m 608 1041 l 266 -129 l 183 -129 l 520 1041 l 608 1041 "},"Τ":{x_min:-.4375,x_max:777.453125,ha:839,o:"m 777 893 l 458 893 l 458 0 l 319 0 l 319 892 l 0 892 l 0 1013 l 777 1013 l 777 893 "},y:{x_min:0,x_max:684.78125,ha:771,o:"m 684 738 l 388 -83 q 311 -216 356 -167 q 173 -279 252 -279 q 97 -266 133 -279 l 97 -149 q 132 -155 109 -151 q 168 -160 155 -160 q 240 -114 213 -160 q 274 -26 248 -98 l 0 738 l 137 737 l 341 139 l 548 737 l 684 738 "},"Π":{x_min:0,x_max:803,ha:917,o:"m 803 0 l 667 0 l 667 886 l 140 886 l 140 0 l 0 0 l 0 1012 l 803 1012 l 803 0 "},"ΐ":{x_min:-111,x_max:339,ha:361,o:"m 339 800 l 229 800 l 229 925 l 339 925 l 339 800 m -1 800 l -111 800 l -111 925 l -1 925 l -1 800 m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 737 l 167 737 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 103 239 101 q 284 112 257 104 l 284 3 m 302 1040 l 113 819 l 30 819 l 165 1040 l 302 1040 "},g:{x_min:0,x_max:686,ha:838,o:"m 686 34 q 586 -213 686 -121 q 331 -306 487 -306 q 131 -252 216 -306 q 31 -84 31 -190 l 155 -84 q 228 -174 166 -138 q 345 -207 284 -207 q 514 -109 454 -207 q 564 89 564 -27 q 461 6 521 36 q 335 -23 401 -23 q 88 100 184 -23 q 0 370 0 215 q 87 634 0 522 q 330 758 183 758 q 457 728 398 758 q 564 644 515 699 l 564 737 l 686 737 l 686 34 m 582 367 q 529 560 582 481 q 358 652 468 652 q 189 561 250 652 q 135 369 135 482 q 189 176 135 255 q 361 85 251 85 q 529 176 468 85 q 582 367 582 255 "},"²":{x_min:0,x_max:442,ha:539,o:"m 442 383 l 0 383 q 91 566 0 492 q 260 668 176 617 q 354 798 354 727 q 315 875 354 845 q 227 905 277 905 q 136 869 173 905 q 99 761 99 833 l 14 761 q 82 922 14 864 q 232 974 141 974 q 379 926 316 974 q 442 797 442 878 q 351 635 442 704 q 183 539 321 611 q 92 455 92 491 l 442 455 l 442 383 "},"–":{x_min:0,x_max:705.5625,ha:803,o:"m 705 334 l 0 334 l 0 410 l 705 410 l 705 334 "},"Κ":{x_min:0,x_max:819.5625,ha:893,o:"m 819 0 l 650 0 l 294 509 l 139 356 l 139 0 l 0 0 l 0 1013 l 139 1013 l 139 526 l 626 1013 l 809 1013 l 395 600 l 819 0 "},"ƒ":{x_min:-46.265625,x_max:392,ha:513,o:"m 392 651 l 259 651 l 79 -279 l -46 -278 l 134 651 l 14 651 l 14 751 l 135 751 q 151 948 135 900 q 304 1041 185 1041 q 334 1040 319 1041 q 392 1034 348 1039 l 392 922 q 337 931 360 931 q 271 883 287 931 q 260 793 260 853 l 260 751 l 392 751 l 392 651 "},e:{x_min:0,x_max:714,ha:813,o:"m 714 326 l 140 326 q 200 157 140 227 q 359 87 260 87 q 488 130 431 87 q 561 245 545 174 l 697 245 q 577 48 670 123 q 358 -26 484 -26 q 97 85 195 -26 q 0 363 0 197 q 94 642 0 529 q 358 765 195 765 q 626 627 529 765 q 714 326 714 503 m 576 429 q 507 583 564 522 q 355 650 445 650 q 206 583 266 650 q 140 429 152 522 l 576 429 "},"ό":{x_min:0,x_max:712,ha:815,o:"m 356 -25 q 94 91 194 -25 q 0 368 0 202 q 92 642 0 533 q 356 761 192 761 q 617 644 517 761 q 712 368 712 533 q 619 91 712 201 q 356 -25 520 -25 m 356 85 q 527 175 465 85 q 583 369 583 255 q 528 562 583 484 q 356 651 466 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 356 85 250 85 m 576 1040 l 387 819 l 303 819 l 438 1040 l 576 1040 "},J:{x_min:0,x_max:588,ha:699,o:"m 588 279 q 287 -26 588 -26 q 58 73 126 -26 q 0 327 0 158 l 133 327 q 160 172 133 227 q 288 96 198 96 q 426 171 391 96 q 449 336 449 219 l 449 1013 l 588 1013 l 588 279 "},"»":{x_min:-1,x_max:503,ha:601,o:"m 503 302 l 280 136 l 281 256 l 429 373 l 281 486 l 280 608 l 503 440 l 503 302 m 221 302 l 0 136 l 0 255 l 145 372 l 0 486 l -1 608 l 221 440 l 221 302 "},"©":{x_min:-3,x_max:1008,ha:1106,o:"m 502 -7 q 123 151 263 -7 q -3 501 -3 294 q 123 851 -3 706 q 502 1011 263 1011 q 881 851 739 1011 q 1008 501 1008 708 q 883 151 1008 292 q 502 -7 744 -7 m 502 60 q 830 197 709 60 q 940 501 940 322 q 831 805 940 681 q 502 944 709 944 q 174 805 296 944 q 65 501 65 680 q 173 197 65 320 q 502 60 294 60 m 741 394 q 661 246 731 302 q 496 190 591 190 q 294 285 369 190 q 228 497 228 370 q 295 714 228 625 q 499 813 370 813 q 656 762 588 813 q 733 625 724 711 l 634 625 q 589 704 629 673 q 498 735 550 735 q 377 666 421 735 q 334 504 334 597 q 374 340 334 408 q 490 272 415 272 q 589 304 549 272 q 638 394 628 337 l 741 394 "},"ώ":{x_min:0,x_max:922,ha:1030,o:"m 687 1040 l 498 819 l 415 819 l 549 1040 l 687 1040 m 922 339 q 856 97 922 203 q 650 -26 780 -26 q 538 9 587 -26 q 461 103 489 44 q 387 12 436 46 q 277 -22 339 -22 q 69 97 147 -22 q 0 338 0 202 q 45 551 0 444 q 161 737 84 643 l 302 737 q 175 552 219 647 q 124 336 124 446 q 155 179 124 248 q 275 88 197 88 q 375 163 341 88 q 400 294 400 219 l 400 572 l 524 572 l 524 294 q 561 135 524 192 q 643 88 591 88 q 762 182 719 88 q 797 341 797 257 q 745 555 797 450 q 619 737 705 637 l 760 737 q 874 551 835 640 q 922 339 922 444 "},"^":{x_min:193.0625,x_max:598.609375,ha:792,o:"m 598 772 l 515 772 l 395 931 l 277 772 l 193 772 l 326 1013 l 462 1013 l 598 772 "},"«":{x_min:0,x_max:507.203125,ha:604,o:"m 506 136 l 284 302 l 284 440 l 506 608 l 507 485 l 360 371 l 506 255 l 506 136 m 222 136 l 0 302 l 0 440 l 222 608 l 221 486 l 73 373 l 222 256 l 222 136 "},D:{x_min:0,x_max:828,ha:935,o:"m 389 1013 q 714 867 593 1013 q 828 521 828 729 q 712 161 828 309 q 382 0 587 0 l 0 0 l 0 1013 l 389 1013 m 376 124 q 607 247 523 124 q 681 510 681 355 q 607 771 681 662 q 376 896 522 896 l 139 896 l 139 124 l 376 124 "},"∙":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 "},"ÿ":{x_min:0,x_max:47,ha:125,o:"m 47 3 q 37 -7 47 -7 q 28 0 30 -7 q 39 -4 32 -4 q 45 3 45 -1 l 37 0 q 28 9 28 0 q 39 19 28 19 l 47 16 l 47 19 l 47 3 m 37 1 q 44 8 44 1 q 37 16 44 16 q 30 8 30 16 q 37 1 30 1 m 26 1 l 23 22 l 14 0 l 3 22 l 3 3 l 0 25 l 13 1 l 22 25 l 26 1 "},w:{x_min:0,x_max:1009.71875,ha:1100,o:"m 1009 738 l 783 0 l 658 0 l 501 567 l 345 0 l 222 0 l 0 738 l 130 738 l 284 174 l 432 737 l 576 738 l 721 173 l 881 737 l 1009 738 "},$:{x_min:0,x_max:700,ha:793,o:"m 664 717 l 542 717 q 490 825 531 785 q 381 872 450 865 l 381 551 q 620 446 540 522 q 700 241 700 370 q 618 45 700 116 q 381 -25 536 -25 l 381 -152 l 307 -152 l 307 -25 q 81 62 162 -25 q 0 297 0 149 l 124 297 q 169 146 124 204 q 307 81 215 89 l 307 441 q 80 536 148 469 q 13 725 13 603 q 96 910 13 839 q 307 982 180 982 l 307 1077 l 381 1077 l 381 982 q 574 917 494 982 q 664 717 664 845 m 307 565 l 307 872 q 187 831 233 872 q 142 724 142 791 q 180 618 142 656 q 307 565 218 580 m 381 76 q 562 237 562 96 q 517 361 562 313 q 381 423 472 409 l 381 76 "},"\\":{x_min:-.015625,x_max:425.0625,ha:522,o:"m 425 -129 l 337 -129 l 0 1041 l 83 1041 l 425 -129 "},"µ":{x_min:0,x_max:697.21875,ha:747,o:"m 697 -4 q 629 -14 658 -14 q 498 97 513 -14 q 422 9 470 41 q 313 -23 374 -23 q 207 4 258 -23 q 119 81 156 32 l 119 -278 l 0 -278 l 0 738 l 124 738 l 124 343 q 165 173 124 246 q 308 83 216 83 q 452 178 402 83 q 493 359 493 255 l 493 738 l 617 738 l 617 214 q 623 136 617 160 q 673 92 637 92 q 697 96 684 92 l 697 -4 "},"Ι":{x_min:42,x_max:181,ha:297,o:"m 181 0 l 42 0 l 42 1013 l 181 1013 l 181 0 "},"Ύ":{x_min:0,x_max:1144.5,ha:1214,o:"m 1144 1012 l 807 416 l 807 0 l 667 0 l 667 416 l 325 1012 l 465 1012 l 736 533 l 1004 1012 l 1144 1012 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"’":{x_min:0,x_max:139,ha:236,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 "},"Ν":{x_min:0,x_max:801,ha:915,o:"m 801 0 l 651 0 l 131 822 l 131 0 l 0 0 l 0 1013 l 151 1013 l 670 191 l 670 1013 l 801 1013 l 801 0 "},"-":{x_min:8.71875,x_max:350.390625,ha:478,o:"m 350 317 l 8 317 l 8 428 l 350 428 l 350 317 "},Q:{x_min:0,x_max:968,ha:1072,o:"m 954 5 l 887 -79 l 744 35 q 622 -11 687 2 q 483 -26 556 -26 q 127 130 262 -26 q 0 504 0 279 q 127 880 0 728 q 484 1041 262 1041 q 841 884 708 1041 q 968 507 968 735 q 933 293 968 398 q 832 104 899 188 l 954 5 m 723 191 q 802 330 777 248 q 828 499 828 412 q 744 790 828 673 q 483 922 650 922 q 228 791 322 922 q 142 505 142 673 q 227 221 142 337 q 487 91 323 91 q 632 123 566 91 l 520 215 l 587 301 l 723 191 "},"ς":{x_min:1,x_max:676.28125,ha:740,o:"m 676 460 l 551 460 q 498 595 542 546 q 365 651 448 651 q 199 578 263 651 q 136 401 136 505 q 266 178 136 241 q 508 106 387 142 q 640 -50 640 62 q 625 -158 640 -105 q 583 -278 611 -211 l 465 -278 q 498 -182 490 -211 q 515 -80 515 -126 q 381 12 515 -15 q 134 91 197 51 q 1 388 1 179 q 100 651 1 542 q 354 761 199 761 q 587 680 498 761 q 676 460 676 599 "},M:{x_min:0,x_max:954,ha:1067,o:"m 954 0 l 819 0 l 819 869 l 537 0 l 405 0 l 128 866 l 128 0 l 0 0 l 0 1013 l 200 1013 l 472 160 l 757 1013 l 954 1013 l 954 0 "},"Ψ":{x_min:0,x_max:1006,ha:1094,o:"m 1006 678 q 914 319 1006 429 q 571 200 814 200 l 571 0 l 433 0 l 433 200 q 92 319 194 200 q 0 678 0 429 l 0 1013 l 139 1013 l 139 679 q 191 417 139 492 q 433 326 255 326 l 433 1013 l 571 1013 l 571 326 l 580 326 q 813 423 747 326 q 868 679 868 502 l 868 1013 l 1006 1013 l 1006 678 "},C:{x_min:0,x_max:886,ha:944,o:"m 886 379 q 760 87 886 201 q 455 -26 634 -26 q 112 136 236 -26 q 0 509 0 283 q 118 882 0 737 q 469 1041 245 1041 q 748 955 630 1041 q 879 708 879 859 l 745 708 q 649 862 724 805 q 473 920 573 920 q 219 791 312 920 q 136 509 136 675 q 217 229 136 344 q 470 99 311 99 q 672 179 591 99 q 753 379 753 259 l 886 379 "},"!":{x_min:0,x_max:138,ha:236,o:"m 138 684 q 116 409 138 629 q 105 244 105 299 l 33 244 q 16 465 33 313 q 0 684 0 616 l 0 1013 l 138 1013 l 138 684 m 138 0 l 0 0 l 0 151 l 138 151 l 138 0 "},"{":{x_min:0,x_max:480.5625,ha:578,o:"m 480 -286 q 237 -213 303 -286 q 187 -45 187 -159 q 194 48 187 -15 q 201 141 201 112 q 164 264 201 225 q 0 314 118 314 l 0 417 q 164 471 119 417 q 201 605 201 514 q 199 665 201 644 q 193 772 193 769 q 241 941 193 887 q 480 1015 308 1015 l 480 915 q 336 866 375 915 q 306 742 306 828 q 310 662 306 717 q 314 577 314 606 q 288 452 314 500 q 176 365 256 391 q 289 275 257 337 q 314 143 314 226 q 313 84 314 107 q 310 -11 310 -5 q 339 -131 310 -94 q 480 -182 377 -182 l 480 -286 "},X:{x_min:-.015625,x_max:854.15625,ha:940,o:"m 854 0 l 683 0 l 423 409 l 166 0 l 0 0 l 347 519 l 18 1013 l 186 1013 l 428 637 l 675 1013 l 836 1013 l 504 520 l 854 0 "},"#":{x_min:0,x_max:963.890625,ha:1061,o:"m 963 690 l 927 590 l 719 590 l 655 410 l 876 410 l 840 310 l 618 310 l 508 -3 l 393 -2 l 506 309 l 329 310 l 215 -2 l 102 -3 l 212 310 l 0 310 l 36 410 l 248 409 l 312 590 l 86 590 l 120 690 l 347 690 l 459 1006 l 573 1006 l 462 690 l 640 690 l 751 1006 l 865 1006 l 754 690 l 963 690 m 606 590 l 425 590 l 362 410 l 543 410 l 606 590 "},"ι":{x_min:42,x_max:284,ha:361,o:"m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 738 l 167 738 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 103 239 101 q 284 112 257 104 l 284 3 "},"Ά":{x_min:0,x_max:906.953125,ha:982,o:"m 283 1040 l 88 799 l 5 799 l 145 1040 l 283 1040 m 906 0 l 756 0 l 650 303 l 251 303 l 143 0 l 0 0 l 376 1012 l 529 1012 l 906 0 m 609 421 l 452 866 l 293 421 l 609 421 "},")":{x_min:0,x_max:318,ha:415,o:"m 318 365 q 257 25 318 191 q 87 -290 197 -141 l 0 -290 q 140 21 93 -128 q 193 360 193 189 q 141 704 193 537 q 0 1024 97 850 l 87 1024 q 257 706 197 871 q 318 365 318 542 "},"ε":{x_min:0,x_max:634.71875,ha:714,o:"m 634 234 q 527 38 634 110 q 300 -25 433 -25 q 98 29 183 -25 q 0 204 0 93 q 37 314 0 265 q 128 390 67 353 q 56 460 82 419 q 26 555 26 505 q 114 712 26 654 q 295 763 191 763 q 499 700 416 763 q 589 515 589 631 l 478 515 q 419 618 464 580 q 307 657 374 657 q 207 630 253 657 q 151 547 151 598 q 238 445 151 469 q 389 434 280 434 l 389 331 l 349 331 q 206 315 255 331 q 125 210 125 287 q 183 107 125 145 q 302 76 233 76 q 436 117 379 76 q 509 234 493 159 l 634 234 "},"Δ":{x_min:0,x_max:952.78125,ha:1028,o:"m 952 0 l 0 0 l 400 1013 l 551 1013 l 952 0 m 762 124 l 476 867 l 187 124 l 762 124 "},"}":{x_min:0,x_max:481,ha:578,o:"m 481 314 q 318 262 364 314 q 282 136 282 222 q 284 65 282 97 q 293 -58 293 -48 q 241 -217 293 -166 q 0 -286 174 -286 l 0 -182 q 143 -130 105 -182 q 171 -2 171 -93 q 168 81 171 22 q 165 144 165 140 q 188 275 165 229 q 306 365 220 339 q 191 455 224 391 q 165 588 165 505 q 168 681 165 624 q 171 742 171 737 q 141 865 171 827 q 0 915 102 915 l 0 1015 q 243 942 176 1015 q 293 773 293 888 q 287 675 293 741 q 282 590 282 608 q 318 466 282 505 q 481 417 364 417 l 481 314 "},"‰":{x_min:-3,x_max:1672,ha:1821,o:"m 846 0 q 664 76 732 0 q 603 244 603 145 q 662 412 603 344 q 846 489 729 489 q 1027 412 959 489 q 1089 244 1089 343 q 1029 76 1089 144 q 846 0 962 0 m 845 103 q 945 143 910 103 q 981 243 981 184 q 947 340 981 301 q 845 385 910 385 q 745 342 782 385 q 709 243 709 300 q 742 147 709 186 q 845 103 781 103 m 888 986 l 284 -25 l 199 -25 l 803 986 l 888 986 m 241 468 q 58 545 126 468 q -3 715 -3 615 q 56 881 -3 813 q 238 958 124 958 q 421 881 353 958 q 483 712 483 813 q 423 544 483 612 q 241 468 356 468 m 241 855 q 137 811 175 855 q 100 710 100 768 q 136 612 100 653 q 240 572 172 572 q 344 614 306 572 q 382 713 382 656 q 347 810 382 771 q 241 855 308 855 m 1428 0 q 1246 76 1314 0 q 1185 244 1185 145 q 1244 412 1185 344 q 1428 489 1311 489 q 1610 412 1542 489 q 1672 244 1672 343 q 1612 76 1672 144 q 1428 0 1545 0 m 1427 103 q 1528 143 1492 103 q 1564 243 1564 184 q 1530 340 1564 301 q 1427 385 1492 385 q 1327 342 1364 385 q 1291 243 1291 300 q 1324 147 1291 186 q 1427 103 1363 103 "},a:{x_min:0,x_max:698.609375,ha:794,o:"m 698 0 q 661 -12 679 -7 q 615 -17 643 -17 q 536 12 564 -17 q 500 96 508 41 q 384 6 456 37 q 236 -25 312 -25 q 65 31 130 -25 q 0 194 0 88 q 118 390 0 334 q 328 435 180 420 q 488 483 476 451 q 495 523 495 504 q 442 619 495 584 q 325 654 389 654 q 209 617 257 654 q 152 513 161 580 l 33 513 q 123 705 33 633 q 332 772 207 772 q 528 712 448 772 q 617 531 617 645 l 617 163 q 624 108 617 126 q 664 90 632 90 l 698 94 l 698 0 m 491 262 l 491 372 q 272 329 350 347 q 128 201 128 294 q 166 113 128 144 q 264 83 205 83 q 414 130 346 83 q 491 262 491 183 "},"—":{x_min:0,x_max:941.671875,ha:1039,o:"m 941 334 l 0 334 l 0 410 l 941 410 l 941 334 "},"=":{x_min:8.71875,x_max:780.953125,ha:792,o:"m 780 510 l 8 510 l 8 606 l 780 606 l 780 510 m 780 235 l 8 235 l 8 332 l 780 332 l 780 235 "},N:{x_min:0,x_max:801,ha:914,o:"m 801 0 l 651 0 l 131 823 l 131 0 l 0 0 l 0 1013 l 151 1013 l 670 193 l 670 1013 l 801 1013 l 801 0 "},"ρ":{x_min:0,x_max:712,ha:797,o:"m 712 369 q 620 94 712 207 q 362 -26 521 -26 q 230 2 292 -26 q 119 83 167 30 l 119 -278 l 0 -278 l 0 362 q 91 643 0 531 q 355 764 190 764 q 617 647 517 764 q 712 369 712 536 m 583 366 q 530 559 583 480 q 359 651 469 651 q 190 562 252 651 q 135 370 135 483 q 189 176 135 257 q 359 85 250 85 q 528 175 466 85 q 583 366 583 254 "},"¯":{x_min:0,x_max:941.671875,ha:938,o:"m 941 1033 l 0 1033 l 0 1109 l 941 1109 l 941 1033 "},Z:{x_min:0,x_max:779,ha:849,o:"m 779 0 l 0 0 l 0 113 l 621 896 l 40 896 l 40 1013 l 779 1013 l 778 887 l 171 124 l 779 124 l 779 0 "},u:{x_min:0,x_max:617,ha:729,o:"m 617 0 l 499 0 l 499 110 q 391 10 460 45 q 246 -25 322 -25 q 61 58 127 -25 q 0 258 0 136 l 0 738 l 125 738 l 125 284 q 156 148 125 202 q 273 82 197 82 q 433 165 369 82 q 493 340 493 243 l 493 738 l 617 738 l 617 0 "},k:{x_min:0,x_max:612.484375,ha:697,o:"m 612 738 l 338 465 l 608 0 l 469 0 l 251 382 l 121 251 l 121 0 l 0 0 l 0 1013 l 121 1013 l 121 402 l 456 738 l 612 738 "},"Η":{x_min:0,x_max:803,ha:917,o:"m 803 0 l 667 0 l 667 475 l 140 475 l 140 0 l 0 0 l 0 1013 l 140 1013 l 140 599 l 667 599 l 667 1013 l 803 1013 l 803 0 "},"Α":{x_min:0,x_max:906.953125,ha:985,o:"m 906 0 l 756 0 l 650 303 l 251 303 l 143 0 l 0 0 l 376 1013 l 529 1013 l 906 0 m 609 421 l 452 866 l 293 421 l 609 421 "},s:{x_min:0,x_max:604,ha:697,o:"m 604 217 q 501 36 604 104 q 292 -23 411 -23 q 86 43 166 -23 q 0 238 0 114 l 121 237 q 175 122 121 164 q 300 85 223 85 q 415 112 363 85 q 479 207 479 147 q 361 309 479 276 q 140 372 141 370 q 21 544 21 426 q 111 708 21 647 q 298 761 190 761 q 492 705 413 761 q 583 531 583 643 l 462 531 q 412 625 462 594 q 298 657 363 657 q 199 636 242 657 q 143 558 143 608 q 262 454 143 486 q 484 394 479 397 q 604 217 604 341 "},B:{x_min:0,x_max:778,ha:876,o:"m 580 546 q 724 469 670 535 q 778 311 778 403 q 673 83 778 171 q 432 0 575 0 l 0 0 l 0 1013 l 411 1013 q 629 957 541 1013 q 732 768 732 892 q 691 633 732 693 q 580 546 650 572 m 393 899 l 139 899 l 139 588 l 379 588 q 521 624 462 588 q 592 744 592 667 q 531 859 592 819 q 393 899 471 899 m 419 124 q 566 169 504 124 q 635 303 635 219 q 559 436 635 389 q 402 477 494 477 l 139 477 l 139 124 l 419 124 "},"…":{x_min:0,x_max:614,ha:708,o:"m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 m 378 0 l 236 0 l 236 151 l 378 151 l 378 0 m 614 0 l 472 0 l 472 151 l 614 151 l 614 0 "},"?":{x_min:0,x_max:607,ha:704,o:"m 607 777 q 543 599 607 674 q 422 474 482 537 q 357 272 357 391 l 236 272 q 297 487 236 395 q 411 619 298 490 q 474 762 474 691 q 422 885 474 838 q 301 933 371 933 q 179 880 228 933 q 124 706 124 819 l 0 706 q 94 963 0 872 q 302 1044 177 1044 q 511 973 423 1044 q 607 777 607 895 m 370 0 l 230 0 l 230 151 l 370 151 l 370 0 "},H:{x_min:0,x_max:803,ha:915,o:"m 803 0 l 667 0 l 667 475 l 140 475 l 140 0 l 0 0 l 0 1013 l 140 1013 l 140 599 l 667 599 l 667 1013 l 803 1013 l 803 0 "},"ν":{x_min:0,x_max:675,ha:761,o:"m 675 738 l 404 0 l 272 0 l 0 738 l 133 738 l 340 147 l 541 738 l 675 738 "},c:{x_min:1,x_max:701.390625,ha:775,o:"m 701 264 q 584 53 681 133 q 353 -26 487 -26 q 91 91 188 -26 q 1 370 1 201 q 92 645 1 537 q 353 761 190 761 q 572 688 479 761 q 690 493 666 615 l 556 493 q 487 606 545 562 q 356 650 428 650 q 186 563 246 650 q 134 372 134 487 q 188 179 134 258 q 359 88 250 88 q 492 136 437 88 q 566 264 548 185 l 701 264 "},"¶":{x_min:0,x_max:566.671875,ha:678,o:"m 21 892 l 52 892 l 98 761 l 145 892 l 176 892 l 178 741 l 157 741 l 157 867 l 108 741 l 88 741 l 40 871 l 40 741 l 21 741 l 21 892 m 308 854 l 308 731 q 252 691 308 691 q 227 691 240 691 q 207 696 213 695 l 207 712 l 253 706 q 288 733 288 706 l 288 763 q 244 741 279 741 q 193 797 193 741 q 261 860 193 860 q 287 860 273 860 q 308 854 302 855 m 288 842 l 263 843 q 213 796 213 843 q 248 756 213 756 q 288 796 288 756 l 288 842 m 566 988 l 502 988 l 502 -1 l 439 -1 l 439 988 l 317 988 l 317 -1 l 252 -1 l 252 602 q 81 653 155 602 q 0 805 0 711 q 101 989 0 918 q 309 1053 194 1053 l 566 1053 l 566 988 "},"β":{x_min:0,x_max:660,ha:745,o:"m 471 550 q 610 450 561 522 q 660 280 660 378 q 578 64 660 151 q 367 -22 497 -22 q 239 5 299 -22 q 126 82 178 32 l 126 -278 l 0 -278 l 0 593 q 54 903 0 801 q 318 1042 127 1042 q 519 964 436 1042 q 603 771 603 887 q 567 644 603 701 q 471 550 532 586 m 337 79 q 476 138 418 79 q 535 279 535 198 q 427 437 535 386 q 226 477 344 477 l 226 583 q 398 620 329 583 q 486 762 486 668 q 435 884 486 833 q 312 935 384 935 q 169 861 219 935 q 126 698 126 797 l 126 362 q 170 169 126 242 q 337 79 224 79 "},"Μ":{x_min:0,x_max:954,ha:1068,o:"m 954 0 l 819 0 l 819 868 l 537 0 l 405 0 l 128 865 l 128 0 l 0 0 l 0 1013 l 199 1013 l 472 158 l 758 1013 l 954 1013 l 954 0 "},"Ό":{x_min:.109375,x_max:1120,ha:1217,o:"m 1120 505 q 994 132 1120 282 q 642 -29 861 -29 q 290 130 422 -29 q 167 505 167 280 q 294 883 167 730 q 650 1046 430 1046 q 999 882 868 1046 q 1120 505 1120 730 m 977 504 q 896 784 977 669 q 644 915 804 915 q 391 785 484 915 q 307 504 307 669 q 391 224 307 339 q 644 95 486 95 q 894 224 803 95 q 977 504 977 339 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"Ή":{x_min:0,x_max:1158,ha:1275,o:"m 1158 0 l 1022 0 l 1022 475 l 496 475 l 496 0 l 356 0 l 356 1012 l 496 1012 l 496 599 l 1022 599 l 1022 1012 l 1158 1012 l 1158 0 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"•":{x_min:0,x_max:663.890625,ha:775,o:"m 663 529 q 566 293 663 391 q 331 196 469 196 q 97 294 194 196 q 0 529 0 393 q 96 763 0 665 q 331 861 193 861 q 566 763 469 861 q 663 529 663 665 "},"¥":{x_min:.1875,x_max:819.546875,ha:886,o:"m 563 561 l 697 561 l 696 487 l 520 487 l 482 416 l 482 380 l 697 380 l 695 308 l 482 308 l 482 0 l 342 0 l 342 308 l 125 308 l 125 380 l 342 380 l 342 417 l 303 487 l 125 487 l 125 561 l 258 561 l 0 1013 l 140 1013 l 411 533 l 679 1013 l 819 1013 l 563 561 "},"(":{x_min:0,x_max:318.0625,ha:415,o:"m 318 -290 l 230 -290 q 61 23 122 -142 q 0 365 0 190 q 62 712 0 540 q 230 1024 119 869 l 318 1024 q 175 705 219 853 q 125 360 125 542 q 176 22 125 187 q 318 -290 223 -127 "},U:{x_min:0,x_max:796,ha:904,o:"m 796 393 q 681 93 796 212 q 386 -25 566 -25 q 101 95 208 -25 q 0 393 0 211 l 0 1013 l 138 1013 l 138 391 q 204 191 138 270 q 394 107 276 107 q 586 191 512 107 q 656 391 656 270 l 656 1013 l 796 1013 l 796 393 "},"γ":{x_min:.5,x_max:744.953125,ha:822,o:"m 744 737 l 463 54 l 463 -278 l 338 -278 l 338 54 l 154 495 q 104 597 124 569 q 13 651 67 651 l 0 651 l 0 751 l 39 753 q 168 711 121 753 q 242 594 207 676 l 403 208 l 617 737 l 744 737 "},"α":{x_min:0,x_max:765.5625,ha:809,o:"m 765 -4 q 698 -14 726 -14 q 564 97 586 -14 q 466 7 525 40 q 337 -26 407 -26 q 88 98 186 -26 q 0 369 0 212 q 88 637 0 525 q 337 760 184 760 q 465 728 407 760 q 563 637 524 696 l 563 739 l 685 739 l 685 222 q 693 141 685 168 q 748 94 708 94 q 765 96 760 94 l 765 -4 m 584 371 q 531 562 584 485 q 360 653 470 653 q 192 566 254 653 q 135 379 135 489 q 186 181 135 261 q 358 84 247 84 q 528 176 465 84 q 584 371 584 260 "},F:{x_min:0,x_max:683.328125,ha:717,o:"m 683 888 l 140 888 l 140 583 l 613 583 l 613 458 l 140 458 l 140 0 l 0 0 l 0 1013 l 683 1013 l 683 888 "},"":{x_min:0,x_max:705.5625,ha:803,o:"m 705 334 l 0 334 l 0 410 l 705 410 l 705 334 "},":":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 "},"Χ":{x_min:0,x_max:854.171875,ha:935,o:"m 854 0 l 683 0 l 423 409 l 166 0 l 0 0 l 347 519 l 18 1013 l 186 1013 l 427 637 l 675 1013 l 836 1013 l 504 521 l 854 0 "},"*":{x_min:116,x_max:674,ha:792,o:"m 674 768 l 475 713 l 610 544 l 517 477 l 394 652 l 272 478 l 178 544 l 314 713 l 116 766 l 153 876 l 341 812 l 342 1013 l 446 1013 l 446 811 l 635 874 l 674 768 "},"†":{x_min:0,x_max:777,ha:835,o:"m 458 804 l 777 804 l 777 683 l 458 683 l 458 0 l 319 0 l 319 681 l 0 683 l 0 804 l 319 804 l 319 1015 l 458 1013 l 458 804 "},"°":{x_min:0,x_max:347,ha:444,o:"m 173 802 q 43 856 91 802 q 0 977 0 905 q 45 1101 0 1049 q 173 1153 90 1153 q 303 1098 255 1153 q 347 977 347 1049 q 303 856 347 905 q 173 802 256 802 m 173 884 q 238 910 214 884 q 262 973 262 937 q 239 1038 262 1012 q 173 1064 217 1064 q 108 1037 132 1064 q 85 973 85 1010 q 108 910 85 937 q 173 884 132 884 "},V:{x_min:0,x_max:862.71875,ha:940,o:"m 862 1013 l 505 0 l 361 0 l 0 1013 l 143 1013 l 434 165 l 718 1012 l 862 1013 "},"Ξ":{x_min:0,x_max:734.71875,ha:763,o:"m 723 889 l 9 889 l 9 1013 l 723 1013 l 723 889 m 673 463 l 61 463 l 61 589 l 673 589 l 673 463 m 734 0 l 0 0 l 0 124 l 734 124 l 734 0 "}," ":{x_min:0,x_max:0,ha:853},"Ϋ":{x_min:.328125,x_max:819.515625,ha:889,o:"m 588 1046 l 460 1046 l 460 1189 l 588 1189 l 588 1046 m 360 1046 l 232 1046 l 232 1189 l 360 1189 l 360 1046 m 819 1012 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1012 l 140 1012 l 411 533 l 679 1012 l 819 1012 "},"”":{x_min:0,x_max:347,ha:454,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 m 347 851 q 310 737 347 784 q 208 669 273 690 l 208 734 q 267 787 250 741 q 280 873 280 821 l 208 873 l 208 1013 l 347 1013 l 347 851 "},"@":{x_min:0,x_max:1260,ha:1357,o:"m 1098 -45 q 877 -160 1001 -117 q 633 -203 752 -203 q 155 -29 327 -203 q 0 360 0 127 q 176 802 0 616 q 687 1008 372 1008 q 1123 854 969 1008 q 1260 517 1260 718 q 1155 216 1260 341 q 868 82 1044 82 q 772 106 801 82 q 737 202 737 135 q 647 113 700 144 q 527 82 594 82 q 367 147 420 82 q 314 312 314 212 q 401 565 314 452 q 639 690 498 690 q 810 588 760 690 l 849 668 l 938 668 q 877 441 900 532 q 833 226 833 268 q 853 182 833 198 q 902 167 873 167 q 1088 272 1012 167 q 1159 512 1159 372 q 1051 793 1159 681 q 687 925 925 925 q 248 747 415 925 q 97 361 97 586 q 226 26 97 159 q 627 -122 370 -122 q 856 -87 737 -122 q 1061 8 976 -53 l 1098 -45 m 786 488 q 738 580 777 545 q 643 615 700 615 q 483 517 548 615 q 425 322 425 430 q 457 203 425 250 q 552 156 490 156 q 722 273 665 156 q 786 488 738 309 "},"Ί":{x_min:0,x_max:499,ha:613,o:"m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 m 499 0 l 360 0 l 360 1012 l 499 1012 l 499 0 "},i:{x_min:14,x_max:136,ha:275,o:"m 136 873 l 14 873 l 14 1013 l 136 1013 l 136 873 m 136 0 l 14 0 l 14 737 l 136 737 l 136 0 "},"Β":{x_min:0,x_max:778,ha:877,o:"m 580 545 q 724 468 671 534 q 778 310 778 402 q 673 83 778 170 q 432 0 575 0 l 0 0 l 0 1013 l 411 1013 q 629 957 541 1013 q 732 768 732 891 q 691 632 732 692 q 580 545 650 571 m 393 899 l 139 899 l 139 587 l 379 587 q 521 623 462 587 q 592 744 592 666 q 531 859 592 819 q 393 899 471 899 m 419 124 q 566 169 504 124 q 635 302 635 219 q 559 435 635 388 q 402 476 494 476 l 139 476 l 139 124 l 419 124 "},"υ":{x_min:0,x_max:617,ha:725,o:"m 617 352 q 540 94 617 199 q 308 -24 455 -24 q 76 94 161 -24 q 0 352 0 199 l 0 739 l 126 739 l 126 355 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 355 492 257 l 492 739 l 617 739 l 617 352 "},"]":{x_min:0,x_max:275,ha:372,o:"m 275 -281 l 0 -281 l 0 -187 l 151 -187 l 151 920 l 0 920 l 0 1013 l 275 1013 l 275 -281 "},m:{x_min:0,x_max:1019,ha:1128,o:"m 1019 0 l 897 0 l 897 454 q 860 591 897 536 q 739 660 816 660 q 613 586 659 660 q 573 436 573 522 l 573 0 l 447 0 l 447 455 q 412 591 447 535 q 294 657 372 657 q 165 586 213 657 q 122 437 122 521 l 122 0 l 0 0 l 0 738 l 117 738 l 117 640 q 202 730 150 697 q 316 763 254 763 q 437 730 381 763 q 525 642 494 697 q 621 731 559 700 q 753 763 682 763 q 943 694 867 763 q 1019 512 1019 625 l 1019 0 "},"χ":{x_min:8.328125,x_max:780.5625,ha:815,o:"m 780 -278 q 715 -294 747 -294 q 616 -257 663 -294 q 548 -175 576 -227 l 379 133 l 143 -277 l 9 -277 l 313 254 l 163 522 q 127 586 131 580 q 36 640 91 640 q 8 637 27 640 l 8 752 l 52 757 q 162 719 113 757 q 236 627 200 690 l 383 372 l 594 737 l 726 737 l 448 250 l 625 -69 q 670 -153 647 -110 q 743 -188 695 -188 q 780 -184 759 -188 l 780 -278 "},"ί":{x_min:42,x_max:326.71875,ha:361,o:"m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 737 l 167 737 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 102 239 101 q 284 112 257 104 l 284 3 m 326 1040 l 137 819 l 54 819 l 189 1040 l 326 1040 "},"Ζ":{x_min:0,x_max:779.171875,ha:850,o:"m 779 0 l 0 0 l 0 113 l 620 896 l 40 896 l 40 1013 l 779 1013 l 779 887 l 170 124 l 779 124 l 779 0 "},R:{x_min:0,x_max:781.953125,ha:907,o:"m 781 0 l 623 0 q 587 242 590 52 q 407 433 585 433 l 138 433 l 138 0 l 0 0 l 0 1013 l 396 1013 q 636 946 539 1013 q 749 731 749 868 q 711 597 749 659 q 608 502 674 534 q 718 370 696 474 q 729 207 722 352 q 781 26 736 62 l 781 0 m 373 551 q 533 594 465 551 q 614 731 614 645 q 532 859 614 815 q 373 896 465 896 l 138 896 l 138 551 l 373 551 "},o:{x_min:0,x_max:713,ha:821,o:"m 357 -25 q 94 91 194 -25 q 0 368 0 202 q 93 642 0 533 q 357 761 193 761 q 618 644 518 761 q 713 368 713 533 q 619 91 713 201 q 357 -25 521 -25 m 357 85 q 528 175 465 85 q 584 369 584 255 q 529 562 584 484 q 357 651 467 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 357 85 250 85 "},K:{x_min:0,x_max:819.46875,ha:906,o:"m 819 0 l 649 0 l 294 509 l 139 355 l 139 0 l 0 0 l 0 1013 l 139 1013 l 139 526 l 626 1013 l 809 1013 l 395 600 l 819 0 "},",":{x_min:0,x_max:142,ha:239,o:"m 142 -12 q 105 -132 142 -82 q 0 -205 68 -182 l 0 -138 q 57 -82 40 -124 q 70 0 70 -51 l 0 0 l 0 151 l 142 151 l 142 -12 "},d:{x_min:0,x_max:683,ha:796,o:"m 683 0 l 564 0 l 564 93 q 456 6 516 38 q 327 -25 395 -25 q 87 100 181 -25 q 0 365 0 215 q 90 639 0 525 q 343 763 187 763 q 564 647 486 763 l 564 1013 l 683 1013 l 683 0 m 582 373 q 529 562 582 484 q 361 653 468 653 q 190 561 253 653 q 135 365 135 479 q 189 175 135 254 q 358 85 251 85 q 529 178 468 85 q 582 373 582 258 "},"¨":{x_min:-109,x_max:247,ha:232,o:"m 247 1046 l 119 1046 l 119 1189 l 247 1189 l 247 1046 m 19 1046 l -109 1046 l -109 1189 l 19 1189 l 19 1046 "},E:{x_min:0,x_max:736.109375,ha:789,o:"m 736 0 l 0 0 l 0 1013 l 725 1013 l 725 889 l 139 889 l 139 585 l 677 585 l 677 467 l 139 467 l 139 125 l 736 125 l 736 0 "},Y:{x_min:0,x_max:820,ha:886,o:"m 820 1013 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1013 l 140 1013 l 411 534 l 679 1012 l 820 1013 "},'"':{x_min:0,x_max:299,ha:396,o:"m 299 606 l 203 606 l 203 988 l 299 988 l 299 606 m 96 606 l 0 606 l 0 988 l 96 988 l 96 606 "},"‹":{x_min:17.984375,x_max:773.609375,ha:792,o:"m 773 40 l 18 376 l 17 465 l 773 799 l 773 692 l 159 420 l 773 149 l 773 40 "},"„":{x_min:0,x_max:364,ha:467,o:"m 141 -12 q 104 -132 141 -82 q 0 -205 67 -182 l 0 -138 q 56 -82 40 -124 q 69 0 69 -51 l 0 0 l 0 151 l 141 151 l 141 -12 m 364 -12 q 327 -132 364 -82 q 222 -205 290 -182 l 222 -138 q 279 -82 262 -124 q 292 0 292 -51 l 222 0 l 222 151 l 364 151 l 364 -12 "},"δ":{x_min:1,x_max:710,ha:810,o:"m 710 360 q 616 87 710 196 q 356 -28 518 -28 q 99 82 197 -28 q 1 356 1 192 q 100 606 1 509 q 355 703 199 703 q 180 829 288 754 q 70 903 124 866 l 70 1012 l 643 1012 l 643 901 l 258 901 q 462 763 422 794 q 636 592 577 677 q 710 360 710 485 m 584 365 q 552 501 584 447 q 451 602 521 555 q 372 611 411 611 q 197 541 258 611 q 136 355 136 472 q 190 171 136 245 q 358 85 252 85 q 528 173 465 85 q 584 365 584 252 "},"έ":{x_min:0,x_max:634.71875,ha:714,o:"m 634 234 q 527 38 634 110 q 300 -25 433 -25 q 98 29 183 -25 q 0 204 0 93 q 37 313 0 265 q 128 390 67 352 q 56 459 82 419 q 26 555 26 505 q 114 712 26 654 q 295 763 191 763 q 499 700 416 763 q 589 515 589 631 l 478 515 q 419 618 464 580 q 307 657 374 657 q 207 630 253 657 q 151 547 151 598 q 238 445 151 469 q 389 434 280 434 l 389 331 l 349 331 q 206 315 255 331 q 125 210 125 287 q 183 107 125 145 q 302 76 233 76 q 436 117 379 76 q 509 234 493 159 l 634 234 m 520 1040 l 331 819 l 248 819 l 383 1040 l 520 1040 "},"ω":{x_min:0,x_max:922,ha:1031,o:"m 922 339 q 856 97 922 203 q 650 -26 780 -26 q 538 9 587 -26 q 461 103 489 44 q 387 12 436 46 q 277 -22 339 -22 q 69 97 147 -22 q 0 339 0 203 q 45 551 0 444 q 161 738 84 643 l 302 738 q 175 553 219 647 q 124 336 124 446 q 155 179 124 249 q 275 88 197 88 q 375 163 341 88 q 400 294 400 219 l 400 572 l 524 572 l 524 294 q 561 135 524 192 q 643 88 591 88 q 762 182 719 88 q 797 342 797 257 q 745 556 797 450 q 619 738 705 638 l 760 738 q 874 551 835 640 q 922 339 922 444 "},"´":{x_min:0,x_max:96,ha:251,o:"m 96 606 l 0 606 l 0 988 l 96 988 l 96 606 "},"±":{x_min:11,x_max:781,ha:792,o:"m 781 490 l 446 490 l 446 255 l 349 255 l 349 490 l 11 490 l 11 586 l 349 586 l 349 819 l 446 819 l 446 586 l 781 586 l 781 490 m 781 21 l 11 21 l 11 115 l 781 115 l 781 21 "},"|":{x_min:343,x_max:449,ha:792,o:"m 449 462 l 343 462 l 343 986 l 449 986 l 449 462 m 449 -242 l 343 -242 l 343 280 l 449 280 l 449 -242 "},"ϋ":{x_min:0,x_max:617,ha:725,o:"m 482 800 l 372 800 l 372 925 l 482 925 l 482 800 m 239 800 l 129 800 l 129 925 l 239 925 l 239 800 m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 "},"§":{x_min:0,x_max:593,ha:690,o:"m 593 425 q 554 312 593 369 q 467 233 516 254 q 537 83 537 172 q 459 -74 537 -12 q 288 -133 387 -133 q 115 -69 184 -133 q 47 96 47 -6 l 166 96 q 199 7 166 40 q 288 -26 232 -26 q 371 -5 332 -26 q 420 60 420 21 q 311 201 420 139 q 108 309 210 255 q 0 490 0 383 q 33 602 0 551 q 124 687 66 654 q 75 743 93 712 q 58 812 58 773 q 133 984 58 920 q 300 1043 201 1043 q 458 987 394 1043 q 529 814 529 925 l 411 814 q 370 908 404 877 q 289 939 336 939 q 213 911 246 939 q 180 841 180 883 q 286 720 180 779 q 484 612 480 615 q 593 425 593 534 m 467 409 q 355 544 467 473 q 196 630 228 612 q 146 587 162 609 q 124 525 124 558 q 239 387 124 462 q 398 298 369 315 q 448 345 429 316 q 467 409 467 375 "},b:{x_min:0,x_max:685,ha:783,o:"m 685 372 q 597 99 685 213 q 347 -25 501 -25 q 219 5 277 -25 q 121 93 161 36 l 121 0 l 0 0 l 0 1013 l 121 1013 l 121 634 q 214 723 157 692 q 341 754 272 754 q 591 637 493 754 q 685 372 685 526 m 554 356 q 499 550 554 470 q 328 644 437 644 q 162 556 223 644 q 108 369 108 478 q 160 176 108 256 q 330 83 221 83 q 498 169 435 83 q 554 356 554 245 "},q:{x_min:0,x_max:683,ha:876,o:"m 683 -278 l 564 -278 l 564 97 q 474 8 533 39 q 345 -23 415 -23 q 91 93 188 -23 q 0 364 0 203 q 87 635 0 522 q 337 760 184 760 q 466 727 408 760 q 564 637 523 695 l 564 737 l 683 737 l 683 -278 m 582 375 q 527 564 582 488 q 358 652 466 652 q 190 565 253 652 q 135 377 135 488 q 189 179 135 261 q 361 84 251 84 q 530 179 469 84 q 582 375 582 260 "},"Ω":{x_min:-.171875,x_max:969.5625,ha:1068,o:"m 969 0 l 555 0 l 555 123 q 744 308 675 194 q 814 558 814 423 q 726 812 814 709 q 484 922 633 922 q 244 820 334 922 q 154 567 154 719 q 223 316 154 433 q 412 123 292 199 l 412 0 l 0 0 l 0 124 l 217 124 q 68 327 122 210 q 15 572 15 444 q 144 911 15 781 q 484 1041 274 1041 q 822 909 691 1041 q 953 569 953 777 q 899 326 953 443 q 750 124 846 210 l 969 124 l 969 0 "},"ύ":{x_min:0,x_max:617,ha:725,o:"m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 m 535 1040 l 346 819 l 262 819 l 397 1040 l 535 1040 "},z:{x_min:-.015625,x_max:613.890625,ha:697,o:"m 613 0 l 0 0 l 0 100 l 433 630 l 20 630 l 20 738 l 594 738 l 593 636 l 163 110 l 613 110 l 613 0 "},"™":{x_min:0,x_max:894,ha:1e3,o:"m 389 951 l 229 951 l 229 503 l 160 503 l 160 951 l 0 951 l 0 1011 l 389 1011 l 389 951 m 894 503 l 827 503 l 827 939 l 685 503 l 620 503 l 481 937 l 481 503 l 417 503 l 417 1011 l 517 1011 l 653 580 l 796 1010 l 894 1011 l 894 503 "},"ή":{x_min:.78125,x_max:697,ha:810,o:"m 697 -278 l 572 -278 l 572 454 q 540 587 572 536 q 425 650 501 650 q 271 579 337 650 q 206 420 206 509 l 206 0 l 81 0 l 81 489 q 73 588 81 562 q 0 644 56 644 l 0 741 q 68 755 38 755 q 158 721 124 755 q 200 630 193 687 q 297 726 234 692 q 434 761 359 761 q 620 692 544 761 q 697 516 697 624 l 697 -278 m 479 1040 l 290 819 l 207 819 l 341 1040 l 479 1040 "},"Θ":{x_min:0,x_max:960,ha:1056,o:"m 960 507 q 833 129 960 280 q 476 -32 698 -32 q 123 129 255 -32 q 0 507 0 280 q 123 883 0 732 q 476 1045 255 1045 q 832 883 696 1045 q 960 507 960 732 m 817 500 q 733 789 817 669 q 476 924 639 924 q 223 792 317 924 q 142 507 142 675 q 222 222 142 339 q 476 89 315 89 q 730 218 636 89 q 817 500 817 334 m 716 449 l 243 449 l 243 571 l 716 571 l 716 449 "},"®":{x_min:-3,x_max:1008,ha:1106,o:"m 503 532 q 614 562 566 532 q 672 658 672 598 q 614 747 672 716 q 503 772 569 772 l 338 772 l 338 532 l 503 532 m 502 -7 q 123 151 263 -7 q -3 501 -3 294 q 123 851 -3 706 q 502 1011 263 1011 q 881 851 739 1011 q 1008 501 1008 708 q 883 151 1008 292 q 502 -7 744 -7 m 502 60 q 830 197 709 60 q 940 501 940 322 q 831 805 940 681 q 502 944 709 944 q 174 805 296 944 q 65 501 65 680 q 173 197 65 320 q 502 60 294 60 m 788 146 l 678 146 q 653 316 655 183 q 527 449 652 449 l 338 449 l 338 146 l 241 146 l 241 854 l 518 854 q 688 808 621 854 q 766 658 766 755 q 739 563 766 607 q 668 497 713 519 q 751 331 747 472 q 788 164 756 190 l 788 146 "},"~":{x_min:0,x_max:833,ha:931,o:"m 833 958 q 778 753 833 831 q 594 665 716 665 q 402 761 502 665 q 240 857 302 857 q 131 795 166 857 q 104 665 104 745 l 0 665 q 54 867 0 789 q 237 958 116 958 q 429 861 331 958 q 594 765 527 765 q 704 827 670 765 q 729 958 729 874 l 833 958 "},"Ε":{x_min:0,x_max:736.21875,ha:778,o:"m 736 0 l 0 0 l 0 1013 l 725 1013 l 725 889 l 139 889 l 139 585 l 677 585 l 677 467 l 139 467 l 139 125 l 736 125 l 736 0 "},"³":{x_min:0,x_max:450,ha:547,o:"m 450 552 q 379 413 450 464 q 220 366 313 366 q 69 414 130 366 q 0 567 0 470 l 85 567 q 126 470 85 504 q 225 437 168 437 q 320 467 280 437 q 360 552 360 498 q 318 632 360 608 q 213 657 276 657 q 195 657 203 657 q 176 657 181 657 l 176 722 q 279 733 249 722 q 334 815 334 752 q 300 881 334 856 q 220 907 267 907 q 133 875 169 907 q 97 781 97 844 l 15 781 q 78 926 15 875 q 220 972 135 972 q 364 930 303 972 q 426 817 426 888 q 344 697 426 733 q 421 642 392 681 q 450 552 450 603 "},"[":{x_min:0,x_max:273.609375,ha:371,o:"m 273 -281 l 0 -281 l 0 1013 l 273 1013 l 273 920 l 124 920 l 124 -187 l 273 -187 l 273 -281 "},L:{x_min:0,x_max:645.828125,ha:696,o:"m 645 0 l 0 0 l 0 1013 l 140 1013 l 140 126 l 645 126 l 645 0 "},"σ":{x_min:0,x_max:803.390625,ha:894,o:"m 803 628 l 633 628 q 713 368 713 512 q 618 93 713 204 q 357 -25 518 -25 q 94 91 194 -25 q 0 368 0 201 q 94 644 0 533 q 356 761 194 761 q 481 750 398 761 q 608 739 564 739 l 803 739 l 803 628 m 360 85 q 529 180 467 85 q 584 374 584 262 q 527 566 584 490 q 352 651 463 651 q 187 559 247 651 q 135 368 135 478 q 189 175 135 254 q 360 85 251 85 "},"ζ":{x_min:0,x_max:573,ha:642,o:"m 573 -40 q 553 -162 573 -97 q 510 -278 543 -193 l 400 -278 q 441 -187 428 -219 q 462 -90 462 -132 q 378 -14 462 -14 q 108 45 197 -14 q 0 290 0 117 q 108 631 0 462 q 353 901 194 767 l 55 901 l 55 1012 l 561 1012 l 561 924 q 261 669 382 831 q 128 301 128 489 q 243 117 128 149 q 458 98 350 108 q 573 -40 573 80 "},"θ":{x_min:0,x_max:674,ha:778,o:"m 674 496 q 601 160 674 304 q 336 -26 508 -26 q 73 153 165 -26 q 0 485 0 296 q 72 840 0 683 q 343 1045 166 1045 q 605 844 516 1045 q 674 496 674 692 m 546 579 q 498 798 546 691 q 336 935 437 935 q 178 798 237 935 q 126 579 137 701 l 546 579 m 546 475 l 126 475 q 170 233 126 348 q 338 80 230 80 q 504 233 447 80 q 546 475 546 346 "},"Ο":{x_min:0,x_max:958,ha:1054,o:"m 485 1042 q 834 883 703 1042 q 958 511 958 735 q 834 136 958 287 q 481 -26 701 -26 q 126 130 261 -26 q 0 504 0 279 q 127 880 0 729 q 485 1042 263 1042 m 480 98 q 731 225 638 98 q 815 504 815 340 q 733 783 815 670 q 480 913 640 913 q 226 785 321 913 q 142 504 142 671 q 226 224 142 339 q 480 98 319 98 "},"Γ":{x_min:0,x_max:705.28125,ha:749,o:"m 705 886 l 140 886 l 140 0 l 0 0 l 0 1012 l 705 1012 l 705 886 "}," ":{x_min:0,x_max:0,ha:375},"%":{x_min:-3,x_max:1089,ha:1186,o:"m 845 0 q 663 76 731 0 q 602 244 602 145 q 661 412 602 344 q 845 489 728 489 q 1027 412 959 489 q 1089 244 1089 343 q 1029 76 1089 144 q 845 0 962 0 m 844 103 q 945 143 909 103 q 981 243 981 184 q 947 340 981 301 q 844 385 909 385 q 744 342 781 385 q 708 243 708 300 q 741 147 708 186 q 844 103 780 103 m 888 986 l 284 -25 l 199 -25 l 803 986 l 888 986 m 241 468 q 58 545 126 468 q -3 715 -3 615 q 56 881 -3 813 q 238 958 124 958 q 421 881 353 958 q 483 712 483 813 q 423 544 483 612 q 241 468 356 468 m 241 855 q 137 811 175 855 q 100 710 100 768 q 136 612 100 653 q 240 572 172 572 q 344 614 306 572 q 382 713 382 656 q 347 810 382 771 q 241 855 308 855 "},P:{x_min:0,x_max:726,ha:806,o:"m 424 1013 q 640 931 555 1013 q 726 719 726 850 q 637 506 726 587 q 413 426 548 426 l 140 426 l 140 0 l 0 0 l 0 1013 l 424 1013 m 379 889 l 140 889 l 140 548 l 372 548 q 522 589 459 548 q 593 720 593 637 q 528 845 593 801 q 379 889 463 889 "},"Έ":{x_min:0,x_max:1078.21875,ha:1118,o:"m 1078 0 l 342 0 l 342 1013 l 1067 1013 l 1067 889 l 481 889 l 481 585 l 1019 585 l 1019 467 l 481 467 l 481 125 l 1078 125 l 1078 0 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"Ώ":{x_min:.125,x_max:1136.546875,ha:1235,o:"m 1136 0 l 722 0 l 722 123 q 911 309 842 194 q 981 558 981 423 q 893 813 981 710 q 651 923 800 923 q 411 821 501 923 q 321 568 321 720 q 390 316 321 433 q 579 123 459 200 l 579 0 l 166 0 l 166 124 l 384 124 q 235 327 289 210 q 182 572 182 444 q 311 912 182 782 q 651 1042 441 1042 q 989 910 858 1042 q 1120 569 1120 778 q 1066 326 1120 443 q 917 124 1013 210 l 1136 124 l 1136 0 m 277 1040 l 83 800 l 0 800 l 140 1041 l 277 1040 "},_:{x_min:0,x_max:705.5625,ha:803,o:"m 705 -334 l 0 -334 l 0 -234 l 705 -234 l 705 -334 "},"Ϊ":{x_min:-110,x_max:246,ha:275,o:"m 246 1046 l 118 1046 l 118 1189 l 246 1189 l 246 1046 m 18 1046 l -110 1046 l -110 1189 l 18 1189 l 18 1046 m 136 0 l 0 0 l 0 1012 l 136 1012 l 136 0 "},"+":{x_min:23,x_max:768,ha:792,o:"m 768 372 l 444 372 l 444 0 l 347 0 l 347 372 l 23 372 l 23 468 l 347 468 l 347 840 l 444 840 l 444 468 l 768 468 l 768 372 "},"½":{x_min:0,x_max:1050,ha:1149,o:"m 1050 0 l 625 0 q 712 178 625 108 q 878 277 722 187 q 967 385 967 328 q 932 456 967 429 q 850 484 897 484 q 759 450 798 484 q 721 352 721 416 l 640 352 q 706 502 640 448 q 851 551 766 551 q 987 509 931 551 q 1050 385 1050 462 q 976 251 1050 301 q 829 179 902 215 q 717 68 740 133 l 1050 68 l 1050 0 m 834 985 l 215 -28 l 130 -28 l 750 984 l 834 985 m 224 422 l 142 422 l 142 811 l 0 811 l 0 867 q 104 889 62 867 q 164 973 157 916 l 224 973 l 224 422 "},"Ρ":{x_min:0,x_max:720,ha:783,o:"m 424 1013 q 637 933 554 1013 q 720 723 720 853 q 633 508 720 591 q 413 426 546 426 l 140 426 l 140 0 l 0 0 l 0 1013 l 424 1013 m 378 889 l 140 889 l 140 548 l 371 548 q 521 589 458 548 q 592 720 592 637 q 527 845 592 801 q 378 889 463 889 "},"'":{x_min:0,x_max:139,ha:236,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 "},"ª":{x_min:0,x_max:350,ha:397,o:"m 350 625 q 307 616 328 616 q 266 631 281 616 q 247 673 251 645 q 190 628 225 644 q 116 613 156 613 q 32 641 64 613 q 0 722 0 669 q 72 826 0 800 q 247 866 159 846 l 247 887 q 220 934 247 916 q 162 953 194 953 q 104 934 129 953 q 76 882 80 915 l 16 882 q 60 976 16 941 q 166 1011 104 1011 q 266 979 224 1011 q 308 891 308 948 l 308 706 q 311 679 308 688 q 331 670 315 670 l 350 672 l 350 625 m 247 757 l 247 811 q 136 790 175 798 q 64 726 64 773 q 83 682 64 697 q 132 667 103 667 q 207 690 174 667 q 247 757 247 718 "},"΅":{x_min:0,x_max:450,ha:553,o:"m 450 800 l 340 800 l 340 925 l 450 925 l 450 800 m 406 1040 l 212 800 l 129 800 l 269 1040 l 406 1040 m 110 800 l 0 800 l 0 925 l 110 925 l 110 800 "},T:{x_min:0,x_max:777,ha:835,o:"m 777 894 l 458 894 l 458 0 l 319 0 l 319 894 l 0 894 l 0 1013 l 777 1013 l 777 894 "},"Φ":{x_min:0,x_max:915,ha:997,o:"m 527 0 l 389 0 l 389 122 q 110 231 220 122 q 0 509 0 340 q 110 785 0 677 q 389 893 220 893 l 389 1013 l 527 1013 l 527 893 q 804 786 693 893 q 915 509 915 679 q 805 231 915 341 q 527 122 696 122 l 527 0 m 527 226 q 712 310 641 226 q 779 507 779 389 q 712 705 779 627 q 527 787 641 787 l 527 226 m 389 226 l 389 787 q 205 698 275 775 q 136 505 136 620 q 206 308 136 391 q 389 226 276 226 "},"⁋":{x_min:0,x_max:0,ha:694},j:{x_min:-77.78125,x_max:167,ha:349,o:"m 167 871 l 42 871 l 42 1013 l 167 1013 l 167 871 m 167 -80 q 121 -231 167 -184 q -26 -278 76 -278 l -77 -278 l -77 -164 l -41 -164 q 26 -143 11 -164 q 42 -65 42 -122 l 42 737 l 167 737 l 167 -80 "},"Σ":{x_min:0,x_max:756.953125,ha:819,o:"m 756 0 l 0 0 l 0 107 l 395 523 l 22 904 l 22 1013 l 745 1013 l 745 889 l 209 889 l 566 523 l 187 125 l 756 125 l 756 0 "},"›":{x_min:18.0625,x_max:774,ha:792,o:"m 774 376 l 18 40 l 18 149 l 631 421 l 18 692 l 18 799 l 774 465 l 774 376 "},"<":{x_min:17.984375,x_max:773.609375,ha:792,o:"m 773 40 l 18 376 l 17 465 l 773 799 l 773 692 l 159 420 l 773 149 l 773 40 "},"£":{x_min:0,x_max:704.484375,ha:801,o:"m 704 41 q 623 -10 664 5 q 543 -26 583 -26 q 359 15 501 -26 q 243 36 288 36 q 158 23 197 36 q 73 -21 119 10 l 6 76 q 125 195 90 150 q 175 331 175 262 q 147 443 175 383 l 0 443 l 0 512 l 108 512 q 43 734 43 623 q 120 929 43 854 q 358 1010 204 1010 q 579 936 487 1010 q 678 729 678 857 l 678 684 l 552 684 q 504 838 552 780 q 362 896 457 896 q 216 852 263 896 q 176 747 176 815 q 199 627 176 697 q 248 512 217 574 l 468 512 l 468 443 l 279 443 q 297 356 297 398 q 230 194 297 279 q 153 107 211 170 q 227 133 190 125 q 293 142 264 142 q 410 119 339 142 q 516 96 482 96 q 579 105 550 96 q 648 142 608 115 l 704 41 "},t:{x_min:0,x_max:367,ha:458,o:"m 367 0 q 312 -5 339 -2 q 262 -8 284 -8 q 145 28 183 -8 q 108 143 108 64 l 108 638 l 0 638 l 0 738 l 108 738 l 108 944 l 232 944 l 232 738 l 367 738 l 367 638 l 232 638 l 232 185 q 248 121 232 140 q 307 102 264 102 q 345 104 330 102 q 367 107 360 107 l 367 0 "},"¬":{x_min:0,x_max:706,ha:803,o:"m 706 411 l 706 158 l 630 158 l 630 335 l 0 335 l 0 411 l 706 411 "},"λ":{x_min:0,x_max:750,ha:803,o:"m 750 -7 q 679 -15 716 -15 q 538 59 591 -15 q 466 214 512 97 l 336 551 l 126 0 l 0 0 l 270 705 q 223 837 247 770 q 116 899 190 899 q 90 898 100 899 l 90 1004 q 152 1011 125 1011 q 298 938 244 1011 q 373 783 326 901 l 605 192 q 649 115 629 136 q 716 95 669 95 l 736 95 q 750 97 745 97 l 750 -7 "},W:{x_min:0,x_max:1263.890625,ha:1351,o:"m 1263 1013 l 995 0 l 859 0 l 627 837 l 405 0 l 265 0 l 0 1013 l 136 1013 l 342 202 l 556 1013 l 701 1013 l 921 207 l 1133 1012 l 1263 1013 "},">":{x_min:18.0625,x_max:774,ha:792,o:"m 774 376 l 18 40 l 18 149 l 631 421 l 18 692 l 18 799 l 774 465 l 774 376 "},v:{x_min:0,x_max:675.15625,ha:761,o:"m 675 738 l 404 0 l 272 0 l 0 738 l 133 737 l 340 147 l 541 737 l 675 738 "},"τ":{x_min:.28125,x_max:644.5,ha:703,o:"m 644 628 l 382 628 l 382 179 q 388 120 382 137 q 436 91 401 91 q 474 94 447 91 q 504 97 501 97 l 504 0 q 454 -9 482 -5 q 401 -14 426 -14 q 278 67 308 -14 q 260 233 260 118 l 260 628 l 0 628 l 0 739 l 644 739 l 644 628 "},"ξ":{x_min:0,x_max:624.9375,ha:699,o:"m 624 -37 q 608 -153 624 -96 q 563 -278 593 -211 l 454 -278 q 491 -183 486 -200 q 511 -83 511 -126 q 484 -23 511 -44 q 370 1 452 1 q 323 0 354 1 q 283 -1 293 -1 q 84 76 169 -1 q 0 266 0 154 q 56 431 0 358 q 197 538 108 498 q 94 613 134 562 q 54 730 54 665 q 77 823 54 780 q 143 901 101 867 l 27 901 l 27 1012 l 576 1012 l 576 901 l 380 901 q 244 863 303 901 q 178 745 178 820 q 312 600 178 636 q 532 582 380 582 l 532 479 q 276 455 361 479 q 118 281 118 410 q 165 173 118 217 q 274 120 208 133 q 494 101 384 110 q 624 -37 624 76 "},"&":{x_min:-3,x_max:894.25,ha:992,o:"m 894 0 l 725 0 l 624 123 q 471 0 553 40 q 306 -41 390 -41 q 168 -7 231 -41 q 62 92 105 26 q 14 187 31 139 q -3 276 -3 235 q 55 433 -3 358 q 248 581 114 508 q 170 689 196 640 q 137 817 137 751 q 214 985 137 922 q 384 1041 284 1041 q 548 988 483 1041 q 622 824 622 928 q 563 666 622 739 q 431 556 516 608 l 621 326 q 649 407 639 361 q 663 493 653 426 l 781 493 q 703 229 781 352 l 894 0 m 504 818 q 468 908 504 877 q 384 940 433 940 q 293 907 331 940 q 255 818 255 875 q 289 714 255 767 q 363 628 313 678 q 477 729 446 682 q 504 818 504 771 m 556 209 l 314 499 q 179 395 223 449 q 135 283 135 341 q 146 222 135 253 q 183 158 158 192 q 333 80 241 80 q 556 209 448 80 "},"Λ":{x_min:0,x_max:862.5,ha:942,o:"m 862 0 l 719 0 l 426 847 l 143 0 l 0 0 l 356 1013 l 501 1013 l 862 0 "},I:{x_min:41,x_max:180,ha:293,o:"m 180 0 l 41 0 l 41 1013 l 180 1013 l 180 0 "},G:{x_min:0,x_max:921,ha:1011,o:"m 921 0 l 832 0 l 801 136 q 655 15 741 58 q 470 -28 568 -28 q 126 133 259 -28 q 0 499 0 284 q 125 881 0 731 q 486 1043 259 1043 q 763 957 647 1043 q 905 709 890 864 l 772 709 q 668 866 747 807 q 486 926 589 926 q 228 795 322 926 q 142 507 142 677 q 228 224 142 342 q 483 94 323 94 q 712 195 625 94 q 796 435 796 291 l 477 435 l 477 549 l 921 549 l 921 0 "},"ΰ":{x_min:0,x_max:617,ha:725,o:"m 524 800 l 414 800 l 414 925 l 524 925 l 524 800 m 183 800 l 73 800 l 73 925 l 183 925 l 183 800 m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 m 489 1040 l 300 819 l 216 819 l 351 1040 l 489 1040 "},"`":{x_min:0,x_max:138.890625,ha:236,o:"m 138 699 l 0 699 l 0 861 q 36 974 0 929 q 138 1041 72 1020 l 138 977 q 82 931 95 969 q 69 839 69 893 l 138 839 l 138 699 "},"·":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 "},"Υ":{x_min:.328125,x_max:819.515625,ha:889,o:"m 819 1013 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1013 l 140 1013 l 411 533 l 679 1013 l 819 1013 "},r:{x_min:0,x_max:355.5625,ha:432,o:"m 355 621 l 343 621 q 179 569 236 621 q 122 411 122 518 l 122 0 l 0 0 l 0 737 l 117 737 l 117 604 q 204 719 146 686 q 355 753 262 753 l 355 621 "},x:{x_min:0,x_max:675,ha:764,o:"m 675 0 l 525 0 l 331 286 l 144 0 l 0 0 l 256 379 l 12 738 l 157 737 l 336 473 l 516 738 l 661 738 l 412 380 l 675 0 "},"μ":{x_min:0,x_max:696.609375,ha:747,o:"m 696 -4 q 628 -14 657 -14 q 498 97 513 -14 q 422 8 470 41 q 313 -24 374 -24 q 207 3 258 -24 q 120 80 157 31 l 120 -278 l 0 -278 l 0 738 l 124 738 l 124 343 q 165 172 124 246 q 308 82 216 82 q 451 177 402 82 q 492 358 492 254 l 492 738 l 616 738 l 616 214 q 623 136 616 160 q 673 92 636 92 q 696 95 684 92 l 696 -4 "},h:{x_min:0,x_max:615,ha:724,o:"m 615 472 l 615 0 l 490 0 l 490 454 q 456 590 490 535 q 338 654 416 654 q 186 588 251 654 q 122 436 122 522 l 122 0 l 0 0 l 0 1013 l 122 1013 l 122 633 q 218 727 149 694 q 362 760 287 760 q 552 676 484 760 q 615 472 615 600 "},".":{x_min:0,x_max:142,ha:239,o:"m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 "},"φ":{x_min:-2,x_max:878,ha:974,o:"m 496 -279 l 378 -279 l 378 -17 q 101 88 204 -17 q -2 367 -2 194 q 68 626 -2 510 q 283 758 151 758 l 283 646 q 167 537 209 626 q 133 373 133 462 q 192 177 133 254 q 378 93 259 93 l 378 758 q 445 764 426 763 q 476 765 464 765 q 765 659 653 765 q 878 377 878 553 q 771 96 878 209 q 496 -17 665 -17 l 496 -279 m 496 93 l 514 93 q 687 183 623 93 q 746 380 746 265 q 691 569 746 491 q 522 658 629 658 l 496 656 l 496 93 "},";":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 m 142 -12 q 105 -132 142 -82 q 0 -206 68 -182 l 0 -138 q 58 -82 43 -123 q 68 0 68 -56 l 0 0 l 0 151 l 142 151 l 142 -12 "},f:{x_min:0,x_max:378,ha:472,o:"m 378 638 l 246 638 l 246 0 l 121 0 l 121 638 l 0 638 l 0 738 l 121 738 q 137 935 121 887 q 290 1028 171 1028 q 320 1027 305 1028 q 378 1021 334 1026 l 378 908 q 323 918 346 918 q 257 870 273 918 q 246 780 246 840 l 246 738 l 378 738 l 378 638 "},"“":{x_min:1,x_max:348.21875,ha:454,o:"m 140 670 l 1 670 l 1 830 q 37 943 1 897 q 140 1011 74 990 l 140 947 q 82 900 97 940 q 68 810 68 861 l 140 810 l 140 670 m 348 670 l 209 670 l 209 830 q 245 943 209 897 q 348 1011 282 990 l 348 947 q 290 900 305 940 q 276 810 276 861 l 348 810 l 348 670 "},A:{x_min:.03125,x_max:906.953125,ha:1008,o:"m 906 0 l 756 0 l 648 303 l 251 303 l 142 0 l 0 0 l 376 1013 l 529 1013 l 906 0 m 610 421 l 452 867 l 293 421 l 610 421 "},"‘":{x_min:1,x_max:139.890625,ha:236,o:"m 139 670 l 1 670 l 1 830 q 37 943 1 897 q 139 1011 74 990 l 139 947 q 82 900 97 940 q 68 810 68 861 l 139 810 l 139 670 "},"ϊ":{x_min:-70,x_max:283,ha:361,o:"m 283 800 l 173 800 l 173 925 l 283 925 l 283 800 m 40 800 l -70 800 l -70 925 l 40 925 l 40 800 m 283 3 q 232 -10 257 -5 q 181 -15 206 -15 q 84 26 118 -15 q 41 200 41 79 l 41 737 l 166 737 l 167 215 q 171 141 167 157 q 225 101 182 101 q 247 103 238 101 q 283 112 256 104 l 283 3 "},"π":{x_min:-.21875,x_max:773.21875,ha:857,o:"m 773 -7 l 707 -11 q 575 40 607 -11 q 552 174 552 77 l 552 226 l 552 626 l 222 626 l 222 0 l 97 0 l 97 626 l 0 626 l 0 737 l 773 737 l 773 626 l 676 626 l 676 171 q 695 103 676 117 q 773 90 714 90 l 773 -7 "},"ά":{x_min:0,x_max:765.5625,ha:809,o:"m 765 -4 q 698 -14 726 -14 q 564 97 586 -14 q 466 7 525 40 q 337 -26 407 -26 q 88 98 186 -26 q 0 369 0 212 q 88 637 0 525 q 337 760 184 760 q 465 727 407 760 q 563 637 524 695 l 563 738 l 685 738 l 685 222 q 693 141 685 168 q 748 94 708 94 q 765 95 760 94 l 765 -4 m 584 371 q 531 562 584 485 q 360 653 470 653 q 192 566 254 653 q 135 379 135 489 q 186 181 135 261 q 358 84 247 84 q 528 176 465 84 q 584 371 584 260 m 604 1040 l 415 819 l 332 819 l 466 1040 l 604 1040 "},O:{x_min:0,x_max:958,ha:1057,o:"m 485 1041 q 834 882 702 1041 q 958 512 958 734 q 834 136 958 287 q 481 -26 702 -26 q 126 130 261 -26 q 0 504 0 279 q 127 880 0 728 q 485 1041 263 1041 m 480 98 q 731 225 638 98 q 815 504 815 340 q 733 783 815 669 q 480 912 640 912 q 226 784 321 912 q 142 504 142 670 q 226 224 142 339 q 480 98 319 98 "},n:{x_min:0,x_max:615,ha:724,o:"m 615 463 l 615 0 l 490 0 l 490 454 q 453 592 490 537 q 331 656 410 656 q 178 585 240 656 q 117 421 117 514 l 117 0 l 0 0 l 0 738 l 117 738 l 117 630 q 218 728 150 693 q 359 764 286 764 q 552 675 484 764 q 615 463 615 593 "},l:{x_min:41,x_max:166,ha:279,o:"m 166 0 l 41 0 l 41 1013 l 166 1013 l 166 0 "},"¤":{x_min:40.09375,x_max:728.796875,ha:825,o:"m 728 304 l 649 224 l 512 363 q 383 331 458 331 q 256 363 310 331 l 119 224 l 40 304 l 177 441 q 150 553 150 493 q 184 673 150 621 l 40 818 l 119 898 l 267 749 q 321 766 291 759 q 384 773 351 773 q 447 766 417 773 q 501 749 477 759 l 649 898 l 728 818 l 585 675 q 612 618 604 648 q 621 553 621 587 q 591 441 621 491 l 728 304 m 384 682 q 280 643 318 682 q 243 551 243 604 q 279 461 243 499 q 383 423 316 423 q 487 461 449 423 q 525 553 525 500 q 490 641 525 605 q 384 682 451 682 "},"κ":{x_min:0,x_max:632.328125,ha:679,o:"m 632 0 l 482 0 l 225 384 l 124 288 l 124 0 l 0 0 l 0 738 l 124 738 l 124 446 l 433 738 l 596 738 l 312 466 l 632 0 "},p:{x_min:0,x_max:685,ha:786,o:"m 685 364 q 598 96 685 205 q 350 -23 504 -23 q 121 89 205 -23 l 121 -278 l 0 -278 l 0 738 l 121 738 l 121 633 q 220 726 159 691 q 351 761 280 761 q 598 636 504 761 q 685 364 685 522 m 557 371 q 501 560 557 481 q 330 651 437 651 q 162 559 223 651 q 108 366 108 479 q 162 177 108 254 q 333 87 224 87 q 502 178 441 87 q 557 371 557 258 "},"‡":{x_min:0,x_max:777,ha:835,o:"m 458 238 l 458 0 l 319 0 l 319 238 l 0 238 l 0 360 l 319 360 l 319 681 l 0 683 l 0 804 l 319 804 l 319 1015 l 458 1013 l 458 804 l 777 804 l 777 683 l 458 683 l 458 360 l 777 360 l 777 238 l 458 238 "},"ψ":{x_min:0,x_max:808,ha:907,o:"m 465 -278 l 341 -278 l 341 -15 q 87 102 180 -15 q 0 378 0 210 l 0 739 l 133 739 l 133 379 q 182 195 133 275 q 341 98 242 98 l 341 922 l 465 922 l 465 98 q 623 195 563 98 q 675 382 675 278 l 675 742 l 808 742 l 808 381 q 720 104 808 213 q 466 -13 627 -13 l 465 -278 "},"η":{x_min:.78125,x_max:697,ha:810,o:"m 697 -278 l 572 -278 l 572 454 q 540 587 572 536 q 425 650 501 650 q 271 579 337 650 q 206 420 206 509 l 206 0 l 81 0 l 81 489 q 73 588 81 562 q 0 644 56 644 l 0 741 q 68 755 38 755 q 158 720 124 755 q 200 630 193 686 q 297 726 234 692 q 434 761 359 761 q 620 692 544 761 q 697 516 697 624 l 697 -278 "}},cssFontWeight:"normal",ascender:1189,underlinePosition:-100,cssFontStyle:"normal",boundingBox:{yMin:-334,xMin:-111,yMax:1189,xMax:1672},resolution:1e3,original_font_information:{postscript_name:"Helvetiker-Regular",version_string:"Version 1.00 2004 initial release",vendor_url:"http://www.magenta.gr/",full_font_name:"Helvetiker",font_family_name:"Helvetiker",copyright:"Copyright (c) Μagenta ltd, 2004",description:"",trademark:"",designer:"",designer_url:"",unique_font_identifier:"Μagenta ltd:Helvetiker:22-10-104",license_url:"http://www.ellak.gr/fonts/MgOpen/license.html",license_description:'Copyright (c) 2004 by MAGENTA Ltd. All Rights Reserved.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: \r\n\r\nThe above copyright and this permission notice shall be included in all copies of one or more of the Font Software typefaces.\r\n\r\nThe Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing the word "MgOpen", or if the modifications are accepted for inclusion in the Font Software itself by the each appointed Administrator.\r\n\r\nThis License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "MgOpen" name.\r\n\r\nThe Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. \r\n\r\nTHE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL MAGENTA OR PERSONS OR BODIES IN CHARGE OF ADMINISTRATION AND MAINTENANCE OF THE FONT SOFTWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.',manufacturer_name:"Μagenta ltd",font_sub_family_name:"Regular"},descender:-334,familyName:"Helvetiker",lineHeight:1522,underlineThickness:50},p_=ev(ev({},window.THREE?window.THREE:{BoxGeometry:nr,CircleGeometry:Zo,DoubleSide:2,Group:so,Mesh:tr,MeshLambertMaterial:Ll,TextGeometry:Fy,Vector3:en}),{},{Font:class{constructor(t){this.isFont=!0,this.type="Font",this.data=t}generateShapes(t,e=100){const n=[],i=function(t,e,n){const i=Array.from(t),r=e/n.resolution,s=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*r,a=[];let o=0,l=0;for(let t=0;t<i.length;t++){const e=i[t];if("\n"===e)o=0,l-=s;else{const t=ky(e,r,o,l,n);o+=t.offsetX,a.push(t.path)}}return a}(t,e,this.data);for(let t=0,e=i.length;t<e;t++)n.push(...i[t].toShapes());return n}},TextGeometry:Fy}),f_=Fu({props:{labelsData:{default:[]},labelLat:{default:"lat"},labelLng:{default:"lng"},labelAltitude:{default:0},labelText:{default:"text"},labelSize:{default:.5},labelTypeFace:{default:d_,onChange:function(t,e){e.font=new p_.Font(t)}},labelColor:{default:function(){return"lightgrey"}},labelRotation:{default:0},labelResolution:{default:3},labelIncludeDot:{default:!0},labelDotRadius:{default:.1},labelDotOrientation:{default:function(){return"bottom"}},labelsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e,n){var i=n.tweenGroup;uv(t),e.scene=t,e.tweenGroup=i},update:function(t){var e=Xd(t.labelLat),n=Xd(t.labelLng),i=Xd(t.labelAltitude),r=Xd(t.labelText),s=Xd(t.labelSize),a=Xd(t.labelRotation),o=Xd(t.labelColor),l=Xd(t.labelIncludeDot),u=Xd(t.labelDotRadius),h=Xd(t.labelDotOrientation),c=new Set(["right","top","bottom"]),A=2*Math.PI*cv/360,d=new p_.CircleGeometry(1,16);Tv(t.labelsData,t.scene,{createObj:function(){var t=new p_.MeshLambertMaterial;t.side=2;var e=new p_.Group;e.add(new p_.Mesh(d,t));var n=new p_.Mesh(void 0,t);e.add(n);var i=new p_.Mesh;return i.visible=!1,n.add(i),e.__globeObjType="label",e},updateObj:function(d,p){var f=iv(d.children,2),m=f[0],g=f[1],y=iv(g.children,1)[0],v=o(p),_=bv(v);g.material.color.set(xv(v)),g.material.transparent=_<1,g.material.opacity=_;var x=l(p),b=h(p);!x||!c.has(b)&&(b="bottom");var S=x?+u(p)*A:1e-12;m.scale.x=m.scale.y=S;var M=+s(p)*A;if(g.geometry&&g.geometry.dispose(),g.geometry=new p_.TextGeometry(r(p),{font:t.font,size:M,depth:0,height:0,curveSegments:t.labelResolution}),y.geometry&&y.geometry.dispose(),g.geometry.computeBoundingBox(),y.geometry=Yy(p_.BoxGeometry,rv((new p_.Vector3).subVectors(g.geometry.boundingBox.max,g.geometry.boundingBox.min).toArray())),"right"!==b&&g.geometry.center(),x){var w=S+M/2;"right"===b&&(g.position.x=w),g.position.y={right:-M/2,top:w+M/2,bottom:-w-M/2}[b]}var T=function(e){var n=d.__currentTargetD=e,i=n.lat,r=n.lng,s=n.alt,a=n.rot,o=n.scale;Object.assign(d.position,dv(i,r,s)),d.lookAt(t.scene.localToWorld(new p_.Vector3(0,0,0))),d.rotateY(Math.PI),d.rotateZ(-a*Math.PI/180),d.scale.x=d.scale.y=d.scale.z=o},E={lat:+e(p),lng:+n(p),alt:+i(p),rot:+a(p),scale:1},C=d.__currentTargetD||Object.assign({},E,{scale:1e-12});Object.keys(E).some((function(t){return C[t]!==E[t]}))&&(!t.labelsTransitionDuration||t.labelsTransitionDuration<0?T(E):t.tweenGroup.add(new Wu(C).to(E,t.labelsTransitionDuration).easing(zu.Quadratic.InOut).onUpdate(T).start()))}})}}),m_=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32;Hy(this,e),(t=Gy(this,e)).type="CircleLineGeometry",t.parameters={radius:n,segmentCount:i};for(var r=[],s=0;s<=i;s++){var a=(s/i-.25)*Math.PI*2;r.push({x:Math.cos(a)*n,y:Math.sin(a)*n,z:0})}return t.setFromPoints(r),t}return Ky(e,t),Qy(e)}((window.THREE?window.THREE:{BufferGeometry:Gi}).BufferGeometry),g_=window.THREE?window.THREE:{Color:Mi,Group:so,Line:Eo,LineBasicMaterial:vo,Vector3:en},y_=Nf.default||Nf,v_=Fu({props:{ringsData:{default:[]},ringLat:{default:"lat"},ringLng:{default:"lng"},ringAltitude:{default:.0015},ringColor:{default:function(){return"#ffffaa"},triggerUpdate:!1},ringResolution:{default:64,triggerUpdate:!1},ringMaxRadius:{default:2,triggerUpdate:!1},ringPropagationSpeed:{default:1,triggerUpdate:!1},ringRepeatPeriod:{default:700,triggerUpdate:!1}},methods:{pauseAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.pause()},resumeAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.resume()},_destructor:function(t){var e;null===(e=t.ticker)||void 0===e||e.dispose()}},init:function(t,e,n){var i=n.tweenGroup;uv(t),e.scene=t,e.tweenGroup=i,e.ticker=new y_,e.ticker.onTick.add((function(t){if(e.ringsData.length){var n=Xd(e.ringColor),i=Xd(e.ringAltitude),r=Xd(e.ringMaxRadius),s=Xd(e.ringPropagationSpeed),a=Xd(e.ringRepeatPeriod);e.ringsData.filter((function(t){return t.__threeObj})).forEach((function(o){var l,u,h=o.__threeObj;if((h.__nextRingTime||0)<=t){var c=a(o)/1e3;h.__nextRingTime=t+(c<=0?1/0:c);var A,d=new g_.Line(new m_(1,e.ringResolution),new g_.LineBasicMaterial),p=n(o),f=p instanceof Array||p instanceof Function;f?p instanceof Array?(A=ym().domain(p.map((function(t,e){return e/(p.length-1)}))).range(p),d.material.transparent=p.some((function(t){return bv(t)<1}))):(A=p,d.material.transparent=!0):(d.material.color=new g_.Color(xv(p)),l=d.material,u=bv(p),l.opacity=u,l.transparent=u<1,l.depthWrite=u>=1);var m=cv*(1+i(o)),g=r(o),y=g*Math.PI/180,v=s(o),_=v<=0,x=function(t){var e=t.t,n=(_?1-e:e)*y;if(d.scale.x=d.scale.y=m*Math.sin(n),d.position.z=m*(1-Math.cos(n)),f){var i=A(e);d.material.color=new g_.Color(xv(i)),d.material.transparent&&(d.material.opacity=bv(i))}};if(0===v)x({t:0}),h.add(d);else{var b=1e3*Math.abs(g/v);e.tweenGroup.add(new Wu({t:0}).to({t:1},b).onUpdate(x).onStart((function(){return h.add(d)})).onComplete((function(){h.remove(d),lv(d)})).start())}}}))}}))},update:function(t){var e=Xd(t.ringLat),n=Xd(t.ringLng),i=Xd(t.ringAltitude),r=t.scene.localToWorld(new g_.Vector3(0,0,0));Tv(t.ringsData,t.scene,{createObj:function(){var t=new g_.Group;return t.__globeObjType="ring",t},updateObj:function(t,s){var a=e(s),o=n(s),l=i(s);Object.assign(t.position,dv(a,o,l)),t.lookAt(r)}},{removeDelay:3e4})}}),__=ev(ev({},window.THREE?window.THREE:{}),{},{CSS2DObject:class extends si{constructor(t=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=t,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new Ee(.5,.5),this.addEventListener("removed",(function(){this.traverse((function(t){t.element instanceof Element&&null!==t.element.parentNode&&t.element.parentNode.removeChild(t.element)}))}))}copy(t,e){return super.copy(t,e),this.element=t.element.cloneNode(!0),this.center=t.center,this}}}),x_=Fu({props:{htmlElementsData:{default:[]},htmlLat:{default:"lat"},htmlLng:{default:"lng"},htmlAltitude:{default:0},htmlElement:{},htmlTransitionDuration:{default:1e3,triggerUpdate:!1},isBehindGlobe:{onChange:function(){this.updateObjVisibility()},triggerUpdate:!1}},methods:{updateObjVisibility:function(t,e){(e?[e]:t.htmlElementsData.map((function(t){return t.__threeObj})).filter((function(t){return t}))).forEach((function(e){return e.visible=!t.isBehindGlobe||!t.isBehindGlobe(e.position)}))}},init:function(t,e,n){var i=n.tweenGroup;uv(t),e.scene=t,e.tweenGroup=i},update:function(t,e){var n=this,i=Xd(t.htmlLat),r=Xd(t.htmlLng),s=Xd(t.htmlAltitude),a=Xd(t.htmlElement);Tv(t.htmlElementsData,t.scene,{purge:e.hasOwnProperty("htmlElement"),createObj:function(t){var e=a(t),n=new __.CSS2DObject(e);return n.__globeObjType="html",n},updateObj:function(e,a){var o=function(t){var i=e.__currentTargetD=t,r=i.alt,s=i.lat,a=i.lng;Object.assign(e.position,dv(s,a,r)),n.updateObjVisibility(e)},l={lat:+i(a),lng:+r(a),alt:+s(a)};!t.htmlTransitionDuration||t.htmlTransitionDuration<0||!e.__currentTargetD?o(l):t.tweenGroup.add(new Wu(e.__currentTargetD).to(l,t.htmlTransitionDuration).easing(zu.Quadratic.InOut).onUpdate(o).start())}})}}),b_=window.THREE?window.THREE:{Euler:Gn,Group:so,Mesh:tr,MeshLambertMaterial:Ll,SphereGeometry:Nl},S_=Fu({props:{objectsData:{default:[]},objectLat:{default:"lat"},objectLng:{default:"lng"},objectAltitude:{default:.01},objectFacesSurface:{default:!0},objectRotation:{},objectThreeObject:{default:new b_.Mesh(new b_.SphereGeometry(1,16,8),new b_.MeshLambertMaterial({color:"#ffffaa",transparent:!0,opacity:.7}))}},init:function(t,e){uv(t),e.scene=t},update:function(t,e){var n=Xd(t.objectLat),i=Xd(t.objectLng),r=Xd(t.objectAltitude),s=Xd(t.objectFacesSurface),a=Xd(t.objectRotation),o=Xd(t.objectThreeObject);Tv(t.objectsData,t.scene,{purge:e.hasOwnProperty("objectThreeObject"),createObj:function(e){var n=o(e);t.objectThreeObject===n&&(n=n.clone());var i=new b_.Group;return i.add(n),i.__globeObjType="object",i},updateObj:function(t,e){var o=+n(e),l=+i(e),u=+r(e);Object.assign(t.position,dv(o,l,u)),s(e)?t.setRotationFromEuler(new Gn(fv(-o),fv(l),0,"YXZ")):t.rotation.set(0,0,0);var h=t.children[0],c=a(e);c&&h.setRotationFromEuler(new Gn(fv(c.x||0),fv(c.y||0),fv(c.z||0)))}})}}),M_=Fu({props:{customLayerData:{default:[]},customThreeObject:{},customThreeObjectUpdate:{triggerUpdate:!1}},init:function(t,e){uv(t),e.scene=t},update:function(t,e){t.customThreeObjectUpdate||uv(t.scene);var n=Xd(t.customThreeObject),i=Xd(t.customThreeObjectUpdate);Tv(t.customLayerData,t.scene,{purge:e.hasOwnProperty("customThreeObject"),createObj:function(e){var i=n(e,cv);return i&&(t.customThreeObject===i&&(i=i.clone()),i.__globeObjType="custom"),i},updateObj:function(t,e){return i(t,e,cv)}})}}),w_=window.THREE?window.THREE:{Group:so,Vector2:Ee,Vector3:en},T_=["globeLayer","pointsLayer","arcsLayer","hexBinLayer","heatmapsLayer","polygonsLayer","hexedPolygonsLayer","pathsLayer","tilesLayer","labelsLayer","ringsLayer","htmlElementsLayer","objectsLayer","customLayer"],E_=hv("globeLayer",_v),C_=Object.assign.apply(Object,rv(["globeImageUrl","bumpImageUrl","showGlobe","showGraticules","showAtmosphere","atmosphereColor","atmosphereAltitude"].map((function(t){return $y({},t,E_.linkProp(t))})))),R_=Object.assign.apply(Object,rv(["globeMaterial"].map((function(t){return $y({},t,E_.linkMethod(t))})))),N_=hv("pointsLayer",Nv),P_=Object.assign.apply(Object,rv(["pointsData","pointLat","pointLng","pointColor","pointAltitude","pointRadius","pointResolution","pointsMerge","pointsTransitionDuration"].map((function(t){return $y({},t,N_.linkProp(t))})))),D_=hv("arcsLayer",Bv),I_=Object.assign.apply(Object,rv(["arcsData","arcStartLat","arcStartLng","arcEndLat","arcEndLng","arcColor","arcAltitude","arcAltitudeAutoScale","arcStroke","arcCurveResolution","arcCircularResolution","arcDashLength","arcDashGap","arcDashInitialGap","arcDashAnimateTime","arcsTransitionDuration"].map((function(t){return $y({},t,D_.linkProp(t))})))),L_=hv("hexBinLayer",kv),B_=Object.assign.apply(Object,rv(["hexBinPointsData","hexBinPointLat","hexBinPointLng","hexBinPointWeight","hexBinResolution","hexMargin","hexTopCurvatureResolution","hexTopColor","hexSideColor","hexAltitude","hexBinMerge","hexTransitionDuration"].map((function(t){return $y({},t,L_.linkProp(t))})))),U_=hv("heatmapsLayer",Zv),O_=Object.assign.apply(Object,rv(["heatmapsData","heatmapPoints","heatmapPointLat","heatmapPointLng","heatmapPointWeight","heatmapBandwidth","heatmapColorFn","heatmapColorSaturation","heatmapBaseAltitude","heatmapTopAltitude","heatmapsTransitionDuration"].map((function(t){return $y({},t,U_.linkProp(t))})))),F_=hv("hexedPolygonsLayer",i_),k_=Object.assign.apply(Object,rv(["hexPolygonsData","hexPolygonGeoJsonGeometry","hexPolygonColor","hexPolygonAltitude","hexPolygonResolution","hexPolygonMargin","hexPolygonUseDots","hexPolygonCurvatureResolution","hexPolygonDotResolution","hexPolygonsTransitionDuration"].map((function(t){return $y({},t,F_.linkProp(t))})))),z_=hv("polygonsLayer",Jv),q_=Object.assign.apply(Object,rv(["polygonsData","polygonGeoJsonGeometry","polygonCapColor","polygonCapMaterial","polygonSideColor","polygonSideMaterial","polygonStrokeColor","polygonAltitude","polygonCapCurvatureResolution","polygonsTransitionDuration"].map((function(t){return $y({},t,z_.linkProp(t))})))),G_=hv("pathsLayer",u_),V_=Object.assign.apply(Object,rv(["pathsData","pathPoints","pathPointLat","pathPointLng","pathPointAlt","pathResolution","pathColor","pathStroke","pathDashLength","pathDashGap","pathDashInitialGap","pathDashAnimateTime","pathTransitionDuration"].map((function(t){return $y({},t,G_.linkProp(t))})))),H_=hv("tilesLayer",c_),j_=Object.assign.apply(Object,rv(["tilesData","tileLat","tileLng","tileAltitude","tileWidth","tileHeight","tileUseGlobeProjection","tileMaterial","tileCurvatureResolution","tilesTransitionDuration"].map((function(t){return $y({},t,H_.linkProp(t))})))),W_=hv("labelsLayer",f_),X_=Object.assign.apply(Object,rv(["labelsData","labelLat","labelLng","labelAltitude","labelRotation","labelText","labelSize","labelTypeFace","labelColor","labelResolution","labelIncludeDot","labelDotRadius","labelDotOrientation","labelsTransitionDuration"].map((function(t){return $y({},t,W_.linkProp(t))})))),Y_=hv("ringsLayer",v_),Q_=Object.assign.apply(Object,rv(["ringsData","ringLat","ringLng","ringAltitude","ringColor","ringResolution","ringMaxRadius","ringPropagationSpeed","ringRepeatPeriod"].map((function(t){return $y({},t,Y_.linkProp(t))})))),$_=hv("htmlElementsLayer",x_),Z_=Object.assign.apply(Object,rv(["htmlElementsData","htmlLat","htmlLng","htmlAltitude","htmlElement","htmlTransitionDuration"].map((function(t){return $y({},t,$_.linkProp(t))})))),K_=hv("objectsLayer",S_),J_=Object.assign.apply(Object,rv(["objectsData","objectLat","objectLng","objectAltitude","objectRotation","objectFacesSurface","objectThreeObject"].map((function(t){return $y({},t,K_.linkProp(t))})))),tx=hv("customLayer",M_),ex=Object.assign.apply(Object,rv(["customLayerData","customThreeObject","customThreeObjectUpdate"].map((function(t){return $y({},t,tx.linkProp(t))})))),nx=Fu({props:ev(ev(ev(ev(ev(ev(ev(ev(ev(ev(ev(ev(ev(ev({onGlobeReady:{triggerUpdate:!1},rendererSize:{default:new w_.Vector2(window.innerWidth,window.innerHeight),onChange:function(t,e){e.pathsLayer.rendererSize(t)},triggerUpdate:!1}},C_),P_),I_),B_),O_),q_),k_),V_),j_),X_),Q_),Z_),J_),ex),methods:ev({getGlobeRadius:Av,getCoords:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return dv.apply(void 0,n)},toGeoCoords:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return pv.apply(void 0,n)},setPointOfView:function(t,e,n){var i=void 0;if(e){var r,s,a,o=Av(),l=n?e.clone().sub(n):e;i=function(t){void 0===r&&(r=l.length()),void 0===s&&(s=Math.sqrt(Math.pow(r,2)-Math.pow(o,2))),void 0===a&&(a=Math.acos(s/r));var e=l.distanceTo(t);if(e<s)return!1;var n=t.length();return Math.acos((Math.pow(r,2)+Math.pow(e,2)-Math.pow(n,2))/(2*r*e))<a}}t.layersThatNeedBehindGlobeChecker.forEach((function(t){return t.isBehindGlobe(i)}))},pauseAnimation:function(t){return null!==t.animationFrameRequestId&&(cancelAnimationFrame(t.animationFrameRequestId),t.animationFrameRequestId=null),t.pausableLayers.forEach((function(t){var e;return null===(e=t.pauseAnimation)||void 0===e?void 0:e.call(t)})),this},resumeAnimation:function(t){return null===t.animationFrameRequestId&&this._animationCycle(),t.pausableLayers.forEach((function(t){var e;return null===(e=t.resumeAnimation)||void 0===e?void 0:e.call(t)})),this},_animationCycle:function(t){t.animationFrameRequestId=requestAnimationFrame(this._animationCycle),t.tweenGroup.update()},_destructor:function(t){this.pauseAnimation(),t.destructableLayers.forEach((function(t){return t._destructor()}))}},R_),stateInit:function(){var t=new Gu,e={tweenGroup:t},n={globeLayer:_v(e),pointsLayer:Nv(e),arcsLayer:Bv(e),hexBinLayer:kv(e),heatmapsLayer:Zv(e),polygonsLayer:Jv(e),hexedPolygonsLayer:i_(e),pathsLayer:u_(e),tilesLayer:c_(e),labelsLayer:f_(e),ringsLayer:v_(e),htmlElementsLayer:x_(e),objectsLayer:S_(e),customLayer:M_(e)};return ev(ev({tweenGroup:t},n),{},{layersThatNeedBehindGlobeChecker:Object.values(n).filter((function(t){return t.hasOwnProperty("isBehindGlobe")})),destructableLayers:Object.values(n).filter((function(t){return t.hasOwnProperty("_destructor")})),pausableLayers:Object.values(n).filter((function(t){return t.hasOwnProperty("pauseAnimation")}))})},init:function(t,e,n){var i=n.animateIn,r=void 0===i||i,s=n.waitForGlobeReady,a=void 0===s||s;uv(t),e.scene=t,e.scene.visible=!1,T_.forEach((function(t){var n=new w_.Group;e.scene.add(n),e[t](n)}));var o=function(){if(r){e.scene.scale.set(1e-6,1e-6,1e-6),e.tweenGroup.add(new Wu({k:1e-6}).to({k:1},600).easing(zu.Quadratic.Out).onUpdate((function(t){var n=t.k;return e.scene.scale.set(n,n,n)})).start());var t=new w_.Vector3(0,1,0);e.tweenGroup.add(new Wu({rot:2*Math.PI}).to({rot:0},1200).easing(zu.Quintic.Out).onUpdate((function(n){var i=n.rot;return e.scene.setRotationFromAxisAngle(t,i)})).start())}e.scene.visible=!0,e.onGlobeReady&&e.onGlobeReady()};a?e.globeLayer.onReady(o):o(),this._animationCycle()},update:function(t){}});var ix=function(t){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=function(n){function i(){var n;Hy(this,i);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return(n=Gy(this,i,[].concat(s))).__kapsuleInstance=t.apply(void 0,s).apply(void 0,[].concat(rv(e?[n]:[]),s)),n}return Ky(i,n),Qy(i)}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object);return Object.keys(t()).forEach((function(t){return n.prototype[t]=function(){var e,n=(e=this.__kapsuleInstance)[t].apply(e,arguments);return n===this.__kapsuleInstance?this:n}})),n}(nx,(window.THREE?window.THREE:{Group:so}).Group,!0);const rx="169",sx=100,ax=101,ox=102,lx=200,ux=201,hx=202,cx=203,Ax=204,dx=205,px=206,fx=207,mx=208,gx=209,yx=210,vx=301,_x=302,xx=303,bx=304,Sx=1e3,Mx=1001,wx=1002,Tx=1003,Ex=1004,Cx=1005,Rx=1006,Nx=1007,Px=1008,Dx=1009,Ix=1010,Lx=1011,Bx=1012,Ux=1013,Ox=1014,Fx=1015,kx=1016,zx=1020,qx=1022,Gx=1023,Vx=1026,Hx=1027,jx=1028,Wx=1029,Xx=1030,Yx=1031,Qx=1033,$x=33776,Zx=33777,Kx=33778,Jx=33779,tb=37492,eb=37496,nb=37808,ib=37809,rb=37810,sb=37811,ab=37812,ob=37813,lb=37814,ub=37815,hb=37816,cb=37817,Ab=37818,db=37819,pb=37820,fb=37821,mb=36492,gb="",yb="srgb",vb="srgb-linear",_b="display-p3",xb="display-p3-linear",bb="linear",Sb="srgb",Mb="rec709",wb=7680,Tb=512,Eb=513,Cb=514,Rb=515,Nb=516,Pb=517,Db=518,Ib=519,Lb=35044,Bb=35048,Ub=2e3,Ob=2001;class Fb{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)}hasEventListener(t,e){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;const n=this._listeners[t];if(void 0!==n){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}dispatchEvent(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const n=e.slice(0);for(let e=0,i=n.length;e<i;e++)n[e].call(this,t);t.target=null}}}const kb=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let zb=1234567;const qb=Math.PI/180,Gb=180/Math.PI;function Vb(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(kb[255&t]+kb[t>>8&255]+kb[t>>16&255]+kb[t>>24&255]+"-"+kb[255&e]+kb[e>>8&255]+"-"+kb[e>>16&15|64]+kb[e>>24&255]+"-"+kb[63&n|128]+kb[n>>8&255]+"-"+kb[n>>16&255]+kb[n>>24&255]+kb[255&i]+kb[i>>8&255]+kb[i>>16&255]+kb[i>>24&255]).toLowerCase()}function Hb(t,e,n){return Math.max(e,Math.min(n,t))}function jb(t,e){return(t%e+e)%e}function Wb(t,e,n){return(1-n)*t+n*e}function Xb(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Yb(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}const Qb={DEG2RAD:qb,RAD2DEG:Gb,generateUUID:Vb,clamp:Hb,euclideanModulo:jb,mapLinear:function(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)},inverseLerp:function(t,e,n){return t!==e?(n-t)/(e-t):0},lerp:Wb,damp:function(t,e,n,i){return Wb(t,e,1-Math.exp(-n*i))},pingpong:function(t,e=1){return e-Math.abs(jb(t,2*e)-e)},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(zb=t);let e=zb+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296},degToRad:function(t){return t*qb},radToDeg:function(t){return t*Gb},isPowerOfTwo:function(t){return!(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,n,i,r){const s=Math.cos,a=Math.sin,o=s(n/2),l=a(n/2),u=s((e+i)/2),h=a((e+i)/2),c=s((e-i)/2),A=a((e-i)/2),d=s((i-e)/2),p=a((i-e)/2);switch(r){case"XYX":t.set(o*h,l*c,l*A,o*u);break;case"YZY":t.set(l*A,o*h,l*c,o*u);break;case"ZXZ":t.set(l*c,l*A,o*h,o*u);break;case"XZX":t.set(o*h,l*p,l*d,o*u);break;case"YXY":t.set(l*d,o*h,l*p,o*u);break;case"ZYZ":t.set(l*p,l*d,o*h,o*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize:Yb,denormalize:Xb};class $b{constructor(t=0,e=0){$b.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Hb(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,s=this.y-t.y;return this.x=r*n-s*i+t.x,this.y=r*i+s*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Zb{constructor(t,e,n,i,r,s,a,o,l){Zb.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,n,i,r,s,a,o,l)}set(t,e,n,i,r,s,a,o,l){const u=this.elements;return u[0]=t,u[1]=i,u[2]=a,u[3]=e,u[4]=r,u[5]=o,u[6]=n,u[7]=s,u[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,s=n[0],a=n[3],o=n[6],l=n[1],u=n[4],h=n[7],c=n[2],A=n[5],d=n[8],p=i[0],f=i[3],m=i[6],g=i[1],y=i[4],v=i[7],_=i[2],x=i[5],b=i[8];return r[0]=s*p+a*g+o*_,r[3]=s*f+a*y+o*x,r[6]=s*m+a*v+o*b,r[1]=l*p+u*g+h*_,r[4]=l*f+u*y+h*x,r[7]=l*m+u*v+h*b,r[2]=c*p+A*g+d*_,r[5]=c*f+A*y+d*x,r[8]=c*m+A*v+d*b,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],u=t[8];return e*s*u-e*a*l-n*r*u+n*a*o+i*r*l-i*s*o}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],u=t[8],h=u*s-a*l,c=a*o-u*r,A=l*r-s*o,d=e*h+n*c+i*A;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);const p=1/d;return t[0]=h*p,t[1]=(i*l-u*n)*p,t[2]=(a*n-i*s)*p,t[3]=c*p,t[4]=(u*e-i*o)*p,t[5]=(i*r-a*e)*p,t[6]=A*p,t[7]=(n*o-l*e)*p,t[8]=(s*e-n*r)*p,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,r,s,a){const o=Math.cos(r),l=Math.sin(r);return this.set(n*o,n*l,-n*(o*s+l*a)+s+t,-i*l,i*o,-i*(-l*s+o*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(Kb.makeScale(t,e)),this}rotate(t){return this.premultiply(Kb.makeRotation(-t)),this}translate(t,e){return this.premultiply(Kb.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<9;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}const Kb=new Zb;function Jb(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}const tS={};const eS=(new Zb).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),nS=(new Zb).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),iS={[vb]:{transfer:bb,primaries:Mb,luminanceCoefficients:[.2126,.7152,.0722],toReference:t=>t,fromReference:t=>t},[yb]:{transfer:Sb,primaries:Mb,luminanceCoefficients:[.2126,.7152,.0722],toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[xb]:{transfer:bb,primaries:"p3",luminanceCoefficients:[.2289,.6917,.0793],toReference:t=>t.applyMatrix3(nS),fromReference:t=>t.applyMatrix3(eS)},[_b]:{transfer:Sb,primaries:"p3",luminanceCoefficients:[.2289,.6917,.0793],toReference:t=>t.convertSRGBToLinear().applyMatrix3(nS),fromReference:t=>t.applyMatrix3(eS).convertLinearToSRGB()}},rS=new Set([vb,xb]),sS={enabled:!0,_workingColorSpace:vb,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!rS.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,n){if(!1===this.enabled||e===n||!e||!n)return t;const i=iS[e].toReference;return(0,iS[n].fromReference)(i(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return iS[t].primaries},getTransfer:function(t){return t===gb?bb:iS[t].transfer},getLuminanceCoefficients:function(t,e=this._workingColorSpace){return t.fromArray(iS[e].luminanceCoefficients)}};function aS(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function oS(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}let lS;class uS{static getDataURL(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===lS&&(lS=Jb("canvas")),lS.width=t.width,lS.height=t.height;const n=lS.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=lS}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=Jb("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const i=n.getImageData(0,0,t.width,t.height),r=i.data;for(let t=0;t<r.length;t++)r[t]=255*aS(r[t]/255);return n.putImageData(i,0,0),e}if(t.data){const e=t.data.slice(0);for(let t=0;t<e.length;t++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[t]=Math.floor(255*aS(e[t]/255)):e[t]=aS(e[t]);return{data:e,width:t.width,height:t.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}let hS=0;class cS{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:hS++}),this.uuid=Vb(),this.data=t,this.dataReady=!0,this.version=0}set needsUpdate(t){!0===t&&this.version++}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(null!==i){let t;if(Array.isArray(i)){t=[];for(let e=0,n=i.length;e<n;e++)i[e].isDataTexture?t.push(AS(i[e].image)):t.push(AS(i[e]))}else t=AS(i);n.url=t}return e||(t.images[this.uuid]=n),n}}function AS(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?uS.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let dS=0;class pS extends Fb{constructor(t=pS.DEFAULT_IMAGE,e=pS.DEFAULT_MAPPING,n=1001,i=1001,r=1006,s=1008,a=1023,o=1009,l=pS.DEFAULT_ANISOTROPY,u=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:dS++}),this.uuid=Vb(),this.name="",this.source=new cS(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=s,this.anisotropy=l,this.format=a,this.internalFormat=null,this.type=o,this.offset=new $b(0,0),this.repeat=new $b(1,1),this.center=new $b(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Zb,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Sx:t.x=t.x-Math.floor(t.x);break;case Mx:t.x=t.x<0?0:1;break;case wx:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case Sx:t.y=t.y-Math.floor(t.y);break;case Mx:t.y=t.y<0?0:1;break;case wx:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){!0===t&&this.pmremVersion++}}pS.DEFAULT_IMAGE=null,pS.DEFAULT_MAPPING=300,pS.DEFAULT_ANISOTROPY=1;class fS{constructor(t=0,e=0,n=0,i=1){fS.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=this.w,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*i+s[12]*r,this.y=s[1]*e+s[5]*n+s[9]*i+s[13]*r,this.z=s[2]*e+s[6]*n+s[10]*i+s[14]*r,this.w=s[3]*e+s[7]*n+s[11]*i+s[15]*r,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,i,r;const s=.01,a=.1,o=t.elements,l=o[0],u=o[4],h=o[8],c=o[1],A=o[5],d=o[9],p=o[2],f=o[6],m=o[10];if(Math.abs(u-c)<s&&Math.abs(h-p)<s&&Math.abs(d-f)<s){if(Math.abs(u+c)<a&&Math.abs(h+p)<a&&Math.abs(d+f)<a&&Math.abs(l+A+m-3)<a)return this.set(1,0,0,0),this;e=Math.PI;const t=(l+1)/2,o=(A+1)/2,g=(m+1)/2,y=(u+c)/4,v=(h+p)/4,_=(d+f)/4;return t>o&&t>g?t<s?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(t),i=y/n,r=v/n):o>g?o<s?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(o),n=y/i,r=_/i):g<s?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(g),n=v/r,i=_/r),this.set(n,i,r,e),this}let g=Math.sqrt((f-d)*(f-d)+(h-p)*(h-p)+(c-u)*(c-u));return Math.abs(g)<.001&&(g=1),this.x=(f-d)/g,this.y=(h-p)/g,this.z=(c-u)/g,this.w=Math.acos((l+A+m-1)/2),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class mS extends Fb{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new fS(0,0,t,e),this.scissorTest=!1,this.viewport=new fS(0,0,t,e);const i={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Rx,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);const r=new pS(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);r.flipY=!1,r.generateMipmaps=n.generateMipmaps,r.internalFormat=n.internalFormat,this.textures=[];const s=n.count;for(let t=0;t<s;t++)this.textures[t]=r.clone(),this.textures[t].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}setSize(t,e,n=1){if(this.width!==t||this.height!==e||this.depth!==n){this.width=t,this.height=e,this.depth=n;for(let i=0,r=this.textures.length;i<r;i++)this.textures[i].image.width=t,this.textures[i].image.height=e,this.textures[i].image.depth=n;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return(new this.constructor).copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,n=t.textures.length;e<n;e++)this.textures[e]=t.textures[e].clone(),this.textures[e].isRenderTargetTexture=!0;const e=Object.assign({},t.texture.image);return this.texture.source=new cS(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,null!==t.depthTexture&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class gS extends mS{constructor(t=1,e=1,n={}){super(t,e,n),this.isWebGLRenderTarget=!0}}class yS extends pS{constructor(t=null,e=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=Tx,this.minFilter=Tx,this.wrapR=Mx,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class vS{constructor(t=0,e=0,n=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=i}static slerpFlat(t,e,n,i,r,s,a){let o=n[i+0],l=n[i+1],u=n[i+2],h=n[i+3];const c=r[s+0],A=r[s+1],d=r[s+2],p=r[s+3];if(0===a)return t[e+0]=o,t[e+1]=l,t[e+2]=u,void(t[e+3]=h);if(1===a)return t[e+0]=c,t[e+1]=A,t[e+2]=d,void(t[e+3]=p);if(h!==p||o!==c||l!==A||u!==d){let t=1-a;const e=o*c+l*A+u*d+h*p,n=e>=0?1:-1,i=1-e*e;if(i>Number.EPSILON){const r=Math.sqrt(i),s=Math.atan2(r,e*n);t=Math.sin(t*s)/r,a=Math.sin(a*s)/r}const r=a*n;if(o=o*t+c*r,l=l*t+A*r,u=u*t+d*r,h=h*t+p*r,t===1-a){const t=1/Math.sqrt(o*o+l*l+u*u+h*h);o*=t,l*=t,u*=t,h*=t}}t[e]=o,t[e+1]=l,t[e+2]=u,t[e+3]=h}static multiplyQuaternionsFlat(t,e,n,i,r,s){const a=n[i],o=n[i+1],l=n[i+2],u=n[i+3],h=r[s],c=r[s+1],A=r[s+2],d=r[s+3];return t[e]=a*d+u*h+o*A-l*c,t[e+1]=o*d+u*c+l*h-a*A,t[e+2]=l*d+u*A+a*c-o*h,t[e+3]=u*d-a*h-o*c-l*A,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const n=t._x,i=t._y,r=t._z,s=t._order,a=Math.cos,o=Math.sin,l=a(n/2),u=a(i/2),h=a(r/2),c=o(n/2),A=o(i/2),d=o(r/2);switch(s){case"XYZ":this._x=c*u*h+l*A*d,this._y=l*A*h-c*u*d,this._z=l*u*d+c*A*h,this._w=l*u*h-c*A*d;break;case"YXZ":this._x=c*u*h+l*A*d,this._y=l*A*h-c*u*d,this._z=l*u*d-c*A*h,this._w=l*u*h+c*A*d;break;case"ZXY":this._x=c*u*h-l*A*d,this._y=l*A*h+c*u*d,this._z=l*u*d+c*A*h,this._w=l*u*h-c*A*d;break;case"ZYX":this._x=c*u*h-l*A*d,this._y=l*A*h+c*u*d,this._z=l*u*d-c*A*h,this._w=l*u*h+c*A*d;break;case"YZX":this._x=c*u*h+l*A*d,this._y=l*A*h+c*u*d,this._z=l*u*d-c*A*h,this._w=l*u*h-c*A*d;break;case"XZY":this._x=c*u*h-l*A*d,this._y=l*A*h-c*u*d,this._z=l*u*d+c*A*h,this._w=l*u*h+c*A*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!0===e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],i=e[4],r=e[8],s=e[1],a=e[5],o=e[9],l=e[2],u=e[6],h=e[10],c=n+a+h;if(c>0){const t=.5/Math.sqrt(c+1);this._w=.25/t,this._x=(u-o)*t,this._y=(r-l)*t,this._z=(s-i)*t}else if(n>a&&n>h){const t=2*Math.sqrt(1+n-a-h);this._w=(u-o)/t,this._x=.25*t,this._y=(i+s)/t,this._z=(r+l)/t}else if(a>h){const t=2*Math.sqrt(1+a-n-h);this._w=(r-l)/t,this._x=(i+s)/t,this._y=.25*t,this._z=(o+u)/t}else{const t=2*Math.sqrt(1+h-n-a);this._w=(s-i)/t,this._x=(r+l)/t,this._y=(o+u)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Hb(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(0===n)return this;const i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,i=t._y,r=t._z,s=t._w,a=e._x,o=e._y,l=e._z,u=e._w;return this._x=n*u+s*a+i*l-r*o,this._y=i*u+s*o+r*a-n*l,this._z=r*u+s*l+n*o-i*a,this._w=s*u-n*a-i*o-r*l,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const n=this._x,i=this._y,r=this._z,s=this._w;let a=s*t._w+n*t._x+i*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=s,this._x=n,this._y=i,this._z=r,this;const o=1-a*a;if(o<=Number.EPSILON){const t=1-e;return this._w=t*s+e*this._w,this._x=t*n+e*this._x,this._y=t*i+e*this._y,this._z=t*r+e*this._z,this.normalize(),this}const l=Math.sqrt(o),u=Math.atan2(l,a),h=Math.sin((1-e)*u)/l,c=Math.sin(e*u)/l;return this._w=s*h+this._w*c,this._x=n*h+this._x*c,this._y=i*h+this._y*c,this._z=r*h+this._z*c,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(t),i*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class _S{constructor(t=0,e=0,n=0){_S.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(bS.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(bS.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=t.elements,s=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*s,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*s,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*s,this}applyQuaternion(t){const e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,a=t.z,o=t.w,l=2*(s*i-a*n),u=2*(a*e-r*i),h=2*(r*n-s*e);return this.x=e+o*l+s*h-a*u,this.y=n+o*u+a*l-r*h,this.z=i+o*h+r*u-s*l,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,i=t.y,r=t.z,s=e.x,a=e.y,o=e.z;return this.x=i*o-r*a,this.y=r*s-n*o,this.z=n*a-i*s,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return xS.copy(this).projectOnVector(t),this.sub(xS)}reflect(t){return this.sub(xS.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Hb(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=2*Math.random()-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const xS=new _S,bS=new vS;class SS{constructor(t=new _S(1/0,1/0,1/0),e=new _S(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e+=3)this.expandByPoint(wS.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,n=t.count;e<n;e++)this.expandByPoint(wS.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const n=wS.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);const n=t.geometry;if(void 0!==n){const i=n.getAttribute("position");if(!0===e&&void 0!==i&&!0!==t.isInstancedMesh)for(let e=0,n=i.count;e<n;e++)!0===t.isMesh?t.getVertexPosition(e,wS):wS.fromBufferAttribute(i,e),wS.applyMatrix4(t.matrixWorld),this.expandByPoint(wS);else void 0!==t.boundingBox?(null===t.boundingBox&&t.computeBoundingBox(),TS.copy(t.boundingBox)):(null===n.boundingBox&&n.computeBoundingBox(),TS.copy(n.boundingBox)),TS.applyMatrix4(t.matrixWorld),this.union(TS)}const i=t.children;for(let t=0,n=i.length;t<n;t++)this.expandByObject(i[t],e);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,wS),wS.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(IS),LS.subVectors(this.max,IS),ES.subVectors(t.a,IS),CS.subVectors(t.b,IS),RS.subVectors(t.c,IS),NS.subVectors(CS,ES),PS.subVectors(RS,CS),DS.subVectors(ES,RS);let e=[0,-NS.z,NS.y,0,-PS.z,PS.y,0,-DS.z,DS.y,NS.z,0,-NS.x,PS.z,0,-PS.x,DS.z,0,-DS.x,-NS.y,NS.x,0,-PS.y,PS.x,0,-DS.y,DS.x,0];return!!OS(e,ES,CS,RS,LS)&&(e=[1,0,0,0,1,0,0,0,1],!!OS(e,ES,CS,RS,LS)&&(BS.crossVectors(NS,PS),e=[BS.x,BS.y,BS.z],OS(e,ES,CS,RS,LS)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,wS).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(wS).length()),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(MS[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),MS[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),MS[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),MS[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),MS[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),MS[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),MS[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),MS[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(MS)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const MS=[new _S,new _S,new _S,new _S,new _S,new _S,new _S,new _S],wS=new _S,TS=new SS,ES=new _S,CS=new _S,RS=new _S,NS=new _S,PS=new _S,DS=new _S,IS=new _S,LS=new _S,BS=new _S,US=new _S;function OS(t,e,n,i,r){for(let s=0,a=t.length-3;s<=a;s+=3){US.fromArray(t,s);const a=r.x*Math.abs(US.x)+r.y*Math.abs(US.y)+r.z*Math.abs(US.z),o=e.dot(US),l=n.dot(US),u=i.dot(US);if(Math.max(-Math.max(o,l,u),Math.min(o,l,u))>a)return!1}return!0}const FS=new SS,kS=new _S,zS=new _S;class qS{constructor(t=new _S,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;void 0!==e?n.copy(e):FS.setFromPoints(t).getCenter(n);let i=0;for(let e=0,r=t.length;e<r;e++)i=Math.max(i,n.distanceToSquared(t[e]));return this.radius=Math.sqrt(i),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;kS.subVectors(t,this.center);const e=kS.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),n=.5*(t-this.radius);this.center.addScaledVector(kS,n/t),this.radius+=n}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(zS.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(kS.copy(t.center).add(zS)),this.expandByPoint(kS.copy(t.center).sub(zS))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const GS=new _S,VS=new _S,HS=new _S,jS=new _S,WS=new _S,XS=new _S,YS=new _S;class QS{constructor(t=new _S,e=new _S(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,GS)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=GS.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(GS.copy(this.origin).addScaledVector(this.direction,e),GS.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){VS.copy(t).add(e).multiplyScalar(.5),HS.copy(e).sub(t).normalize(),jS.copy(this.origin).sub(VS);const r=.5*t.distanceTo(e),s=-this.direction.dot(HS),a=jS.dot(this.direction),o=-jS.dot(HS),l=jS.lengthSq(),u=Math.abs(1-s*s);let h,c,A,d;if(u>0)if(h=s*o-a,c=s*a-o,d=r*u,h>=0)if(c>=-d)if(c<=d){const t=1/u;h*=t,c*=t,A=h*(h+s*c+2*a)+c*(s*h+c+2*o)+l}else c=r,h=Math.max(0,-(s*c+a)),A=-h*h+c*(c+2*o)+l;else c=-r,h=Math.max(0,-(s*c+a)),A=-h*h+c*(c+2*o)+l;else c<=-d?(h=Math.max(0,-(-s*r+a)),c=h>0?-r:Math.min(Math.max(-r,-o),r),A=-h*h+c*(c+2*o)+l):c<=d?(h=0,c=Math.min(Math.max(-r,-o),r),A=c*(c+2*o)+l):(h=Math.max(0,-(s*r+a)),c=h>0?r:Math.min(Math.max(-r,-o),r),A=-h*h+c*(c+2*o)+l);else c=s>0?-r:r,h=Math.max(0,-(s*c+a)),A=-h*h+c*(c+2*o)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(VS).addScaledVector(HS,c),A}intersectSphere(t,e){GS.subVectors(t.center,this.origin);const n=GS.dot(this.direction),i=GS.dot(GS)-n*n,r=t.radius*t.radius;if(i>r)return null;const s=Math.sqrt(r-i),a=n-s,o=n+s;return o<0?null:a<0?this.at(o,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return null===n?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,i,r,s,a,o;const l=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,c=this.origin;return l>=0?(n=(t.min.x-c.x)*l,i=(t.max.x-c.x)*l):(n=(t.max.x-c.x)*l,i=(t.min.x-c.x)*l),u>=0?(r=(t.min.y-c.y)*u,s=(t.max.y-c.y)*u):(r=(t.max.y-c.y)*u,s=(t.min.y-c.y)*u),n>s||r>i?null:((r>n||isNaN(n))&&(n=r),(s<i||isNaN(i))&&(i=s),h>=0?(a=(t.min.z-c.z)*h,o=(t.max.z-c.z)*h):(a=(t.max.z-c.z)*h,o=(t.min.z-c.z)*h),n>o||a>i?null:((a>n||n!=n)&&(n=a),(o<i||i!=i)&&(i=o),i<0?null:this.at(n>=0?n:i,e)))}intersectsBox(t){return null!==this.intersectBox(t,GS)}intersectTriangle(t,e,n,i,r){WS.subVectors(e,t),XS.subVectors(n,t),YS.crossVectors(WS,XS);let s,a=this.direction.dot(YS);if(a>0){if(i)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}jS.subVectors(this.origin,t);const o=s*this.direction.dot(XS.crossVectors(jS,XS));if(o<0)return null;const l=s*this.direction.dot(WS.cross(jS));if(l<0)return null;if(o+l>a)return null;const u=-s*jS.dot(YS);return u<0?null:this.at(u/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class $S{constructor(t,e,n,i,r,s,a,o,l,u,h,c,A,d,p,f){$S.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,n,i,r,s,a,o,l,u,h,c,A,d,p,f)}set(t,e,n,i,r,s,a,o,l,u,h,c,A,d,p,f){const m=this.elements;return m[0]=t,m[4]=e,m[8]=n,m[12]=i,m[1]=r,m[5]=s,m[9]=a,m[13]=o,m[2]=l,m[6]=u,m[10]=h,m[14]=c,m[3]=A,m[7]=d,m[11]=p,m[15]=f,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new $S).fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,i=1/ZS.setFromMatrixColumn(t,0).length(),r=1/ZS.setFromMatrixColumn(t,1).length(),s=1/ZS.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*s,e[9]=n[9]*s,e[10]=n[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,n=t.x,i=t.y,r=t.z,s=Math.cos(n),a=Math.sin(n),o=Math.cos(i),l=Math.sin(i),u=Math.cos(r),h=Math.sin(r);if("XYZ"===t.order){const t=s*u,n=s*h,i=a*u,r=a*h;e[0]=o*u,e[4]=-o*h,e[8]=l,e[1]=n+i*l,e[5]=t-r*l,e[9]=-a*o,e[2]=r-t*l,e[6]=i+n*l,e[10]=s*o}else if("YXZ"===t.order){const t=o*u,n=o*h,i=l*u,r=l*h;e[0]=t+r*a,e[4]=i*a-n,e[8]=s*l,e[1]=s*h,e[5]=s*u,e[9]=-a,e[2]=n*a-i,e[6]=r+t*a,e[10]=s*o}else if("ZXY"===t.order){const t=o*u,n=o*h,i=l*u,r=l*h;e[0]=t-r*a,e[4]=-s*h,e[8]=i+n*a,e[1]=n+i*a,e[5]=s*u,e[9]=r-t*a,e[2]=-s*l,e[6]=a,e[10]=s*o}else if("ZYX"===t.order){const t=s*u,n=s*h,i=a*u,r=a*h;e[0]=o*u,e[4]=i*l-n,e[8]=t*l+r,e[1]=o*h,e[5]=r*l+t,e[9]=n*l-i,e[2]=-l,e[6]=a*o,e[10]=s*o}else if("YZX"===t.order){const t=s*o,n=s*l,i=a*o,r=a*l;e[0]=o*u,e[4]=r-t*h,e[8]=i*h+n,e[1]=h,e[5]=s*u,e[9]=-a*u,e[2]=-l*u,e[6]=n*h+i,e[10]=t-r*h}else if("XZY"===t.order){const t=s*o,n=s*l,i=a*o,r=a*l;e[0]=o*u,e[4]=-h,e[8]=l*u,e[1]=t*h+r,e[5]=s*u,e[9]=n*h-i,e[2]=i*h-n,e[6]=a*u,e[10]=r*h+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(JS,t,tM)}lookAt(t,e,n){const i=this.elements;return iM.subVectors(t,e),0===iM.lengthSq()&&(iM.z=1),iM.normalize(),eM.crossVectors(n,iM),0===eM.lengthSq()&&(1===Math.abs(n.z)?iM.x+=1e-4:iM.z+=1e-4,iM.normalize(),eM.crossVectors(n,iM)),eM.normalize(),nM.crossVectors(iM,eM),i[0]=eM.x,i[4]=nM.x,i[8]=iM.x,i[1]=eM.y,i[5]=nM.y,i[9]=iM.y,i[2]=eM.z,i[6]=nM.z,i[10]=iM.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,s=n[0],a=n[4],o=n[8],l=n[12],u=n[1],h=n[5],c=n[9],A=n[13],d=n[2],p=n[6],f=n[10],m=n[14],g=n[3],y=n[7],v=n[11],_=n[15],x=i[0],b=i[4],S=i[8],M=i[12],w=i[1],T=i[5],E=i[9],C=i[13],R=i[2],N=i[6],P=i[10],D=i[14],I=i[3],L=i[7],B=i[11],U=i[15];return r[0]=s*x+a*w+o*R+l*I,r[4]=s*b+a*T+o*N+l*L,r[8]=s*S+a*E+o*P+l*B,r[12]=s*M+a*C+o*D+l*U,r[1]=u*x+h*w+c*R+A*I,r[5]=u*b+h*T+c*N+A*L,r[9]=u*S+h*E+c*P+A*B,r[13]=u*M+h*C+c*D+A*U,r[2]=d*x+p*w+f*R+m*I,r[6]=d*b+p*T+f*N+m*L,r[10]=d*S+p*E+f*P+m*B,r[14]=d*M+p*C+f*D+m*U,r[3]=g*x+y*w+v*R+_*I,r[7]=g*b+y*T+v*N+_*L,r[11]=g*S+y*E+v*P+_*B,r[15]=g*M+y*C+v*D+_*U,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],s=t[1],a=t[5],o=t[9],l=t[13],u=t[2],h=t[6],c=t[10],A=t[14];return t[3]*(+r*o*h-i*l*h-r*a*c+n*l*c+i*a*A-n*o*A)+t[7]*(+e*o*A-e*l*c+r*s*c-i*s*A+i*l*u-r*o*u)+t[11]*(+e*l*h-e*a*A-r*s*h+n*s*A+r*a*u-n*l*u)+t[15]*(-i*a*u-e*o*h+e*a*c+i*s*h-n*s*c+n*o*u)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],u=t[8],h=t[9],c=t[10],A=t[11],d=t[12],p=t[13],f=t[14],m=t[15],g=h*f*l-p*c*l+p*o*A-a*f*A-h*o*m+a*c*m,y=d*c*l-u*f*l-d*o*A+s*f*A+u*o*m-s*c*m,v=u*p*l-d*h*l+d*a*A-s*p*A-u*a*m+s*h*m,_=d*h*o-u*p*o-d*a*c+s*p*c+u*a*f-s*h*f,x=e*g+n*y+i*v+r*_;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const b=1/x;return t[0]=g*b,t[1]=(p*c*r-h*f*r-p*i*A+n*f*A+h*i*m-n*c*m)*b,t[2]=(a*f*r-p*o*r+p*i*l-n*f*l-a*i*m+n*o*m)*b,t[3]=(h*o*r-a*c*r-h*i*l+n*c*l+a*i*A-n*o*A)*b,t[4]=y*b,t[5]=(u*f*r-d*c*r+d*i*A-e*f*A-u*i*m+e*c*m)*b,t[6]=(d*o*r-s*f*r-d*i*l+e*f*l+s*i*m-e*o*m)*b,t[7]=(s*c*r-u*o*r+u*i*l-e*c*l-s*i*A+e*o*A)*b,t[8]=v*b,t[9]=(d*h*r-u*p*r-d*n*A+e*p*A+u*n*m-e*h*m)*b,t[10]=(s*p*r-d*a*r+d*n*l-e*p*l-s*n*m+e*a*m)*b,t[11]=(u*a*r-s*h*r-u*n*l+e*h*l+s*n*A-e*a*A)*b,t[12]=_*b,t[13]=(u*p*i-d*h*i+d*n*c-e*p*c-u*n*f+e*h*f)*b,t[14]=(d*a*i-s*p*i-d*n*o+e*p*o+s*n*f-e*a*f)*b,t[15]=(s*h*i-u*a*i+u*n*o-e*h*o-s*n*c+e*a*c)*b,this}scale(t){const e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),i=Math.sin(e),r=1-n,s=t.x,a=t.y,o=t.z,l=r*s,u=r*a;return this.set(l*s+n,l*a-i*o,l*o+i*a,0,l*a+i*o,u*a+n,u*o-i*s,0,l*o-i*a,u*o+i*s,r*o*o+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,r,s){return this.set(1,n,r,0,t,1,s,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){const i=this.elements,r=e._x,s=e._y,a=e._z,o=e._w,l=r+r,u=s+s,h=a+a,c=r*l,A=r*u,d=r*h,p=s*u,f=s*h,m=a*h,g=o*l,y=o*u,v=o*h,_=n.x,x=n.y,b=n.z;return i[0]=(1-(p+m))*_,i[1]=(A+v)*_,i[2]=(d-y)*_,i[3]=0,i[4]=(A-v)*x,i[5]=(1-(c+m))*x,i[6]=(f+g)*x,i[7]=0,i[8]=(d+y)*b,i[9]=(f-g)*b,i[10]=(1-(c+p))*b,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){const i=this.elements;let r=ZS.set(i[0],i[1],i[2]).length();const s=ZS.set(i[4],i[5],i[6]).length(),a=ZS.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],KS.copy(this);const o=1/r,l=1/s,u=1/a;return KS.elements[0]*=o,KS.elements[1]*=o,KS.elements[2]*=o,KS.elements[4]*=l,KS.elements[5]*=l,KS.elements[6]*=l,KS.elements[8]*=u,KS.elements[9]*=u,KS.elements[10]*=u,e.setFromRotationMatrix(KS),n.x=r,n.y=s,n.z=a,this}makePerspective(t,e,n,i,r,s,a=2e3){const o=this.elements,l=2*r/(e-t),u=2*r/(n-i),h=(e+t)/(e-t),c=(n+i)/(n-i);let A,d;if(a===Ub)A=-(s+r)/(s-r),d=-2*s*r/(s-r);else{if(a!==Ob)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);A=-s/(s-r),d=-s*r/(s-r)}return o[0]=l,o[4]=0,o[8]=h,o[12]=0,o[1]=0,o[5]=u,o[9]=c,o[13]=0,o[2]=0,o[6]=0,o[10]=A,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(t,e,n,i,r,s,a=2e3){const o=this.elements,l=1/(e-t),u=1/(n-i),h=1/(s-r),c=(e+t)*l,A=(n+i)*u;let d,p;if(a===Ub)d=(s+r)*h,p=-2*h;else{if(a!==Ob)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);d=r*h,p=-1*h}return o[0]=2*l,o[4]=0,o[8]=0,o[12]=-c,o[1]=0,o[5]=2*u,o[9]=0,o[13]=-A,o[2]=0,o[6]=0,o[10]=p,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<16;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}const ZS=new _S,KS=new $S,JS=new _S(0,0,0),tM=new _S(1,1,1),eM=new _S,nM=new _S,iM=new _S,rM=new $S,sM=new vS;class aM{constructor(t=0,e=0,n=0,i=aM.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,i=this._order){return this._x=t,this._y=e,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const i=t.elements,r=i[0],s=i[4],a=i[8],o=i[1],l=i[5],u=i[9],h=i[2],c=i[6],A=i[10];switch(e){case"XYZ":this._y=Math.asin(Hb(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,A),this._z=Math.atan2(-s,r)):(this._x=Math.atan2(c,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Hb(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,A),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-h,r),this._z=0);break;case"ZXY":this._x=Math.asin(Hb(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(-h,A),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-Hb(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(c,A),this._z=Math.atan2(o,r)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(Hb(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-h,r)):(this._x=0,this._y=Math.atan2(a,A));break;case"XZY":this._z=Math.asin(-Hb(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(c,l),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-u,A),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===n&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return rM.makeRotationFromQuaternion(t),this.setFromRotationMatrix(rM,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return sM.setFromEuler(this),this.setFromQuaternion(sM,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}aM.DEFAULT_ORDER="XYZ";class oM{constructor(){this.mask=1}set(t){this.mask=1<<t>>>0}enable(t){this.mask|=1<<t}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t}disable(t){this.mask&=~(1<<t)}disableAll(){this.mask=0}test(t){return!!(this.mask&t.mask)}isEnabled(t){return!!(this.mask&1<<t)}}let lM=0;const uM=new _S,hM=new vS,cM=new $S,AM=new _S,dM=new _S,pM=new _S,fM=new vS,mM=new _S(1,0,0),gM=new _S(0,1,0),yM=new _S(0,0,1),vM={type:"added"},_M={type:"removed"},xM={type:"childadded",child:null},bM={type:"childremoved",child:null};class SM extends Fb{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:lM++}),this.uuid=Vb(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=SM.DEFAULT_UP.clone();const t=new _S,e=new aM,n=new vS,i=new _S(1,1,1);e._onChange((function(){n.setFromEuler(e,!1)})),n._onChange((function(){e.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new $S},normalMatrix:{value:new Zb}}),this.matrix=new $S,this.matrixWorld=new $S,this.matrixAutoUpdate=SM.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=SM.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new oM,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return hM.setFromAxisAngle(t,e),this.quaternion.multiply(hM),this}rotateOnWorldAxis(t,e){return hM.setFromAxisAngle(t,e),this.quaternion.premultiply(hM),this}rotateX(t){return this.rotateOnAxis(mM,t)}rotateY(t){return this.rotateOnAxis(gM,t)}rotateZ(t){return this.rotateOnAxis(yM,t)}translateOnAxis(t,e){return uM.copy(t).applyQuaternion(this.quaternion),this.position.add(uM.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(mM,t)}translateY(t){return this.translateOnAxis(gM,t)}translateZ(t){return this.translateOnAxis(yM,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(cM.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?AM.copy(t):AM.set(t,e,n);const i=this.parent;this.updateWorldMatrix(!0,!1),dM.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?cM.lookAt(dM,AM,this.up):cM.lookAt(AM,dM,this.up),this.quaternion.setFromRotationMatrix(cM),i&&(cM.extractRotation(i.matrixWorld),hM.setFromRotationMatrix(cM),this.quaternion.premultiply(hM.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(vM),xM.child=t,this.dispatchEvent(xM),xM.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}const e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(_M),bM.child=t,this.dispatchEvent(bM),bM.child=null),this}removeFromParent(){const t=this.parent;return null!==t&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),cM.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),cM.multiply(t.parent.matrixWorld)),t.applyMatrix4(cM),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(vM),xM.child=t,this.dispatchEvent(xM),xM.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,i=this.children.length;n<i;n++){const i=this.children[n].getObjectByProperty(t,e);if(void 0!==i)return i}}getObjectsByProperty(t,e,n=[]){this[t]===e&&n.push(this);const i=this.children;for(let r=0,s=i.length;r<s;r++)i[r].getObjectsByProperty(t,e,n);return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(dM,t,pM),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(dM,fM,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);const e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}traverseAncestors(t){const e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let n=0,i=e.length;n<i;n++){e[n].updateMatrixWorld(t)}}updateWorldMatrix(t,e){const n=this.parent;if(!0===t&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),!0===e){const t=this.children;for(let e=0,n=t.length;e<n;e++){t[e].updateWorldMatrix(!1,!0)}}}toJSON(t){const e=void 0===t||"string"==typeof t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const i={};function r(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map((t=>({boxInitialized:t.boxInitialized,boxMin:t.box.min.toArray(),boxMax:t.box.max.toArray(),sphereInitialized:t.sphereInitialized,sphereRadius:t.sphere.radius,sphereCenter:t.sphere.center.toArray()}))),i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(t),null!==this._colorsTexture&&(i.colorsTexture=this._colorsTexture.toJSON(t)),null!==this.boundingSphere&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),null!==this.boundingBox&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const n=e.shapes;if(Array.isArray(n))for(let e=0,i=n.length;e<i;e++){const i=n[e];r(t.shapes,i)}else r(t.shapes,n)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(t.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const e=[];for(let n=0,i=this.material.length;n<i;n++)e.push(r(t.materials,this.material[n]));i.material=e}else i.material=r(t.materials,this.material);if(this.children.length>0){i.children=[];for(let e=0;e<this.children.length;e++)i.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){i.animations=[];for(let e=0;e<this.animations.length;e++){const n=this.animations[e];i.animations.push(r(t.animations,n))}}if(e){const e=s(t.geometries),i=s(t.materials),r=s(t.textures),a=s(t.images),o=s(t.shapes),l=s(t.skeletons),u=s(t.animations),h=s(t.nodes);e.length>0&&(n.geometries=e),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),a.length>0&&(n.images=a),o.length>0&&(n.shapes=o),l.length>0&&(n.skeletons=l),u.length>0&&(n.animations=u),h.length>0&&(n.nodes=h)}return n.object=i,n;function s(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){const n=t.children[e];this.add(n.clone())}return this}}SM.DEFAULT_UP=new _S(0,1,0),SM.DEFAULT_MATRIX_AUTO_UPDATE=!0,SM.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const MM=new _S,wM=new _S,TM=new _S,EM=new _S,CM=new _S,RM=new _S,NM=new _S,PM=new _S,DM=new _S,IM=new _S,LM=new fS,BM=new fS,UM=new fS;class OM{constructor(t=new _S,e=new _S,n=new _S){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,i){i.subVectors(n,e),MM.subVectors(t,e),i.cross(MM);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(t,e,n,i,r){MM.subVectors(i,e),wM.subVectors(n,e),TM.subVectors(t,e);const s=MM.dot(MM),a=MM.dot(wM),o=MM.dot(TM),l=wM.dot(wM),u=wM.dot(TM),h=s*l-a*a;if(0===h)return r.set(0,0,0),null;const c=1/h,A=(l*o-a*u)*c,d=(s*u-a*o)*c;return r.set(1-A-d,d,A)}static containsPoint(t,e,n,i){return null!==this.getBarycoord(t,e,n,i,EM)&&(EM.x>=0&&EM.y>=0&&EM.x+EM.y<=1)}static getInterpolation(t,e,n,i,r,s,a,o){return null===this.getBarycoord(t,e,n,i,EM)?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(r,EM.x),o.addScaledVector(s,EM.y),o.addScaledVector(a,EM.z),o)}static getInterpolatedAttribute(t,e,n,i,r,s){return LM.setScalar(0),BM.setScalar(0),UM.setScalar(0),LM.fromBufferAttribute(t,e),BM.fromBufferAttribute(t,n),UM.fromBufferAttribute(t,i),s.setScalar(0),s.addScaledVector(LM,r.x),s.addScaledVector(BM,r.y),s.addScaledVector(UM,r.z),s}static isFrontFacing(t,e,n,i){return MM.subVectors(n,e),wM.subVectors(t,e),MM.cross(wM).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,n,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,i),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return MM.subVectors(this.c,this.b),wM.subVectors(this.a,this.b),.5*MM.cross(wM).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return OM.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return OM.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,i,r){return OM.getInterpolation(t,this.a,this.b,this.c,e,n,i,r)}containsPoint(t){return OM.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return OM.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,i=this.b,r=this.c;let s,a;CM.subVectors(i,n),RM.subVectors(r,n),PM.subVectors(t,n);const o=CM.dot(PM),l=RM.dot(PM);if(o<=0&&l<=0)return e.copy(n);DM.subVectors(t,i);const u=CM.dot(DM),h=RM.dot(DM);if(u>=0&&h<=u)return e.copy(i);const c=o*h-u*l;if(c<=0&&o>=0&&u<=0)return s=o/(o-u),e.copy(n).addScaledVector(CM,s);IM.subVectors(t,r);const A=CM.dot(IM),d=RM.dot(IM);if(d>=0&&A<=d)return e.copy(r);const p=A*l-o*d;if(p<=0&&l>=0&&d<=0)return a=l/(l-d),e.copy(n).addScaledVector(RM,a);const f=u*d-A*h;if(f<=0&&h-u>=0&&A-d>=0)return NM.subVectors(r,i),a=(h-u)/(h-u+(A-d)),e.copy(i).addScaledVector(NM,a);const m=1/(f+p+c);return s=p*m,a=c*m,e.copy(n).addScaledVector(CM,s).addScaledVector(RM,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const FM={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},kM={h:0,s:0,l:0},zM={h:0,s:0,l:0};function qM(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}class GM{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(void 0===e&&void 0===n){const e=t;e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=yb){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,sS.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=sS.workingColorSpace){return this.r=t,this.g=e,this.b=n,sS.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=sS.workingColorSpace){if(t=jb(t,1),e=Hb(e,0,1),n=Hb(n,0,1),0===e)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+e):n+e-n*e,r=2*n-i;this.r=qM(r,i,t+1/3),this.g=qM(r,i,t),this.b=qM(r,i,t-1/3)}return sS.toWorkingColorSpace(this,i),this}setStyle(t,e=yb){function n(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const s=i[1],a=i[2];switch(s){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const n=i[1],r=n.length;if(3===r)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,e);if(6===r)return this.setHex(parseInt(n,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=yb){const n=FM[t.toLowerCase()];return void 0!==n?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=aS(t.r),this.g=aS(t.g),this.b=aS(t.b),this}copyLinearToSRGB(t){return this.r=oS(t.r),this.g=oS(t.g),this.b=oS(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=yb){return sS.fromWorkingColorSpace(VM.copy(this),t),65536*Math.round(Hb(255*VM.r,0,255))+256*Math.round(Hb(255*VM.g,0,255))+Math.round(Hb(255*VM.b,0,255))}getHexString(t=yb){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=sS.workingColorSpace){sS.fromWorkingColorSpace(VM.copy(this),e);const n=VM.r,i=VM.g,r=VM.b,s=Math.max(n,i,r),a=Math.min(n,i,r);let o,l;const u=(a+s)/2;if(a===s)o=0,l=0;else{const t=s-a;switch(l=u<=.5?t/(s+a):t/(2-s-a),s){case n:o=(i-r)/t+(i<r?6:0);break;case i:o=(r-n)/t+2;break;case r:o=(n-i)/t+4}o/=6}return t.h=o,t.s=l,t.l=u,t}getRGB(t,e=sS.workingColorSpace){return sS.fromWorkingColorSpace(VM.copy(this),e),t.r=VM.r,t.g=VM.g,t.b=VM.b,t}getStyle(t=yb){sS.fromWorkingColorSpace(VM.copy(this),t);const e=VM.r,n=VM.g,i=VM.b;return t!==yb?`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(255*e)},${Math.round(255*n)},${Math.round(255*i)})`}offsetHSL(t,e,n){return this.getHSL(kM),this.setHSL(kM.h+t,kM.s+e,kM.l+n)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(kM),t.getHSL(zM);const n=Wb(kM.h,zM.h,e),i=Wb(kM.s,zM.s,e),r=Wb(kM.l,zM.l,e);return this.setHSL(n,i,r),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,n=this.g,i=this.b,r=t.elements;return this.r=r[0]*e+r[3]*n+r[6]*i,this.g=r[1]*e+r[4]*n+r[7]*i,this.b=r[2]*e+r[5]*n+r[8]*i,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const VM=new GM;GM.NAMES=FM;let HM=0;class jM extends Fb{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:HM++}),this.uuid=Vb(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Ax,this.blendDst=dx,this.blendEquation=sx,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new GM(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=wb,this.stencilZFail=wb,this.stencilZPass=wb,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const n=t[e];if(void 0===n){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const i=this[e];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n:console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`)}}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function i(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.dispersion&&(n.dispersion=this.dispersion),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),0!==this.side&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),this.blendSrc!==Ax&&(n.blendSrc=this.blendSrc),this.blendDst!==dx&&(n.blendDst=this.blendDst),this.blendEquation!==sx&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==wb&&(n.stencilFail=this.stencilFail),this.stencilZFail!==wb&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==wb&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),e){const e=i(t.textures),r=i(t.images);e.length>0&&(n.textures=e),r.length>0&&(n.images=r)}return n}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(null!==e){const t=e.length;n=new Array(t);for(let i=0;i!==t;++i)n[i]=e[i].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class WM extends jM{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new GM(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new aM,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const XM=YM();function YM(){const t=new ArrayBuffer(4),e=new Float32Array(t),n=new Uint32Array(t),i=new Uint32Array(512),r=new Uint32Array(512);for(let t=0;t<256;++t){const e=t-127;e<-27?(i[t]=0,i[256|t]=32768,r[t]=24,r[256|t]=24):e<-14?(i[t]=1024>>-e-14,i[256|t]=1024>>-e-14|32768,r[t]=-e-1,r[256|t]=-e-1):e<=15?(i[t]=e+15<<10,i[256|t]=e+15<<10|32768,r[t]=13,r[256|t]=13):e<128?(i[t]=31744,i[256|t]=64512,r[t]=24,r[256|t]=24):(i[t]=31744,i[256|t]=64512,r[t]=13,r[256|t]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let t=1;t<1024;++t){let e=t<<13,n=0;for(;!(8388608&e);)e<<=1,n-=8388608;e&=-8388609,n+=947912704,s[t]=e|n}for(let t=1024;t<2048;++t)s[t]=939524096+(t-1024<<13);for(let t=1;t<31;++t)a[t]=t<<23;a[31]=1199570944,a[32]=2147483648;for(let t=33;t<63;++t)a[t]=2147483648+(t-32<<23);a[63]=3347054592;for(let t=1;t<64;++t)32!==t&&(o[t]=1024);return{floatView:e,uint32View:n,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:a,offsetTable:o}}function QM(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=Hb(t,-65504,65504),XM.floatView[0]=t;const e=XM.uint32View[0],n=e>>23&511;return XM.baseTable[n]+((8388607&e)>>XM.shiftTable[n])}function $M(t){const e=t>>10;return XM.uint32View[0]=XM.mantissaTable[XM.offsetTable[e]+(1023&t)]+XM.exponentTable[e],XM.floatView[0]}const ZM=new _S,KM=new $b;class JM{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=n,this.usage=Lb,this.updateRanges=[],this.gpuType=Fx,this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[n+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,n=this.count;e<n;e++)KM.fromBufferAttribute(this,e),KM.applyMatrix3(t),this.setXY(e,KM.x,KM.y);else if(3===this.itemSize)for(let e=0,n=this.count;e<n;e++)ZM.fromBufferAttribute(this,e),ZM.applyMatrix3(t),this.setXYZ(e,ZM.x,ZM.y,ZM.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)ZM.fromBufferAttribute(this,e),ZM.applyMatrix4(t),this.setXYZ(e,ZM.x,ZM.y,ZM.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)ZM.fromBufferAttribute(this,e),ZM.applyNormalMatrix(t),this.setXYZ(e,ZM.x,ZM.y,ZM.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)ZM.fromBufferAttribute(this,e),ZM.transformDirection(t),this.setXYZ(e,ZM.x,ZM.y,ZM.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let n=this.array[t*this.itemSize+e];return this.normalized&&(n=Xb(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Yb(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Xb(e,this.array)),e}setX(t,e){return this.normalized&&(e=Yb(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Xb(e,this.array)),e}setY(t,e){return this.normalized&&(e=Yb(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Xb(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Yb(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Xb(e,this.array)),e}setW(t,e){return this.normalized&&(e=Yb(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=Yb(e,this.array),n=Yb(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=Yb(e,this.array),n=Yb(n,this.array),i=Yb(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this}setXYZW(t,e,n,i,r){return t*=this.itemSize,this.normalized&&(e=Yb(e,this.array),n=Yb(n,this.array),i=Yb(i,this.array),r=Yb(r,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=r,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),this.usage!==Lb&&(t.usage=this.usage),t}}class tw extends JM{constructor(t,e,n){super(new Uint16Array(t),e,n)}}class ew extends JM{constructor(t,e,n){super(new Uint32Array(t),e,n)}}class nw extends JM{constructor(t,e,n){super(new Uint16Array(t),e,n),this.isFloat16BufferAttribute=!0}getX(t){let e=$M(this.array[t*this.itemSize]);return this.normalized&&(e=Xb(e,this.array)),e}setX(t,e){return this.normalized&&(e=Yb(e,this.array)),this.array[t*this.itemSize]=QM(e),this}getY(t){let e=$M(this.array[t*this.itemSize+1]);return this.normalized&&(e=Xb(e,this.array)),e}setY(t,e){return this.normalized&&(e=Yb(e,this.array)),this.array[t*this.itemSize+1]=QM(e),this}getZ(t){let e=$M(this.array[t*this.itemSize+2]);return this.normalized&&(e=Xb(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Yb(e,this.array)),this.array[t*this.itemSize+2]=QM(e),this}getW(t){let e=$M(this.array[t*this.itemSize+3]);return this.normalized&&(e=Xb(e,this.array)),e}setW(t,e){return this.normalized&&(e=Yb(e,this.array)),this.array[t*this.itemSize+3]=QM(e),this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=Yb(e,this.array),n=Yb(n,this.array)),this.array[t+0]=QM(e),this.array[t+1]=QM(n),this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=Yb(e,this.array),n=Yb(n,this.array),i=Yb(i,this.array)),this.array[t+0]=QM(e),this.array[t+1]=QM(n),this.array[t+2]=QM(i),this}setXYZW(t,e,n,i,r){return t*=this.itemSize,this.normalized&&(e=Yb(e,this.array),n=Yb(n,this.array),i=Yb(i,this.array),r=Yb(r,this.array)),this.array[t+0]=QM(e),this.array[t+1]=QM(n),this.array[t+2]=QM(i),this.array[t+3]=QM(r),this}}class iw extends JM{constructor(t,e,n){super(new Float32Array(t),e,n)}}let rw=0;const sw=new $S,aw=new SM,ow=new _S,lw=new SS,uw=new SS,hw=new _S;class cw extends Fb{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:rw++}),this.uuid=Vb(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(function(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}(t)?ew:tw)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return void 0!==this.attributes[t]}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const e=(new Zb).getNormalMatrix(t);n.applyNormalMatrix(e),n.needsUpdate=!0}const i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(t),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(t){return sw.makeRotationFromQuaternion(t),this.applyMatrix4(sw),this}rotateX(t){return sw.makeRotationX(t),this.applyMatrix4(sw),this}rotateY(t){return sw.makeRotationY(t),this.applyMatrix4(sw),this}rotateZ(t){return sw.makeRotationZ(t),this.applyMatrix4(sw),this}translate(t,e,n){return sw.makeTranslation(t,e,n),this.applyMatrix4(sw),this}scale(t,e,n){return sw.makeScale(t,e,n),this.applyMatrix4(sw),this}lookAt(t){return aw.lookAt(t),aw.updateMatrix(),this.applyMatrix4(aw.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ow).negate(),this.translate(ow.x,ow.y,ow.z),this}setFromPoints(t){const e=[];for(let n=0,i=t.length;n<i;n++){const i=t[n];e.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new iw(e,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new SS);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new _S(-1/0,-1/0,-1/0),new _S(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];lw.setFromBufferAttribute(n),this.morphTargetsRelative?(hw.addVectors(this.boundingBox.min,lw.min),this.boundingBox.expandByPoint(hw),hw.addVectors(this.boundingBox.max,lw.max),this.boundingBox.expandByPoint(hw)):(this.boundingBox.expandByPoint(lw.min),this.boundingBox.expandByPoint(lw.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new qS);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new _S,1/0);if(t){const n=this.boundingSphere.center;if(lw.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];uw.setFromBufferAttribute(n),this.morphTargetsRelative?(hw.addVectors(lw.min,uw.min),lw.expandByPoint(hw),hw.addVectors(lw.max,uw.max),lw.expandByPoint(hw)):(lw.expandByPoint(uw.min),lw.expandByPoint(uw.max))}lw.getCenter(n);let i=0;for(let e=0,r=t.count;e<r;e++)hw.fromBufferAttribute(t,e),i=Math.max(i,n.distanceToSquared(hw));if(e)for(let r=0,s=e.length;r<s;r++){const s=e[r],a=this.morphTargetsRelative;for(let e=0,r=s.count;e<r;e++)hw.fromBufferAttribute(s,e),a&&(ow.fromBufferAttribute(t,e),hw.add(ow)),i=Math.max(i,n.distanceToSquared(hw))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=e.position,i=e.normal,r=e.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new JM(new Float32Array(4*n.count),4));const s=this.getAttribute("tangent"),a=[],o=[];for(let t=0;t<n.count;t++)a[t]=new _S,o[t]=new _S;const l=new _S,u=new _S,h=new _S,c=new $b,A=new $b,d=new $b,p=new _S,f=new _S;function m(t,e,i){l.fromBufferAttribute(n,t),u.fromBufferAttribute(n,e),h.fromBufferAttribute(n,i),c.fromBufferAttribute(r,t),A.fromBufferAttribute(r,e),d.fromBufferAttribute(r,i),u.sub(l),h.sub(l),A.sub(c),d.sub(c);const s=1/(A.x*d.y-d.x*A.y);isFinite(s)&&(p.copy(u).multiplyScalar(d.y).addScaledVector(h,-A.y).multiplyScalar(s),f.copy(h).multiplyScalar(A.x).addScaledVector(u,-d.x).multiplyScalar(s),a[t].add(p),a[e].add(p),a[i].add(p),o[t].add(f),o[e].add(f),o[i].add(f))}let g=this.groups;0===g.length&&(g=[{start:0,count:t.count}]);for(let e=0,n=g.length;e<n;++e){const n=g[e],i=n.start;for(let e=i,r=i+n.count;e<r;e+=3)m(t.getX(e+0),t.getX(e+1),t.getX(e+2))}const y=new _S,v=new _S,_=new _S,x=new _S;function b(t){_.fromBufferAttribute(i,t),x.copy(_);const e=a[t];y.copy(e),y.sub(_.multiplyScalar(_.dot(e))).normalize(),v.crossVectors(x,e);const n=v.dot(o[t])<0?-1:1;s.setXYZW(t,y.x,y.y,y.z,n)}for(let e=0,n=g.length;e<n;++e){const n=g[e],i=n.start;for(let e=i,r=i+n.count;e<r;e+=3)b(t.getX(e+0)),b(t.getX(e+1)),b(t.getX(e+2))}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let n=this.getAttribute("normal");if(void 0===n)n=new JM(new Float32Array(3*e.count),3),this.setAttribute("normal",n);else for(let t=0,e=n.count;t<e;t++)n.setXYZ(t,0,0,0);const i=new _S,r=new _S,s=new _S,a=new _S,o=new _S,l=new _S,u=new _S,h=new _S;if(t)for(let c=0,A=t.count;c<A;c+=3){const A=t.getX(c+0),d=t.getX(c+1),p=t.getX(c+2);i.fromBufferAttribute(e,A),r.fromBufferAttribute(e,d),s.fromBufferAttribute(e,p),u.subVectors(s,r),h.subVectors(i,r),u.cross(h),a.fromBufferAttribute(n,A),o.fromBufferAttribute(n,d),l.fromBufferAttribute(n,p),a.add(u),o.add(u),l.add(u),n.setXYZ(A,a.x,a.y,a.z),n.setXYZ(d,o.x,o.y,o.z),n.setXYZ(p,l.x,l.y,l.z)}else for(let t=0,a=e.count;t<a;t+=3)i.fromBufferAttribute(e,t+0),r.fromBufferAttribute(e,t+1),s.fromBufferAttribute(e,t+2),u.subVectors(s,r),h.subVectors(i,r),u.cross(h),n.setXYZ(t+0,u.x,u.y,u.z),n.setXYZ(t+1,u.x,u.y,u.z),n.setXYZ(t+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)hw.fromBufferAttribute(t,e),hw.normalize(),t.setXYZ(e,hw.x,hw.y,hw.z)}toNonIndexed(){function t(t,e){const n=t.array,i=t.itemSize,r=t.normalized,s=new n.constructor(e.length*i);let a=0,o=0;for(let r=0,l=e.length;r<l;r++){a=t.isInterleavedBufferAttribute?e[r]*t.data.stride+t.offset:e[r]*i;for(let t=0;t<i;t++)s[o++]=n[a++]}return new JM(s,i,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new cw,n=this.index.array,i=this.attributes;for(const r in i){const s=t(i[r],n);e.setAttribute(r,s)}const r=this.morphAttributes;for(const i in r){const s=[],a=r[i];for(let e=0,i=a.length;e<i;e++){const i=t(a[e],n);s.push(i)}e.morphAttributes[i]=s}e.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let t=0,n=s.length;t<n;t++){const n=s[t];e.addGroup(n.start,n.count,n.materialIndex)}return e}toJSON(){const t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const e in n){const i=n[e];t.data.attributes[e]=i.toJSON(t.data)}const i={};let r=!1;for(const e in this.morphAttributes){const n=this.morphAttributes[e],s=[];for(let e=0,i=n.length;e<i;e++){const i=n[e];s.push(i.toJSON(t.data))}s.length>0&&(i[e]=s,r=!0)}r&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return null!==a&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;null!==n&&this.setIndex(n.clone(e));const i=t.attributes;for(const t in i){const n=i[t];this.setAttribute(t,n.clone(e))}const r=t.morphAttributes;for(const t in r){const n=[],i=r[t];for(let t=0,r=i.length;t<r;t++)n.push(i[t].clone(e));this.morphAttributes[t]=n}this.morphTargetsRelative=t.morphTargetsRelative;const s=t.groups;for(let t=0,e=s.length;t<e;t++){const e=s[t];this.addGroup(e.start,e.count,e.materialIndex)}const a=t.boundingBox;null!==a&&(this.boundingBox=a.clone());const o=t.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const Aw=new $S,dw=new QS,pw=new qS,fw=new _S,mw=new _S,gw=new _S,yw=new _S,vw=new _S,_w=new _S,xw=new _S,bw=new _S;class Sw extends SM{constructor(t=new cw,e=new WM){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t<e;t++){const e=n[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}getVertexPosition(t,e){const n=this.geometry,i=n.attributes.position,r=n.morphAttributes.position,s=n.morphTargetsRelative;e.fromBufferAttribute(i,t);const a=this.morphTargetInfluences;if(r&&a){_w.set(0,0,0);for(let n=0,i=r.length;n<i;n++){const i=a[n],o=r[n];0!==i&&(vw.fromBufferAttribute(o,t),s?_w.addScaledVector(vw,i):_w.addScaledVector(vw.sub(e),i))}e.add(_w)}return e}raycast(t,e){const n=this.geometry,i=this.material,r=this.matrixWorld;if(void 0!==i){if(null===n.boundingSphere&&n.computeBoundingSphere(),pw.copy(n.boundingSphere),pw.applyMatrix4(r),dw.copy(t.ray).recast(t.near),!1===pw.containsPoint(dw.origin)){if(null===dw.intersectSphere(pw,fw))return;if(dw.origin.distanceToSquared(fw)>(t.far-t.near)**2)return}Aw.copy(r).invert(),dw.copy(t.ray).applyMatrix4(Aw),null!==n.boundingBox&&!1===dw.intersectsBox(n.boundingBox)||this._computeIntersections(t,e,dw)}}_computeIntersections(t,e,n){let i;const r=this.geometry,s=this.material,a=r.index,o=r.attributes.position,l=r.attributes.uv,u=r.attributes.uv1,h=r.attributes.normal,c=r.groups,A=r.drawRange;if(null!==a)if(Array.isArray(s))for(let r=0,o=c.length;r<o;r++){const o=c[r],d=s[o.materialIndex];for(let r=Math.max(o.start,A.start),s=Math.min(a.count,Math.min(o.start+o.count,A.start+A.count));r<s;r+=3){i=Mw(this,d,t,n,l,u,h,a.getX(r),a.getX(r+1),a.getX(r+2)),i&&(i.faceIndex=Math.floor(r/3),i.face.materialIndex=o.materialIndex,e.push(i))}}else{for(let r=Math.max(0,A.start),o=Math.min(a.count,A.start+A.count);r<o;r+=3){i=Mw(this,s,t,n,l,u,h,a.getX(r),a.getX(r+1),a.getX(r+2)),i&&(i.faceIndex=Math.floor(r/3),e.push(i))}}else if(void 0!==o)if(Array.isArray(s))for(let r=0,a=c.length;r<a;r++){const a=c[r],d=s[a.materialIndex];for(let r=Math.max(a.start,A.start),s=Math.min(o.count,Math.min(a.start+a.count,A.start+A.count));r<s;r+=3){i=Mw(this,d,t,n,l,u,h,r,r+1,r+2),i&&(i.faceIndex=Math.floor(r/3),i.face.materialIndex=a.materialIndex,e.push(i))}}else{for(let r=Math.max(0,A.start),a=Math.min(o.count,A.start+A.count);r<a;r+=3){i=Mw(this,s,t,n,l,u,h,r,r+1,r+2),i&&(i.faceIndex=Math.floor(r/3),e.push(i))}}}}function Mw(t,e,n,i,r,s,a,o,l,u){t.getVertexPosition(o,mw),t.getVertexPosition(l,gw),t.getVertexPosition(u,yw);const h=function(t,e,n,i,r,s,a,o){let l;if(l=1===e.side?i.intersectTriangle(a,s,r,!0,o):i.intersectTriangle(r,s,a,0===e.side,o),null===l)return null;bw.copy(o),bw.applyMatrix4(t.matrixWorld);const u=n.ray.origin.distanceTo(bw);return u<n.near||u>n.far?null:{distance:u,point:bw.clone(),object:t}}(t,e,n,i,mw,gw,yw,xw);if(h){const t=new _S;OM.getBarycoord(xw,mw,gw,yw,t),r&&(h.uv=OM.getInterpolatedAttribute(r,o,l,u,t,new $b)),s&&(h.uv1=OM.getInterpolatedAttribute(s,o,l,u,t,new $b)),a&&(h.normal=OM.getInterpolatedAttribute(a,o,l,u,t,new _S),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const e={a:o,b:l,c:u,normal:new _S,materialIndex:0};OM.getNormal(mw,gw,yw,e.normal),h.face=e,h.barycoord=t}return h}class ww extends cw{constructor(t=1,e=1,n=1,i=1,r=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:s};const a=this;i=Math.floor(i),r=Math.floor(r),s=Math.floor(s);const o=[],l=[],u=[],h=[];let c=0,A=0;function d(t,e,n,i,r,s,d,p,f,m,g){const y=s/f,v=d/m,_=s/2,x=d/2,b=p/2,S=f+1,M=m+1;let w=0,T=0;const E=new _S;for(let s=0;s<M;s++){const a=s*v-x;for(let o=0;o<S;o++){const c=o*y-_;E[t]=c*i,E[e]=a*r,E[n]=b,l.push(E.x,E.y,E.z),E[t]=0,E[e]=0,E[n]=p>0?1:-1,u.push(E.x,E.y,E.z),h.push(o/f),h.push(1-s/m),w+=1}}for(let t=0;t<m;t++)for(let e=0;e<f;e++){const n=c+e+S*t,i=c+e+S*(t+1),r=c+(e+1)+S*(t+1),s=c+(e+1)+S*t;o.push(n,i,s),o.push(i,r,s),T+=6}a.addGroup(A,T,g),A+=T,c+=w}d("z","y","x",-1,-1,n,e,t,s,r,0),d("z","y","x",1,-1,n,e,-t,s,r,1),d("x","z","y",1,1,t,n,e,i,s,2),d("x","z","y",1,-1,t,n,-e,i,s,3),d("x","y","z",1,-1,t,e,n,i,r,4),d("x","y","z",-1,-1,t,e,-n,i,r,5),this.setIndex(o),this.setAttribute("position",new iw(l,3)),this.setAttribute("normal",new iw(u,3)),this.setAttribute("uv",new iw(h,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new ww(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function Tw(t){const e={};for(const n in t){e[n]={};for(const i in t[n]){const r=t[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[n][i]=null):e[n][i]=r.clone():Array.isArray(r)?e[n][i]=r.slice():e[n][i]=r}}return e}class Ew extends jM{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="\nvoid main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",this.fragmentShader="\nvoid main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}\n",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==t&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Tw(t.uniforms),this.uniformsGroups=function(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].clone());return e}(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const n in this.uniforms){const i=this.uniforms[n].value;i&&i.isTexture?e.uniforms[n]={type:"t",value:i.toJSON(t).uuid}:i&&i.isColor?e.uniforms[n]={type:"c",value:i.getHex()}:i&&i.isVector2?e.uniforms[n]={type:"v2",value:i.toArray()}:i&&i.isVector3?e.uniforms[n]={type:"v3",value:i.toArray()}:i&&i.isVector4?e.uniforms[n]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?e.uniforms[n]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?e.uniforms[n]={type:"m4",value:i.toArray()}:e.uniforms[n]={value:i}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const n={};for(const t in this.extensions)!0===this.extensions[t]&&(n[t]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}class Cw extends SM{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new $S,this.projectionMatrix=new $S,this.projectionMatrixInverse=new $S,this.coordinateSystem=Ub}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}const Rw=new _S,Nw=new $b,Pw=new $b;class Dw extends Cw{constructor(t=50,e=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=2*Gb*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*qb*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*Gb*Math.atan(Math.tan(.5*qb*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){Rw.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(Rw.x,Rw.y).multiplyScalar(-t/Rw.z),Rw.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Rw.x,Rw.y).multiplyScalar(-t/Rw.z)}getViewSize(t,e){return this.getViewBounds(t,Nw,Pw),e.subVectors(Pw,Nw)}setViewOffset(t,e,n,i,r,s){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*qb*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i;const s=this.view;if(null!==this.view&&this.view.enabled){const t=s.fullWidth,a=s.fullHeight;r+=s.offsetX*i/t,e-=s.offsetY*n/a,i*=s.width/t,n*=s.height/a}const a=this.filmOffset;0!==a&&(r+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const Iw=-90;class Lw extends SM{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new Dw(Iw,1,t,e);i.layers=this.layers,this.add(i);const r=new Dw(Iw,1,t,e);r.layers=this.layers,this.add(r);const s=new Dw(Iw,1,t,e);s.layers=this.layers,this.add(s);const a=new Dw(Iw,1,t,e);a.layers=this.layers,this.add(a);const o=new Dw(Iw,1,t,e);o.layers=this.layers,this.add(o);const l=new Dw(Iw,1,t,e);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[n,i,r,s,a,o]=e;for(const t of e)this.remove(t);if(t===Ub)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else{if(t!==Ob)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),o.up.set(0,-1,0),o.lookAt(0,0,-1)}for(const t of e)this.add(t),t.updateMatrixWorld()}update(t,e){null===this.parent&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[r,s,a,o,l,u]=this.children,h=t.getRenderTarget(),c=t.getActiveCubeFace(),A=t.getActiveMipmapLevel(),d=t.xr.enabled;t.xr.enabled=!1;const p=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,i),t.render(e,r),t.setRenderTarget(n,1,i),t.render(e,s),t.setRenderTarget(n,2,i),t.render(e,a),t.setRenderTarget(n,3,i),t.render(e,o),t.setRenderTarget(n,4,i),t.render(e,l),n.texture.generateMipmaps=p,t.setRenderTarget(n,5,i),t.render(e,u),t.setRenderTarget(h,c,A),t.xr.enabled=d,n.texture.needsPMREMUpdate=!0}}class Bw extends pS{constructor(t,e,n,i,r,s,a,o,l,u){super(t=void 0!==t?t:[],e=void 0!==e?e:vx,n,i,r,s,a,o,l,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class Uw extends gS{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const n={width:t,height:t,depth:1},i=[n,n,n,n,n,n];this.texture=new Bw(i,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:Rx}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},i=new ww(5,5,5),r=new Ew({name:"CubemapFromEquirect",uniforms:Tw(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=e;const s=new Sw(i,r),a=e.minFilter;e.minFilter===Px&&(e.minFilter=Rx);return new Lw(1,10,this).update(t,s),e.minFilter=a,s.geometry.dispose(),s.material.dispose(),this}clear(t,e,n,i){const r=t.getRenderTarget();for(let r=0;r<6;r++)t.setRenderTarget(this,r),t.clear(e,n,i);t.setRenderTarget(r)}}class Ow extends SM{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new aM,this.environmentIntensity=1,this.environmentRotation=new aM,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}}class Fw{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=Lb,this.updateRanges=[],this.version=0,this.uuid=Vb()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let i=0,r=this.stride;i<r;i++)this.array[t+i]=e.array[n+i];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Vb()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(e,this.stride);return n.setUsage(this.usage),n}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Vb()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const kw=new _S;class zw{constructor(t,e,n,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=n,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,n=this.data.count;e<n;e++)kw.fromBufferAttribute(this,e),kw.applyMatrix4(t),this.setXYZ(e,kw.x,kw.y,kw.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)kw.fromBufferAttribute(this,e),kw.applyNormalMatrix(t),this.setXYZ(e,kw.x,kw.y,kw.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)kw.fromBufferAttribute(this,e),kw.transformDirection(t),this.setXYZ(e,kw.x,kw.y,kw.z);return this}getComponent(t,e){let n=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(n=Xb(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Yb(n,this.array)),this.data.array[t*this.data.stride+this.offset+e]=n,this}setX(t,e){return this.normalized&&(e=Yb(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=Yb(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=Yb(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=Yb(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=Xb(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=Xb(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=Xb(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=Xb(e,this.array)),e}setXY(t,e,n){return t=t*this.data.stride+this.offset,this.normalized&&(e=Yb(e,this.array),n=Yb(n,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this}setXYZ(t,e,n,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=Yb(e,this.array),n=Yb(n,this.array),i=Yb(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this}setXYZW(t,e,n,i,r){return t=t*this.data.stride+this.offset,this.normalized&&(e=Yb(e,this.array),n=Yb(n,this.array),i=Yb(i,this.array),r=Yb(r,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this.data.array[t+3]=r,this}clone(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const n=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[n+e])}return new JM(new this.array.constructor(t),this.itemSize,this.normalized)}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new zw(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const n=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[n+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class qw extends jM{constructor(t){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new GM(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}class Gw extends pS{constructor(t=null,e=1,n=1,i,r,s,a,o,l=1003,u=1003,h,c){super(null,s,a,o,l,u,i,r,h,c),this.isDataTexture=!0,this.image={data:t,width:e,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Vw extends JM{constructor(t,e,n,i=1){super(t,e,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){const t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}const Hw=new _S,jw=new _S,Ww=new Zb;class Xw{constructor(t=new _S(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){const i=Hw.subVectors(n,e).cross(jw.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const n=t.delta(Hw),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const r=-(t.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:e.copy(t.start).addScaledVector(n,r)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||Ww.getNormalMatrix(t),i=this.coplanarPoint(Hw).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const Yw=new qS,Qw=new _S;class $w{constructor(t=new Xw,e=new Xw,n=new Xw,i=new Xw,r=new Xw,s=new Xw){this.planes=[t,e,n,i,r,s]}set(t,e,n,i,r,s){const a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(r),a[5].copy(s),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=2e3){const n=this.planes,i=t.elements,r=i[0],s=i[1],a=i[2],o=i[3],l=i[4],u=i[5],h=i[6],c=i[7],A=i[8],d=i[9],p=i[10],f=i[11],m=i[12],g=i[13],y=i[14],v=i[15];if(n[0].setComponents(o-r,c-l,f-A,v-m).normalize(),n[1].setComponents(o+r,c+l,f+A,v+m).normalize(),n[2].setComponents(o+s,c+u,f+d,v+g).normalize(),n[3].setComponents(o-s,c-u,f-d,v-g).normalize(),n[4].setComponents(o-a,c-h,f-p,v-y).normalize(),e===Ub)n[5].setComponents(o+a,c+h,f+p,v+y).normalize();else{if(e!==Ob)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);n[5].setComponents(a,h,p,y).normalize()}return this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),Yw.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),Yw.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Yw)}intersectsSprite(t){return Yw.center.set(0,0,0),Yw.radius=.7071067811865476,Yw.applyMatrix4(t.matrixWorld),this.intersectsSphere(Yw)}intersectsSphere(t){const e=this.planes,n=t.center,i=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(n)<i)return!1}return!0}intersectsBox(t){const e=this.planes;for(let n=0;n<6;n++){const i=e[n];if(Qw.x=i.normal.x>0?t.max.x:t.min.x,Qw.y=i.normal.y>0?t.max.y:t.min.y,Qw.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(Qw)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}class Zw extends jM{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new GM(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}class Kw extends jM{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new GM(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}class Jw extends pS{constructor(t,e){super({width:t,height:e}),this.isFramebufferTexture=!0,this.magFilter=Tx,this.minFilter=Tx,this.generateMipmaps=!1,this.needsUpdate=!0}}class tT extends pS{constructor(t,e,n,i,r,s,a,o,l,u=1026){if(u!==Vx&&u!==Hx)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&u===Vx&&(n=Ox),void 0===n&&u===Hx&&(n=zx),super(null,i,r,s,a,o,u,n,l),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=void 0!==a?a:Tx,this.minFilter=void 0!==o?o:Tx,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return null!==this.compareFunction&&(e.compareFunction=this.compareFunction),e}}class eT extends cw{constructor(t=1,e=32,n=16,i=0,r=2*Math.PI,s=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:s,thetaLength:a},e=Math.max(3,Math.floor(e)),n=Math.max(2,Math.floor(n));const o=Math.min(s+a,Math.PI);let l=0;const u=[],h=new _S,c=new _S,A=[],d=[],p=[],f=[];for(let A=0;A<=n;A++){const m=[],g=A/n;let y=0;0===A&&0===s?y=.5/e:A===n&&o===Math.PI&&(y=-.5/e);for(let n=0;n<=e;n++){const o=n/e;h.x=-t*Math.cos(i+o*r)*Math.sin(s+g*a),h.y=t*Math.cos(s+g*a),h.z=t*Math.sin(i+o*r)*Math.sin(s+g*a),d.push(h.x,h.y,h.z),c.copy(h).normalize(),p.push(c.x,c.y,c.z),f.push(o+y,1-g),m.push(l++)}u.push(m)}for(let t=0;t<n;t++)for(let i=0;i<e;i++){const e=u[t][i+1],r=u[t][i],a=u[t+1][i],l=u[t+1][i+1];(0!==t||s>0)&&A.push(e,r,l),(t!==n-1||o<Math.PI)&&A.push(r,a,l)}this.setIndex(A),this.setAttribute("position",new iw(d,3)),this.setAttribute("normal",new iw(p,3)),this.setAttribute("uv",new iw(f,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new eT(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class nT extends jM{constructor(t){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new GM(0),this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.fog=t.fog,this}}class iT extends jM{constructor(t){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new GM(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new GM(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new $b(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new aM,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.envMapIntensity=t.envMapIntensity,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class rT extends iT{constructor(t){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new $b(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Hb(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new GM(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new GM(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new GM(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(t)}get anisotropy(){return this._anisotropy}set anisotropy(t){this._anisotropy>0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get dispersion(){return this._dispersion}set dispersion(t){this._dispersion>0!=t>0&&this.version++,this._dispersion=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.dispersion=t.dispersion,this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class sT extends jM{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new GM(16777215),this.specular=new GM(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new GM(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new $b(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new aM,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class aT extends jM{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new GM(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new GM(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new $b(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}class oT extends jM{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new $b(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}class lT extends jM{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new GM(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new GM(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new $b(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new aM,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class uT extends jM{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new GM(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new $b(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.flatShading=t.flatShading,this.fog=t.fog,this}}class hT extends Zw{constructor(t){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}class cT extends SM{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new GM(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),void 0!==this.target&&(e.object.target=this.target.uuid),e}}class AT extends cT{constructor(t,e,n){super(t,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(SM.DEFAULT_UP),this.updateMatrix(),this.groundColor=new GM(e)}copy(t,e){return super.copy(t,e),this.groundColor.copy(t.groundColor),this}}const dT=new $S,pT=new _S,fT=new _S;class mT{constructor(t){this.camera=t,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new $b(512,512),this.map=null,this.mapPass=null,this.matrix=new $S,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new $w,this._frameExtents=new $b(1,1),this._viewportCount=1,this._viewports=[new fS(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,n=this.matrix;pT.setFromMatrixPosition(t.matrixWorld),e.position.copy(pT),fT.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(fT),e.updateMatrixWorld(),dT.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(dT),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(dT)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.intensity=t.intensity,this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const t={};return 1!==this.intensity&&(t.intensity=this.intensity),0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class gT extends mT{constructor(){super(new Dw(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(t){const e=this.camera,n=2*Gb*t.angle*this.focus,i=this.mapSize.width/this.mapSize.height,r=t.distance||e.far;n===e.fov&&i===e.aspect&&r===e.far||(e.fov=n,e.aspect=i,e.far=r,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}}class yT extends cT{constructor(t,e,n=0,i=Math.PI/3,r=0,s=2){super(t,e),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(SM.DEFAULT_UP),this.updateMatrix(),this.target=new SM,this.distance=n,this.angle=i,this.penumbra=r,this.decay=s,this.map=null,this.shadow=new gT}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}const vT=new $S,_T=new _S,xT=new _S;class bT extends mT{constructor(){super(new Dw(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new $b(4,2),this._viewportCount=6,this._viewports=[new fS(2,1,1,1),new fS(0,1,1,1),new fS(3,1,1,1),new fS(1,1,1,1),new fS(3,0,1,1),new fS(1,0,1,1)],this._cubeDirections=[new _S(1,0,0),new _S(-1,0,0),new _S(0,0,1),new _S(0,0,-1),new _S(0,1,0),new _S(0,-1,0)],this._cubeUps=[new _S(0,1,0),new _S(0,1,0),new _S(0,1,0),new _S(0,1,0),new _S(0,0,1),new _S(0,0,-1)]}updateMatrices(t,e=0){const n=this.camera,i=this.matrix,r=t.distance||n.far;r!==n.far&&(n.far=r,n.updateProjectionMatrix()),_T.setFromMatrixPosition(t.matrixWorld),n.position.copy(_T),xT.copy(n.position),xT.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(xT),n.updateMatrixWorld(),i.makeTranslation(-_T.x,-_T.y,-_T.z),vT.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(vT)}}class ST extends cT{constructor(t,e,n=0,i=2){super(t,e),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new bT}get power(){return 4*this.intensity*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}class MT extends Cw{constructor(t=-1,e=1,n=1,i=-1,r=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=r,this.far=s,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,n,i,r,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let r=n-t,s=n+t,a=i+e,o=i-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX,s=r+t*this.view.width,a-=e*this.view.offsetY,o=a-e*this.view.height}this.projectionMatrix.makeOrthographic(r,s,a,o,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}class wT extends mT{constructor(){super(new MT(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class TT extends cT{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(SM.DEFAULT_UP),this.updateMatrix(),this.target=new SM,this.shadow=new wT}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}class ET extends cT{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight"}}class CT extends cT{constructor(t,e,n=10,i=10){super(t,e),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=i}get power(){return this.intensity*this.width*this.height*Math.PI}set power(t){this.intensity=t/(this.width*this.height*Math.PI)}copy(t){return super.copy(t),this.width=t.width,this.height=t.height,this}toJSON(t){const e=super.toJSON(t);return e.object.width=this.width,e.object.height=this.height,e}}class RT{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new _S)}set(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this}zero(){for(let t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this}getAt(t,e){const n=t.x,i=t.y,r=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.282095),e.addScaledVector(s[1],.488603*i),e.addScaledVector(s[2],.488603*r),e.addScaledVector(s[3],.488603*n),e.addScaledVector(s[4],n*i*1.092548),e.addScaledVector(s[5],i*r*1.092548),e.addScaledVector(s[6],.315392*(3*r*r-1)),e.addScaledVector(s[7],n*r*1.092548),e.addScaledVector(s[8],.546274*(n*n-i*i)),e}getIrradianceAt(t,e){const n=t.x,i=t.y,r=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.886227),e.addScaledVector(s[1],1.023328*i),e.addScaledVector(s[2],1.023328*r),e.addScaledVector(s[3],1.023328*n),e.addScaledVector(s[4],.858086*n*i),e.addScaledVector(s[5],.858086*i*r),e.addScaledVector(s[6],.743125*r*r-.247708),e.addScaledVector(s[7],.858086*n*r),e.addScaledVector(s[8],.429043*(n*n-i*i)),e}add(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}addScaledSH(t,e){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(t.coefficients[n],e);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,e){for(let n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this}equals(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0}copy(t){return this.set(t.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(t,e=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].fromArray(t,e+3*i);return this}toArray(t=[],e=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].toArray(t,e+3*i);return t}static getBasisAt(t,e){const n=t.x,i=t.y,r=t.z;e[0]=.282095,e[1]=.488603*i,e[2]=.488603*r,e[3]=.488603*n,e[4]=1.092548*n*i,e[5]=1.092548*i*r,e[6]=.315392*(3*r*r-1),e[7]=1.092548*n*r,e[8]=.546274*(n*n-i*i)}}class NT extends cT{constructor(t=new RT,e=1){super(void 0,e),this.isLightProbe=!0,this.sh=t}copy(t){return super.copy(t),this.sh.copy(t.sh),this}fromJSON(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this}toJSON(t){const e=super.toJSON(t);return e.object.sh=this.sh.toArray(),e}}class PT extends Fw{constructor(t,e,n=1){super(t,e),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){const e=super.clone(t);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(t){const e=super.toJSON(t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}}const DT=["alphaMap","alphaTest","anisotropy","anisotropyMap","anisotropyRotation","aoMap","attenuationColor","attenuationDistance","bumpMap","clearcoat","clearcoatMap","clearcoatNormalMap","clearcoatNormalScale","clearcoatRoughness","color","dispersion","displacementMap","emissive","emissiveMap","envMap","gradientMap","ior","iridescence","iridescenceIOR","iridescenceMap","iridescenceThicknessMap","lightMap","map","matcap","metalness","metalnessMap","normalMap","normalScale","opacity","roughness","roughnessMap","sheen","sheenColor","sheenColorMap","sheenRoughnessMap","shininess","specular","specularColor","specularColorMap","specularIntensity","specularIntensityMap","specularMap","thickness","transmission","transmissionMap"];class IT{constructor(t){this.renderObjects=new WeakMap,this.hasNode=this.containsNode(t),this.hasAnimation=!0===t.object.isSkinnedMesh,this.refreshUniforms=DT,this.renderId=0}firstInitialization(t){return!1===this.renderObjects.has(t)&&(this.getRenderObjectData(t),!0)}getRenderObjectData(t){let e=this.renderObjects.get(t);return void 0===e&&(e={material:this.getMaterialData(t.material),worldMatrix:t.object.matrixWorld.clone()},t.object.center&&(e.center=t.object.center.clone()),t.object.morphTargetInfluences&&(e.morphTargetInfluences=t.object.morphTargetInfluences.slice()),null!==t.bundle&&(e.version=t.bundle.version),this.renderObjects.set(t,e)),e}containsNode(t){const e=t.material;for(const t in e)if(e[t]&&e[t].isNode)return!0;return null!==t.renderer.nodes.modelViewMatrix||null!==t.renderer.nodes.modelNormalViewMatrix}getMaterialData(t){const e={};for(const n of this.refreshUniforms){const i=t[n];null!=i&&("object"==typeof i&&void 0!==i.clone?!0===i.isTexture?e[n]={id:i.id,version:i.version}:e[n]=i.clone():e[n]=i)}return e}equals(t){const{object:e,material:n}=t,i=this.getRenderObjectData(t);if(!0!==i.worldMatrix.equals(e.matrixWorld))return i.worldMatrix.copy(e.matrixWorld),!1;const r=i.material;for(const t in r){const e=r[t],i=n[t];if(void 0!==e.equals){if(!1===e.equals(i))return e.copy(i),!1}else if(!0===i.isTexture){if(e.id!==i.id||e.version!==i.version)return e.id=i.id,e.version=i.version,!1}else if(e!==i)return r[t]=i,!1}if(i.morphTargetInfluences){let t=!1;for(let n=0;n<i.morphTargetInfluences.length;n++)i.morphTargetInfluences[n]!==e.morphTargetInfluences[n]&&(t=!0);if(t)return!0}return i.center&&!1===i.center.equals(e.center)?(i.center.copy(e.center),!0):(null!==t.bundle&&(i.version=t.bundle.version),!0)}needsRefresh(t,e){if(this.hasNode||this.hasAnimation||this.firstInitialization(t))return!0;const{renderId:n}=e;if(this.renderId!==n)return this.renderId=n,!0;const i=!0===t.object.static,r=null!==t.bundle&&!0===t.bundle.static&&this.getRenderObjectData(t).version===t.bundle.version;if(i||r)return!1;return!0!==this.equals(t)}}function LT(t,e=0){let n=3735928559^e,i=1103547991^e;if(t instanceof Array)for(let e,r=0;r<t.length;r++)e=t[r],n=Math.imul(n^e,2654435761),i=Math.imul(i^e,1597334677);else for(let e,r=0;r<t.length;r++)e=t.charCodeAt(r),n=Math.imul(n^e,2654435761),i=Math.imul(i^e,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507),i^=Math.imul(n^n>>>13,3266489909),4294967296*(2097151&i)+(n>>>0)}const BT=t=>LT(t),UT=(...t)=>LT(t);function OT(t,e=!1){const n=[];!0===t.isNode&&(n.push(t.id),t=t.getSelf());for(const{property:i,childNode:r}of FT(t))n.push(n,LT(i.slice(0,-4)),r.getCacheKey(e));return LT(n)}function*FT(t,e=!1){for(const n in t){if(!0===n.startsWith("_"))continue;const i=t[n];if(!0===Array.isArray(i))for(let t=0;t<i.length;t++){const r=i[t];r&&(!0===r.isNode||e&&"function"==typeof r.toJSON)&&(yield{property:n,index:t,childNode:r})}else if(i&&!0===i.isNode)yield{property:n,childNode:i};else if("object"==typeof i)for(const t in i){const r=i[t];r&&(!0===r.isNode||e&&"function"==typeof r.toJSON)&&(yield{property:n,index:t,childNode:r})}}}function kT(t){if(null==t)return null;const e=typeof t;return!0===t.isNode?"node":"number"===e?"float":"boolean"===e?"bool":"string"===e?"string":"function"===e?"shader":!0===t.isVector2?"vec2":!0===t.isVector3?"vec3":!0===t.isVector4?"vec4":!0===t.isMatrix3?"mat3":!0===t.isMatrix4?"mat4":!0===t.isColor?"color":t instanceof ArrayBuffer?"ArrayBuffer":null}function zT(t,...e){const n=t?t.slice(-4):void 0;return 1===e.length&&("vec2"===n?e=[e[0],e[0]]:"vec3"===n?e=[e[0],e[0],e[0]]:"vec4"===n&&(e=[e[0],e[0],e[0],e[0]])),"color"===t?new GM(...e):"vec2"===n?new $b(...e):"vec3"===n?new _S(...e):"vec4"===n?new fS(...e):"mat3"===n?new Zb(...e):"mat4"===n?new $S(...e):"bool"===t?e[0]||!1:"float"===t||"int"===t||"uint"===t?e[0]||0:"string"===t?e[0]||"":"ArrayBuffer"===t?(i=e[0],Uint8Array.from(atob(i),(t=>t.charCodeAt(0))).buffer):null;var i}const qT="vertex",GT="none",VT="frame",HT="render",jT="object",WT=["setup","analyze","generate"],XT=["fragment","vertex","compute"],YT=["x","y","z","w"];let QT=0;class $T extends Fb{static get type(){return"Node"}constructor(t=null){super(),this.nodeType=t,this.updateType=GT,this.updateBeforeType=GT,this.updateAfterType=GT,this.uuid=Qb.generateUUID(),this.version=0,this._cacheKey=null,this._cacheKeyVersion=0,this.global=!1,this.isNode=!0,Object.defineProperty(this,"id",{value:QT++})}set needsUpdate(t){!0===t&&this.version++}get type(){return this.constructor.type}onUpdate(t,e){return this.updateType=e,this.update=t.bind(this.getSelf()),this}onFrameUpdate(t){return this.onUpdate(t,VT)}onRenderUpdate(t){return this.onUpdate(t,HT)}onObjectUpdate(t){return this.onUpdate(t,jT)}onReference(t){return this.updateReference=t.bind(this.getSelf()),this}getSelf(){return this.self||this}updateReference(){return this}isGlobal(){return this.global}*getChildren(){for(const{childNode:t}of FT(this))yield t}dispose(){this.dispatchEvent({type:"dispose"})}traverse(t){t(this);for(const e of this.getChildren())e.traverse(t)}getCacheKey(t=!1){return!0!==(t=t||this.version!==this._cacheKeyVersion)&&null!==this._cacheKey||(this._cacheKey=OT(this,t),this._cacheKeyVersion=this.version),this._cacheKey}getScope(){return this}getHash(){return this.uuid}getUpdateType(){return this.updateType}getUpdateBeforeType(){return this.updateBeforeType}getUpdateAfterType(){return this.updateAfterType}getElementType(t){const e=this.getNodeType(t);return t.getElementType(e)}getNodeType(t){const e=t.getNodeProperties(this);return e.outputNode?e.outputNode.getNodeType(t):this.nodeType}getShared(t){const e=this.getHash(t);return t.getNodeFromHash(e)||this}setup(t){const e=t.getNodeProperties(this);let n=0;for(const t of this.getChildren())e["node"+n++]=t;return null}analyze(t){if(1===t.increaseUsage(this)){const e=t.getNodeProperties(this);for(const n of Object.values(e))n&&!0===n.isNode&&n.build(t)}}generate(t,e){const{outputNode:n}=t.getNodeProperties(this);if(n&&!0===n.isNode)return n.build(t,e)}updateBefore(){console.warn("Abstract function.")}updateAfter(){console.warn("Abstract function.")}update(){console.warn("Abstract function.")}build(t,e=null){const n=this.getShared(t);if(this!==n)return n.build(t,e);t.addNode(this),t.addChain(this);let i=null;const r=t.getBuildStage();if("setup"===r){this.updateReference(t);const e=t.getNodeProperties(this);if(!0!==e.initialized){t.stack.nodes.length;e.initialized=!0,e.outputNode=this.setup(t),null!==e.outputNode&&t.stack.nodes.length;for(const n of Object.values(e))n&&!0===n.isNode&&n.build(t)}}else if("analyze"===r)this.analyze(t);else if("generate"===r){if(1===this.generate.length){const n=this.getNodeType(t),r=t.getDataFromNode(this);i=r.snippet,void 0===i?(i=this.generate(t)||"",r.snippet=i):void 0!==r.flowCodes&&void 0!==t.context.nodeBlock&&t.addFlowCodeHierarchy(this,t.context.nodeBlock),i=t.format(i,n,e)}else i=this.generate(t,e)||""}return t.removeChain(this),i}getSerializeChildren(){return FT(this)}serialize(t){const e=this.getSerializeChildren(),n={};for(const{property:i,index:r,childNode:s}of e)void 0!==r?(void 0===n[i]&&(n[i]=Number.isInteger(r)?[]:{}),n[i][r]=s.toJSON(t.meta).uuid):n[i]=s.toJSON(t.meta).uuid;Object.keys(n).length>0&&(t.inputNodes=n)}deserialize(t){if(void 0!==t.inputNodes){const e=t.meta.nodes;for(const n in t.inputNodes)if(Array.isArray(t.inputNodes[n])){const i=[];for(const r of t.inputNodes[n])i.push(e[r]);this[n]=i}else if("object"==typeof t.inputNodes[n]){const i={};for(const r in t.inputNodes[n]){const s=t.inputNodes[n][r];i[r]=e[s]}this[n]=i}else{const i=t.inputNodes[n];this[n]=e[i]}}}toJSON(t){const{uuid:e,type:n}=this,i=void 0===t||"string"==typeof t;i&&(t={textures:{},images:{},nodes:{}});let r=t.nodes[e];function s(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}if(void 0===r&&(r={uuid:e,type:n,meta:t,metadata:{version:4.6,type:"Node",generator:"Node.toJSON"}},!0!==i&&(t.nodes[r.uuid]=r),this.serialize(r),delete r.meta),i){const e=s(t.textures),n=s(t.images),i=s(t.nodes);e.length>0&&(r.textures=e),n.length>0&&(r.images=n),i.length>0&&(r.nodes=i)}return r}}class ZT extends $T{static get type(){return"ArrayElementNode"}constructor(t,e){super(),this.node=t,this.indexNode=e,this.isArrayElementNode=!0}getNodeType(t){return this.node.getElementType(t)}generate(t){return`${this.node.build(t)}[ ${this.indexNode.build(t,"uint")} ]`}}class KT extends $T{static get type(){return"ConvertNode"}constructor(t,e){super(),this.node=t,this.convertTo=e}getNodeType(t){const e=this.node.getNodeType(t);let n=null;for(const i of this.convertTo.split("|"))null!==n&&t.getTypeLength(e)!==t.getTypeLength(i)||(n=i);return n}serialize(t){super.serialize(t),t.convertTo=this.convertTo}deserialize(t){super.deserialize(t),this.convertTo=t.convertTo}generate(t,e){const n=this.node,i=this.getNodeType(t),r=n.build(t,i);return t.format(r,i,e)}}class JT extends $T{static get type(){return"TempNode"}constructor(t){super(t),this.isTempNode=!0}hasDependencies(t){return t.getDataFromNode(this).usageCount>1}build(t,e){if("generate"===t.getBuildStage()){const n=t.getVectorType(this.getNodeType(t,e)),i=t.getDataFromNode(this);if(void 0!==i.propertyName)return t.format(i.propertyName,n,e);if("void"!==n&&"void"!==e&&this.hasDependencies(t)){const r=super.build(t,n),s=t.getVarFromNode(this,null,n),a=t.getPropertyName(s);return t.addLineFlowCode(`${a} = ${r}`,this),i.snippet=r,i.propertyName=a,t.format(i.propertyName,n,e)}}return super.build(t,e)}}class tE extends JT{static get type(){return"JoinNode"}constructor(t=[],e=null){super(e),this.nodes=t}getNodeType(t){return null!==this.nodeType?t.getVectorType(this.nodeType):t.getTypeFromLength(this.nodes.reduce(((e,n)=>e+t.getTypeLength(n.getNodeType(t))),0))}generate(t,e){const n=this.getNodeType(t),i=this.nodes,r=t.getComponentType(n),s=[];for(const e of i){let n=e.build(t);const i=t.getComponentType(e.getNodeType(t));i!==r&&(n=t.format(n,i,r)),s.push(n)}const a=`${t.getType(n)}( ${s.join(", ")} )`;return t.format(a,n,e)}}const eE=YT.join("");class nE extends $T{static get type(){return"SplitNode"}constructor(t,e="x"){super(),this.node=t,this.components=e,this.isSplitNode=!0}getVectorLength(){let t=this.components.length;for(const e of this.components)t=Math.max(YT.indexOf(e)+1,t);return t}getComponentType(t){return t.getComponentType(this.node.getNodeType(t))}getNodeType(t){return t.getTypeFromLength(this.components.length,this.getComponentType(t))}generate(t,e){const n=this.node,i=t.getTypeLength(n.getNodeType(t));let r=null;if(i>1){let s=null;this.getVectorLength()>=i&&(s=t.getTypeFromLength(this.getVectorLength(),this.getComponentType(t)));const a=n.build(t,s);r=this.components.length===i&&this.components===eE.slice(0,this.components.length)?t.format(a,s,e):t.format(`${a}.${this.components}`,this.getNodeType(t),e)}else r=n.build(t,e);return r}serialize(t){super.serialize(t),t.components=this.components}deserialize(t){super.deserialize(t),this.components=t.components}}class iE extends JT{static get type(){return"SetNode"}constructor(t,e,n){super(),this.sourceNode=t,this.components=e,this.targetNode=n}getNodeType(t){return this.sourceNode.getNodeType(t)}generate(t){const{sourceNode:e,components:n,targetNode:i}=this,r=this.getNodeType(t),s=t.getTypeFromLength(n.length,i.getNodeType(t)),a=i.build(t,s),o=e.build(t,r),l=t.getTypeLength(r),u=[];for(let t=0;t<l;t++){const e=YT[t];e===n[0]?(u.push(a),t+=n.length-1):u.push(o+"."+e)}return`${t.getType(r)}( ${u.join(", ")} )`}}class rE extends JT{static get type(){return"FlipNode"}constructor(t,e){super(),this.sourceNode=t,this.components=e}getNodeType(t){return this.sourceNode.getNodeType(t)}generate(t){const{components:e,sourceNode:n}=this,i=this.getNodeType(t),r=n.build(t),s=t.getVarFromNode(this),a=t.getPropertyName(s);t.addLineFlowCode(a+" = "+r,this);const o=t.getTypeLength(i),l=[];let u=0;for(let t=0;t<o;t++){const n=YT[t];n===e[u]?(l.push("1.0 - "+a+"."+n),u++):l.push(a+"."+n)}return`${t.getType(i)}( ${l.join(", ")} )`}}class sE extends $T{static get type(){return"InputNode"}constructor(t,e=null){super(e),this.isInputNode=!0,this.value=t,this.precision=null}getNodeType(){return null===this.nodeType?kT(this.value):this.nodeType}getInputType(t){return this.getNodeType(t)}setPrecision(t){return this.precision=t,this}serialize(t){super.serialize(t),t.value=this.value,this.value&&this.value.toArray&&(t.value=this.value.toArray()),t.valueType=kT(this.value),t.nodeType=this.nodeType,"ArrayBuffer"===t.valueType&&(t.value=function(t){let e="";const n=new Uint8Array(t);for(let t=0;t<n.length;t++)e+=String.fromCharCode(n[t]);return btoa(e)}(t.value)),t.precision=this.precision}deserialize(t){super.deserialize(t),this.nodeType=t.nodeType,this.value=Array.isArray(t.value)?zT(t.valueType,...t.value):t.value,this.precision=t.precision||null,this.value&&this.value.fromArray&&(this.value=this.value.fromArray(t.value))}generate(){console.warn("Abstract function.")}}class aE extends sE{static get type(){return"ConstNode"}constructor(t,e=null){super(t,e),this.isConstNode=!0}generateConst(t){return t.generateConst(this.getNodeType(t),this.value)}generate(t,e){const n=this.getNodeType(t);return t.format(this.generateConst(t),n,e)}}let oE=null;const lE=new Map;function uE(t,e){if(lE.has(t))console.warn(`Redefinition of method chaining ${t}`);else{if("function"!=typeof e)throw new Error(`Node element ${t} is not a function`);lE.set(t,e)}}const hE=t=>t.replace(/r|s/g,"x").replace(/g|t/g,"y").replace(/b|p/g,"z").replace(/a|q/g,"w"),cE=t=>hE(t).split("").sort().join(""),AE={setup(t,e){const n=e.shift();return t(UE(n),...e)},get(t,e,n){if("string"==typeof e&&void 0===t[e]){if(!0!==t.isStackNode&&"assign"===e)return(...t)=>(oE.assign(n,...t),n);if(lE.has(e)){const i=lE.get(e);return t.isStackNode?(...t)=>n.add(i(...t)):(...t)=>i(n,...t)}if("self"===e)return t;if(e.endsWith("Assign")&&lE.has(e.slice(0,e.length-6))){const i=lE.get(e.slice(0,e.length-6));return t.isStackNode?(...t)=>n.assign(t[0],i(...t)):(...t)=>n.assign(i(n,...t))}if(!0===/^[xyzwrgbastpq]{1,4}$/.test(e))return e=hE(e),BE(new nE(n,e));if(!0===/^set[XYZWRGBASTPQ]{1,4}$/.test(e))return e=cE(e.slice(3).toLowerCase()),n=>BE(new iE(t,e,n));if(!0===/^flip[XYZWRGBASTPQ]{1,4}$/.test(e))return e=cE(e.slice(4).toLowerCase()),()=>BE(new rE(BE(t),e));if("width"===e||"height"===e||"depth"===e)return"width"===e?e="x":"height"===e?e="y":"depth"===e&&(e="z"),BE(new nE(t,e));if(!0===/^\d+$/.test(e))return BE(new ZT(n,new aE(Number(e),"uint")))}return Reflect.get(t,e,n)},set:(t,e,n,i)=>"string"!=typeof e||void 0!==t[e]||!0!==/^[xyzwrgbastpq]{1,4}$/.test(e)&&"width"!==e&&"height"!==e&&"depth"!==e&&!0!==/^\d+$/.test(e)?Reflect.set(t,e,n,i):(i[e].assign(n),!0)},dE=new WeakMap,pE=new WeakMap,fE=function(t,e=null){for(const n in t)t[n]=BE(t[n],e);return t},mE=function(t,e=null){const n=t.length;for(let i=0;i<n;i++)t[i]=BE(t[i],e);return t},gE=function(t,e=null,n=null,i=null){const r=t=>BE(null!==i?Object.assign(t,i):t);return null===e?(...e)=>r(new t(...OE(e))):null!==n?(n=BE(n),(...i)=>r(new t(e,...OE(i),n))):(...n)=>r(new t(e,...OE(n)))},yE=function(t,...e){return BE(new t(...OE(e)))};class vE extends $T{constructor(t,e){super(),this.shaderNode=t,this.inputNodes=e}getNodeType(t){return this.shaderNode.nodeType||this.getOutputNode(t).getNodeType(t)}call(t){const{shaderNode:e,inputNodes:n}=this,i=t.getNodeProperties(e);if(i.onceOutput)return i.onceOutput;let r=null;if(e.layout){let i=pE.get(t.constructor);void 0===i&&(i=new WeakMap,pE.set(t.constructor,i));let s=i.get(e);void 0===s&&(s=BE(t.buildFunctionNode(e)),i.set(e,s)),null!==t.currentFunctionNode&&t.currentFunctionNode.includes.push(s),r=BE(s.call(n))}else{const i=e.jsFunc,s=null!==n?i(n,t):i(t);r=BE(s)}return e.once&&(i.onceOutput=r),r}getOutputNode(t){const e=t.getNodeProperties(this);return null===e.outputNode&&(e.outputNode=this.setupOutput(t)),e.outputNode}setup(t){return this.getOutputNode(t)}setupOutput(t){return t.addStack(),t.stack.outputNode=this.call(t),t.removeStack()}generate(t,e){return this.getOutputNode(t).build(t,e)}}class _E extends $T{constructor(t,e){super(e),this.jsFunc=t,this.layout=null,this.global=!0,this.once=!1}setLayout(t){return this.layout=t,this}call(t=null){return UE(t),BE(new vE(this,t))}setup(){return this.call()}}const xE=[!1,!0],bE=[0,1,2,3],SE=[-1,-2],ME=[.5,1.5,1/3,1e-6,1e6,Math.PI,2*Math.PI,1/Math.PI,2/Math.PI,1/(2*Math.PI),Math.PI/2],wE=new Map;for(const t of xE)wE.set(t,new aE(t));const TE=new Map;for(const t of bE)TE.set(t,new aE(t,"uint"));const EE=new Map([...TE].map((t=>new aE(t.value,"int"))));for(const t of SE)EE.set(t,new aE(t,"int"));const CE=new Map([...EE].map((t=>new aE(t.value))));for(const t of ME)CE.set(t,new aE(t));for(const t of ME)CE.set(-t,new aE(-t));const RE={bool:wE,uint:TE,ints:EE,float:CE},NE=new Map([...wE,...CE]),PE=(t,e)=>NE.has(t)?NE.get(t):!0===t.isNode?t:new aE(t,e),DE=function(t,e=null){return(...n)=>{if((0===n.length||!["bool","float","int","uint"].includes(t)&&n.every((t=>"object"!=typeof t)))&&(n=[zT(t,...n)]),1===n.length&&null!==e&&e.has(n[0]))return BE(e.get(n[0]));if(1===n.length){const e=PE(n[0],t);return(t=>{try{return t.getNodeType()}catch(t){return}})(e)===t?BE(e):BE(new KT(e,t))}const i=n.map((t=>PE(t)));return BE(new tE(i,t))}},IE=t=>"object"==typeof t&&null!==t?t.value:t;function LE(t,e){return new Proxy(new _E(t,e),AE)}const BE=(t,e=null)=>function(t,e=null){const n=kT(t);if("node"===n){let e=dE.get(t);return void 0===e&&(e=new Proxy(t,AE),dE.set(t,e),dE.set(e,e)),e}return null===e&&("float"===n||"boolean"===n)||n&&"shader"!==n&&"string"!==n?BE(PE(t,e)):"shader"===n?zE(t):t}(t,e),UE=(t,e=null)=>new fE(t,e),OE=(t,e=null)=>new mE(t,e),FE=(...t)=>new gE(...t),kE=(...t)=>new yE(...t),zE=(t,e)=>{const n=new LE(t,e),i=(...t)=>{let e;return UE(t),e=t[0]&&t[0].isNode?[...t]:t[0],n.call(e)};return i.shaderNode=n,i.setLayout=t=>(n.setLayout(t),i),i.once=()=>(n.once=!0,i),i};uE("toGlobal",(t=>(t.global=!0,t)));const qE=t=>{oE=t},GE=()=>oE,VE=(...t)=>oE.If(...t);uE("append",(function(t){return oE&&oE.add(t),t}));const HE=new DE("color"),jE=new DE("float",RE.float),WE=new DE("int",RE.ints),XE=new DE("uint",RE.uint),YE=new DE("bool",RE.bool),QE=new DE("vec2"),$E=new DE("ivec2"),ZE=new DE("uvec2"),KE=new DE("bvec2"),JE=new DE("vec3"),tC=new DE("ivec3"),eC=new DE("uvec3"),nC=new DE("bvec3"),iC=new DE("vec4"),rC=new DE("ivec4"),sC=new DE("uvec4"),aC=new DE("bvec4"),oC=new DE("mat2"),lC=new DE("mat3"),uC=new DE("mat4");uE("toColor",HE),uE("toFloat",jE),uE("toInt",WE),uE("toUint",XE),uE("toBool",YE),uE("toVec2",QE),uE("toIVec2",$E),uE("toUVec2",ZE),uE("toBVec2",KE),uE("toVec3",JE),uE("toIVec3",tC),uE("toUVec3",eC),uE("toBVec3",nC),uE("toVec4",iC),uE("toIVec4",rC),uE("toUVec4",sC),uE("toBVec4",aC),uE("toMat2",oC),uE("toMat3",lC),uE("toMat4",uC);uE("element",FE(ZT)),uE("convert",((t,e)=>BE(new KT(BE(t),e))));class hC extends $T{static get type(){return"UniformGroupNode"}constructor(t,e=!1,n=1){super("string"),this.name=t,this.version=0,this.shared=e,this.order=n,this.isUniformGroup=!0}set needsUpdate(t){!0===t&&this.version++}serialize(t){super.serialize(t),t.name=this.name,t.version=this.version,t.shared=this.shared}deserialize(t){super.deserialize(t),this.name=t.name,this.version=t.version,this.shared=t.shared}}const cC=t=>new hC(t),AC=(t,e=0)=>new hC(t,!0,e),dC=AC("frame"),pC=AC("render"),fC=cC("object");class mC extends sE{static get type(){return"UniformNode"}constructor(t,e=null){super(t,e),this.isUniformNode=!0,this.name="",this.groupNode=fC}label(t){return this.name=t,this}setGroup(t){return this.groupNode=t,this}getGroup(){return this.groupNode}getUniformHash(t){return this.getHash(t)}onUpdate(t,e){const n=this.getSelf();return t=t.bind(n),super.onUpdate((e=>{const i=t(e,n);void 0!==i&&(this.value=i)}),e)}generate(t,e){const n=this.getNodeType(t),i=this.getUniformHash(t);let r=t.getNodeFromHash(i);void 0===r&&(t.setHashNode(this,i),r=this);const s=r.getInputType(t),a=t.getUniformFromNode(r,s,t.shaderStage,this.name||t.context.label),o=t.getPropertyName(a);return void 0!==t.context.label&&delete t.context.label,t.format(o,n,e)}}const gC=(t,e)=>{const n=(t=>null!=t?t.nodeType||t.convertTo||("string"==typeof t?t:null):null)(e||t),i=t&&!0===t.isNode?t.node&&t.node.value||t.value:t;return BE(new mC(i,n))};class yC extends $T{static get type(){return"PropertyNode"}constructor(t,e=null,n=!1){super(t),this.name=e,this.varying=n,this.isPropertyNode=!0}getHash(t){return this.name||super.getHash(t)}isGlobal(){return!0}generate(t){let e;return!0===this.varying?(e=t.getVaryingFromNode(this,this.name),e.needsInterpolation=!0):e=t.getVarFromNode(this,this.name),t.getPropertyName(e)}}const vC=(t,e)=>BE(new yC(t,e)),_C=(t,e)=>BE(new yC(t,e,!0)),xC=kE(yC,"vec4","DiffuseColor"),bC=kE(yC,"vec3","EmissiveColor"),SC=kE(yC,"float","Roughness"),MC=kE(yC,"float","Metalness"),wC=kE(yC,"float","Clearcoat"),TC=kE(yC,"float","ClearcoatRoughness"),EC=kE(yC,"vec3","Sheen"),CC=kE(yC,"float","SheenRoughness"),RC=kE(yC,"float","Iridescence"),NC=kE(yC,"float","IridescenceIOR"),PC=kE(yC,"float","IridescenceThickness"),DC=kE(yC,"float","AlphaT"),IC=kE(yC,"float","Anisotropy"),LC=kE(yC,"vec3","AnisotropyT"),BC=kE(yC,"vec3","AnisotropyB"),UC=kE(yC,"color","SpecularColor"),OC=kE(yC,"float","SpecularF90"),FC=kE(yC,"float","Shininess"),kC=kE(yC,"vec4","Output"),zC=kE(yC,"float","dashSize"),qC=kE(yC,"float","gapSize"),GC=kE(yC,"float","IOR"),VC=kE(yC,"float","Transmission"),HC=kE(yC,"float","Thickness"),jC=kE(yC,"float","AttenuationDistance"),WC=kE(yC,"color","AttenuationColor"),XC=kE(yC,"float","Dispersion");class YC extends JT{static get type(){return"AssignNode"}constructor(t,e){super(),this.targetNode=t,this.sourceNode=e}hasDependencies(){return!1}getNodeType(t,e){return"void"!==e?this.targetNode.getNodeType(t):"void"}needsSplitAssign(t){const{targetNode:e}=this;if(!1===t.isAvailable("swizzleAssign")&&e.isSplitNode&&e.components.length>1){const n=t.getTypeLength(e.node.getNodeType(t));return YT.join("").slice(0,n)!==e.components}return!1}generate(t,e){const{targetNode:n,sourceNode:i}=this,r=this.needsSplitAssign(t),s=n.getNodeType(t),a=n.context({assign:!0}).build(t),o=i.build(t,s),l=i.getNodeType(t),u=t.getDataFromNode(this);let h;if(!0===u.initialized)"void"!==e&&(h=a);else if(r){const i=t.getVarFromNode(this,null,s),r=t.getPropertyName(i);t.addLineFlowCode(`${r} = ${o}`,this);const l=n.node.context({assign:!0}).build(t);for(let e=0;e<n.components.length;e++){const i=n.components[e];t.addLineFlowCode(`${l}.${i} = ${r}[ ${e} ]`,this)}"void"!==e&&(h=a)}else h=`${a} = ${o}`,"void"!==e&&"void"!==l||(t.addLineFlowCode(h,this),"void"!==e&&(h=a));return u.initialized=!0,t.format(h,s,e)}}uE("assign",FE(YC));class QC extends JT{static get type(){return"FunctionCallNode"}constructor(t=null,e={}){super(),this.functionNode=t,this.parameters=e}setParameters(t){return this.parameters=t,this}getParameters(){return this.parameters}getNodeType(t){return this.functionNode.getNodeType(t)}generate(t){const e=[],n=this.functionNode,i=n.getInputs(t),r=this.parameters;if(Array.isArray(r))for(let n=0;n<r.length;n++){const s=i[n],a=r[n];e.push(a.build(t,s.type))}else for(const n of i){const i=r[n.name];if(void 0===i)throw new Error(`FunctionCallNode: Input '${n.name}' not found in FunctionNode.`);e.push(i.build(t,n.type))}return`${n.build(t,"property")}( ${e.join(", ")} )`}}uE("call",((t,...e)=>(e=e.length>1||e[0]&&!0===e[0].isNode?OE(e):UE(e[0]),BE(new QC(BE(t),e)))));class $C extends JT{static get type(){return"OperatorNode"}constructor(t,e,n,...i){if(super(),i.length>0){let r=new $C(t,e,n);for(let e=0;e<i.length-1;e++)r=new $C(t,r,i[e]);e=r,n=i[i.length-1]}this.op=t,this.aNode=e,this.bNode=n}getNodeType(t,e){const n=this.op,i=this.aNode,r=this.bNode,s=i.getNodeType(t),a=void 0!==r?r.getNodeType(t):null;if("void"===s||"void"===a)return"void";if("%"===n)return s;if("~"===n||"&"===n||"|"===n||"^"===n||">>"===n||"<<"===n)return t.getIntegerType(s);if("!"===n||"=="===n||"&&"===n||"||"===n||"^^"===n)return"bool";if("<"===n||">"===n||"<="===n||">="===n){const n=e?t.getTypeLength(e):Math.max(t.getTypeLength(s),t.getTypeLength(a));return n>1?`bvec${n}`:"bool"}return"float"===s&&t.isMatrix(a)?a:t.isMatrix(s)&&t.isVector(a)?t.getVectorFromMatrix(s):t.isVector(s)&&t.isMatrix(a)?t.getVectorFromMatrix(a):t.getTypeLength(a)>t.getTypeLength(s)?a:s}generate(t,e){const n=this.op,i=this.aNode,r=this.bNode,s=this.getNodeType(t,e);let a=null,o=null;"void"!==s?(a=i.getNodeType(t),o=void 0!==r?r.getNodeType(t):null,"<"===n||">"===n||"<="===n||">="===n||"=="===n?t.isVector(a)?o=a:a!==o&&(a=o="float"):">>"===n||"<<"===n?(a=s,o=t.changeComponentType(o,"uint")):t.isMatrix(a)&&t.isVector(o)?o=t.getVectorFromMatrix(a):a=t.isVector(a)&&t.isMatrix(o)?t.getVectorFromMatrix(o):o=s):a=o=s;const l=i.build(t,a),u=void 0!==r?r.build(t,o):null,h=t.getTypeLength(e),c=t.getFunctionOperator(n);return"void"!==e?"<"===n&&h>1?t.useComparisonMethod?t.format(`${t.getMethod("lessThan",e)}( ${l}, ${u} )`,s,e):t.format(`( ${l} < ${u} )`,s,e):"<="===n&&h>1?t.useComparisonMethod?t.format(`${t.getMethod("lessThanEqual",e)}( ${l}, ${u} )`,s,e):t.format(`( ${l} <= ${u} )`,s,e):">"===n&&h>1?t.useComparisonMethod?t.format(`${t.getMethod("greaterThan",e)}( ${l}, ${u} )`,s,e):t.format(`( ${l} > ${u} )`,s,e):">="===n&&h>1?t.useComparisonMethod?t.format(`${t.getMethod("greaterThanEqual",e)}( ${l}, ${u} )`,s,e):t.format(`( ${l} >= ${u} )`,s,e):"!"===n||"~"===n?t.format(`(${n}${l})`,a,e):c?t.format(`${c}( ${l}, ${u} )`,s,e):t.format(`( ${l} ${n} ${u} )`,s,e):"void"!==a?c?t.format(`${c}( ${l}, ${u} )`,s,e):t.format(`${l} ${n} ${u}`,s,e):void 0}serialize(t){super.serialize(t),t.op=this.op}deserialize(t){super.deserialize(t),this.op=t.op}}const ZC=FE($C,"+"),KC=FE($C,"-"),JC=FE($C,"*"),tR=FE($C,"/"),eR=FE($C,"%"),nR=FE($C,"=="),iR=FE($C,"!="),rR=FE($C,"<"),sR=FE($C,">"),aR=FE($C,"<="),oR=FE($C,">="),lR=FE($C,"&&"),uR=FE($C,"||"),hR=FE($C,"!"),cR=FE($C,"^^"),AR=FE($C,"&"),dR=FE($C,"~"),pR=FE($C,"|"),fR=FE($C,"^"),mR=FE($C,"<<"),gR=FE($C,">>");uE("add",ZC),uE("sub",KC),uE("mul",JC),uE("div",tR),uE("modInt",eR),uE("equal",nR),uE("notEqual",iR),uE("lessThan",rR),uE("greaterThan",sR),uE("lessThanEqual",aR),uE("greaterThanEqual",oR),uE("and",lR),uE("or",uR),uE("not",hR),uE("xor",cR),uE("bitAnd",AR),uE("bitNot",dR),uE("bitOr",pR),uE("bitXor",fR),uE("shiftLeft",mR),uE("shiftRight",gR);uE("remainder",((...t)=>(console.warn("TSL.OperatorNode: .remainder() has been renamed to .modInt()."),eR(...t))));class yR extends JT{static get type(){return"MathNode"}constructor(t,e,n=null,i=null){super(),this.method=t,this.aNode=e,this.bNode=n,this.cNode=i}getInputType(t){const e=this.aNode.getNodeType(t),n=this.bNode?this.bNode.getNodeType(t):null,i=this.cNode?this.cNode.getNodeType(t):null,r=t.isMatrix(e)?0:t.getTypeLength(e),s=t.isMatrix(n)?0:t.getTypeLength(n),a=t.isMatrix(i)?0:t.getTypeLength(i);return r>s&&r>a?e:s>a?n:a>r?i:e}getNodeType(t){const e=this.method;return e===yR.LENGTH||e===yR.DISTANCE||e===yR.DOT?"float":e===yR.CROSS?"vec3":e===yR.ALL?"bool":e===yR.EQUALS?t.changeComponentType(this.aNode.getNodeType(t),"bool"):e===yR.MOD?this.aNode.getNodeType(t):this.getInputType(t)}generate(t,e){const n=this.method,i=this.getNodeType(t),r=this.getInputType(t),s=this.aNode,a=this.bNode,o=this.cNode,l=!0===t.renderer.isWebGLRenderer;if(n===yR.TRANSFORM_DIRECTION){let n=s,i=a;t.isMatrix(n.getNodeType(t))?i=iC(JE(i),0):n=iC(JE(n),0);const r=JC(n,i).xyz;return LR(r).build(t,e)}if(n===yR.NEGATE)return t.format("( - "+s.build(t,r)+" )",i,e);if(n===yR.ONE_MINUS)return KC(1,s).build(t,e);if(n===yR.RECIPROCAL)return tR(1,s).build(t,e);if(n===yR.DIFFERENCE)return GR(KC(s,a)).build(t,e);{const u=[];return n===yR.CROSS||n===yR.MOD?u.push(s.build(t,i),a.build(t,i)):l&&n===yR.STEP?u.push(s.build(t,1===t.getTypeLength(s.getNodeType(t))?"float":r),a.build(t,r)):l&&(n===yR.MIN||n===yR.MAX)||n===yR.MOD?u.push(s.build(t,r),a.build(t,1===t.getTypeLength(a.getNodeType(t))?"float":r)):n===yR.REFRACT?u.push(s.build(t,r),a.build(t,r),o.build(t,"float")):n===yR.MIX?u.push(s.build(t,r),a.build(t,r),o.build(t,1===t.getTypeLength(o.getNodeType(t))?"float":r)):(u.push(s.build(t,r)),null!==a&&u.push(a.build(t,r)),null!==o&&u.push(o.build(t,r))),t.format(`${t.getMethod(n,i)}( ${u.join(", ")} )`,i,e)}}serialize(t){super.serialize(t),t.method=this.method}deserialize(t){super.deserialize(t),this.method=t.method}}yR.ALL="all",yR.ANY="any",yR.EQUALS="equals",yR.RADIANS="radians",yR.DEGREES="degrees",yR.EXP="exp",yR.EXP2="exp2",yR.LOG="log",yR.LOG2="log2",yR.SQRT="sqrt",yR.INVERSE_SQRT="inversesqrt",yR.FLOOR="floor",yR.CEIL="ceil",yR.NORMALIZE="normalize",yR.FRACT="fract",yR.SIN="sin",yR.COS="cos",yR.TAN="tan",yR.ASIN="asin",yR.ACOS="acos",yR.ATAN="atan",yR.ABS="abs",yR.SIGN="sign",yR.LENGTH="length",yR.NEGATE="negate",yR.ONE_MINUS="oneMinus",yR.DFDX="dFdx",yR.DFDY="dFdy",yR.ROUND="round",yR.RECIPROCAL="reciprocal",yR.TRUNC="trunc",yR.FWIDTH="fwidth",yR.BITCAST="bitcast",yR.TRANSPOSE="transpose",yR.ATAN2="atan2",yR.MIN="min",yR.MAX="max",yR.MOD="mod",yR.STEP="step",yR.REFLECT="reflect",yR.DISTANCE="distance",yR.DIFFERENCE="difference",yR.DOT="dot",yR.CROSS="cross",yR.POW="pow",yR.TRANSFORM_DIRECTION="transformDirection",yR.MIX="mix",yR.CLAMP="clamp",yR.REFRACT="refract",yR.SMOOTHSTEP="smoothstep",yR.FACEFORWARD="faceforward";const vR=jE(1e-6),_R=jE(Math.PI),xR=FE(yR,yR.ALL),bR=FE(yR,yR.ANY),SR=FE(yR,yR.EQUALS),MR=FE(yR,yR.RADIANS),wR=FE(yR,yR.DEGREES),TR=FE(yR,yR.EXP),ER=FE(yR,yR.EXP2),CR=FE(yR,yR.LOG),RR=FE(yR,yR.LOG2),NR=FE(yR,yR.SQRT),PR=FE(yR,yR.INVERSE_SQRT),DR=FE(yR,yR.FLOOR),IR=FE(yR,yR.CEIL),LR=FE(yR,yR.NORMALIZE),BR=FE(yR,yR.FRACT),UR=FE(yR,yR.SIN),OR=FE(yR,yR.COS),FR=FE(yR,yR.TAN),kR=FE(yR,yR.ASIN),zR=FE(yR,yR.ACOS),qR=FE(yR,yR.ATAN),GR=FE(yR,yR.ABS),VR=FE(yR,yR.SIGN),HR=FE(yR,yR.LENGTH),jR=FE(yR,yR.NEGATE),WR=FE(yR,yR.ONE_MINUS),XR=FE(yR,yR.DFDX),YR=FE(yR,yR.DFDY),QR=FE(yR,yR.ROUND),$R=FE(yR,yR.RECIPROCAL),ZR=FE(yR,yR.TRUNC),KR=FE(yR,yR.FWIDTH);yR.BITCAST;const JR=FE(yR,yR.TRANSPOSE),tN=FE(yR,yR.ATAN2),eN=FE(yR,yR.MIN),nN=FE(yR,yR.MAX),iN=FE(yR,yR.MOD),rN=FE(yR,yR.STEP),sN=FE(yR,yR.REFLECT),aN=FE(yR,yR.DISTANCE),oN=FE(yR,yR.DIFFERENCE),lN=FE(yR,yR.DOT),uN=FE(yR,yR.CROSS),hN=FE(yR,yR.POW),cN=FE(yR,yR.POW,2),AN=FE(yR,yR.POW,3),dN=FE(yR,yR.POW,4),pN=FE(yR,yR.TRANSFORM_DIRECTION),fN=FE(yR,yR.MIX),mN=(t,e=0,n=1)=>BE(new yR(yR.CLAMP,BE(t),BE(e),BE(n))),gN=FE(yR,yR.REFRACT),yN=FE(yR,yR.SMOOTHSTEP),vN=FE(yR,yR.FACEFORWARD),_N=zE((([t])=>{const e=lN(t.xy,QE(12.9898,78.233)),n=iN(e,_R);return BR(UR(n).mul(43758.5453))}));uE("all",xR),uE("any",bR),uE("equals",SR),uE("radians",MR),uE("degrees",wR),uE("exp",TR),uE("exp2",ER),uE("log",CR),uE("log2",RR),uE("sqrt",NR),uE("inverseSqrt",PR),uE("floor",DR),uE("ceil",IR),uE("normalize",LR),uE("fract",BR),uE("sin",UR),uE("cos",OR),uE("tan",FR),uE("asin",kR),uE("acos",zR),uE("atan",qR),uE("abs",GR),uE("sign",VR),uE("length",HR),uE("lengthSq",(t=>lN(t,t))),uE("negate",jR),uE("oneMinus",WR),uE("dFdx",XR),uE("dFdy",YR),uE("round",QR),uE("reciprocal",$R),uE("trunc",ZR),uE("fwidth",KR),uE("atan2",tN),uE("min",eN),uE("max",nN),uE("mod",iN),uE("step",rN),uE("reflect",sN),uE("distance",aN),uE("dot",lN),uE("cross",uN),uE("pow",hN),uE("pow2",cN),uE("pow3",AN),uE("pow4",dN),uE("transformDirection",pN),uE("mix",((t,e,n)=>fN(e,n,t))),uE("clamp",mN),uE("refract",gN),uE("smoothstep",((t,e,n)=>yN(e,n,t))),uE("faceForward",vN),uE("difference",oN),uE("saturate",(t=>mN(t))),uE("cbrt",(t=>JC(VR(t),hN(GR(t),1/3)))),uE("transpose",JR),uE("rand",_N);class xN extends $T{static get type(){return"ConditionalNode"}constructor(t,e,n=null){super(),this.condNode=t,this.ifNode=e,this.elseNode=n}getNodeType(t){const e=this.ifNode.getNodeType(t);if(null!==this.elseNode){const n=this.elseNode.getNodeType(t);if(t.getTypeLength(n)>t.getTypeLength(e))return n}return e}setup(t){const e=this.condNode.cache(),n=this.ifNode.cache(),i=this.elseNode?this.elseNode.cache():null,r=t.context.nodeBlock;t.getDataFromNode(n).parentNodeBlock=r,null!==i&&(t.getDataFromNode(i).parentNodeBlock=r);const s=t.getNodeProperties(this);s.condNode=e,s.ifNode=n.context({nodeBlock:n}),s.elseNode=i?i.context({nodeBlock:i}):null}generate(t,e){const n=this.getNodeType(t),i=t.getDataFromNode(this);if(void 0!==i.nodeProperty)return i.nodeProperty;const{condNode:r,ifNode:s,elseNode:a}=t.getNodeProperties(this),o="void"!==e,l=o?vC(n).build(t):"";i.nodeProperty=l;const u=r.build(t,"bool");t.addFlowCode(`\n${t.tab}if ( ${u} ) {\n\n`).addFlowTab();let h=s.build(t,n);if(h&&(h=o?l+" = "+h+";":"return "+h+";"),t.removeFlowTab().addFlowCode(t.tab+"\t"+h+"\n\n"+t.tab+"}"),null!==a){t.addFlowCode(" else {\n\n").addFlowTab();let e=a.build(t,n);e&&(e=o?l+" = "+e+";":"return "+e+";"),t.removeFlowTab().addFlowCode(t.tab+"\t"+e+"\n\n"+t.tab+"}\n\n")}else t.addFlowCode("\n\n");return t.format(l,n,e)}}const bN=FE(xN);uE("select",bN);uE("cond",((...t)=>(console.warn("TSL.ConditionalNode: cond() has been renamed to select()."),bN(...t))));class SN extends $T{static get type(){return"ContextNode"}constructor(t,e={}){super(),this.isContextNode=!0,this.node=t,this.value=e}getScope(){return this.node.getScope()}getNodeType(t){return this.node.getNodeType(t)}analyze(t){this.node.build(t)}setup(t){const e=t.getContext();t.setContext({...t.context,...this.value});const n=this.node.build(t);return t.setContext(e),n}generate(t,e){const n=t.getContext();t.setContext({...t.context,...this.value});const i=this.node.build(t,e);return t.setContext(n),i}}const MN=FE(SN);uE("context",MN),uE("label",((t,e)=>MN(t,{label:e})));class wN extends $T{static get type(){return"VarNode"}constructor(t,e=null){super(),this.node=t,this.name=e,this.global=!0,this.isVarNode=!0}getHash(t){return this.name||super.getHash(t)}getNodeType(t){return this.node.getNodeType(t)}generate(t){const{node:e,name:n}=this,i=t.getVarFromNode(this,n,t.getVectorType(this.getNodeType(t))),r=t.getPropertyName(i),s=e.build(t,i.type);return t.addLineFlowCode(`${r} = ${s}`,this),r}}const TN=FE(wN);uE("temp",TN),uE("toVar",((...t)=>TN(...t).append()));class EN extends $T{static get type(){return"VaryingNode"}constructor(t,e=null){super(),this.node=t,this.name=e,this.isVaryingNode=!0}isGlobal(){return!0}getHash(t){return this.name||super.getHash(t)}getNodeType(t){return this.node.getNodeType(t)}setupVarying(t){const e=t.getNodeProperties(this);let n=e.varying;if(void 0===n){const i=this.name,r=this.getNodeType(t);e.varying=n=t.getVaryingFromNode(this,i,r),e.node=this.node}return n.needsInterpolation||(n.needsInterpolation="fragment"===t.shaderStage),n}setup(t){this.setupVarying(t)}analyze(t){return this.setupVarying(t),this.node.analyze(t)}generate(t){const e=t.getNodeProperties(this),n=this.setupVarying(t);if(void 0===e.propertyName){const i=this.getNodeType(t),r=t.getPropertyName(n,qT);t.flowNodeFromShaderStage(qT,this.node,i,r),e.propertyName=r}return t.getPropertyName(n)}}const CN=FE(EN);uE("varying",CN);const RN="WorkingColorSpace",NN="OutputColorSpace";function PN(t){let e=null;return t===vb?e="Linear":t===yb&&(e="sRGB"),e}function DN(t,e){return PN(t)+"To"+PN(e)}class IN extends JT{static get type(){return"ColorSpaceNode"}constructor(t,e,n){super("vec4"),this.colorNode=t,this.source=e,this.target=n}getColorSpace(t,e){return e===RN?sS.workingColorSpace:e===NN?t.context.outputColorSpace||t.renderer.outputColorSpace:e}setup(t){const{renderer:e}=t,{colorNode:n}=this,i=this.getColorSpace(t,this.source),r=this.getColorSpace(t,this.target);if(i===r)return n;const s=DN(i,r);let a=null;const o=e.nodes.library.getColorSpaceFunction(s);return null!==o?a=iC(o(n.rgb),n.a):(console.error("ColorSpaceNode: Unsupported Color Space configuration.",s),a=n),a}}const LN=(t,e)=>BE(new IN(BE(t),e,RN));uE("toOutputColorSpace",(t=>BE(new IN(BE(t),RN,NN)))),uE("toWorkingColorSpace",(t=>BE(new IN(BE(t),NN,RN)))),uE("workingToColorSpace",((t,e)=>BE(new IN(BE(t),RN,e)))),uE("colorSpaceToWorking",LN);let BN=class extends ZT{static get type(){return"ReferenceElementNode"}constructor(t,e){super(t,e),this.referenceNode=t,this.isReferenceElementNode=!0}getNodeType(){return this.referenceNode.uniformType}generate(t){const e=super.generate(t),n=this.referenceNode.getNodeType(),i=this.getNodeType();return t.format(e,n,i)}};class UN extends $T{static get type(){return"ReferenceBaseNode"}constructor(t,e,n=null,i=null){super(),this.property=t,this.uniformType=e,this.object=n,this.count=i,this.properties=t.split("."),this.reference=n,this.node=null,this.group=null,this.updateType=jT}setGroup(t){return this.group=t,this}element(t){return BE(new BN(this,BE(t)))}setNodeType(t){const e=gC(null,t).getSelf();null!==this.group&&e.setGroup(this.group),this.node=e}getNodeType(t){return null===this.node&&(this.updateReference(t),this.updateValue()),this.node.getNodeType(t)}getValueFromReference(t=this.reference){const{properties:e}=this;let n=t[e[0]];for(let t=1;t<e.length;t++)n=n[e[t]];return n}updateReference(t){return this.reference=null!==this.object?this.object:t.object,this.reference}setup(){return this.updateValue(),this.node}update(){this.updateValue()}updateValue(){null===this.node&&this.setNodeType(this.uniformType);const t=this.getValueFromReference();Array.isArray(t)?this.node.array=t:this.node.value=t}}class ON extends UN{static get type(){return"RendererReferenceNode"}constructor(t,e,n=null){super(t,e,n),this.renderer=n,this.setGroup(pC)}updateReference(t){return this.reference=null!==this.renderer?this.renderer:t.renderer,this.reference}}const FN=(t,e,n)=>BE(new ON(t,e,n));class kN extends JT{static get type(){return"ToneMappingNode"}constructor(t,e=zN,n=null){super("vec3"),this.toneMapping=t,this.exposureNode=e,this.colorNode=n}getCacheKey(){return UT(super.getCacheKey(),this.toneMapping)}setup(t){const e=this.colorNode||t.context.color,n=this.toneMapping;if(0===n)return e;let i=null;const r=t.renderer.nodes.library.getToneMappingFunction(n);return null!==r?i=iC(r(e.rgb,this.exposureNode),e.a):(console.error("ToneMappingNode: Unsupported Tone Mapping configuration.",n),i=e),i}}const zN=FN("toneMappingExposure","float");uE("toneMapping",((t,e,n)=>((t,e,n)=>BE(new kN(t,BE(e),BE(n))))(e,n,t)));class qN extends sE{static get type(){return"BufferAttributeNode"}constructor(t,e=null,n=0,i=0){super(t,e),this.isBufferNode=!0,this.bufferType=e,this.bufferStride=n,this.bufferOffset=i,this.usage=Lb,this.instanced=!1,this.attribute=null,this.global=!0,t&&!0===t.isBufferAttribute&&(this.attribute=t,this.usage=t.usage,this.instanced=t.isInstancedBufferAttribute)}getHash(t){if(0===this.bufferStride&&0===this.bufferOffset){let e=t.globalCache.getData(this.value);return void 0===e&&(e={node:this},t.globalCache.setData(this.value,e)),e.node.uuid}return this.uuid}getNodeType(t){return null===this.bufferType&&(this.bufferType=t.getTypeFromAttribute(this.attribute)),this.bufferType}setup(t){if(null!==this.attribute)return;const e=this.getNodeType(t),n=this.value,i=t.getTypeLength(e),r=this.bufferStride||i,s=this.bufferOffset,a=!0===n.isInterleavedBuffer?n:new Fw(n,r),o=new zw(a,i,s);a.setUsage(this.usage),this.attribute=o,this.attribute.isInstancedBufferAttribute=this.instanced}generate(t){const e=this.getNodeType(t),n=t.getBufferAttributeFromNode(this,e),i=t.getPropertyName(n);let r=null;if("vertex"===t.shaderStage||"compute"===t.shaderStage)this.name=i,r=i;else{r=CN(this).build(t,e)}return r}getInputType(){return"bufferAttribute"}setUsage(t){return this.usage=t,this.attribute&&!0===this.attribute.isBufferAttribute&&(this.attribute.usage=t),this}setInstanced(t){return this.instanced=t,this}}const GN=(t,e,n,i)=>BE(new qN(t,e,n,i)),VN=(t,e,n,i)=>GN(t,e,n,i).setInstanced(!0),HN=(t,e,n,i)=>((t,e,n,i)=>GN(t,e,n,i).setUsage(Bb))(t,e,n,i).setInstanced(!0);uE("toAttribute",(t=>GN(t.value)));class jN extends $T{static get type(){return"ComputeNode"}constructor(t,e,n=[64]){super("void"),this.isComputeNode=!0,this.computeNode=t,this.count=e,this.workgroupSize=n,this.dispatchCount=0,this.version=1,this.updateBeforeType=jT,this.updateDispatchCount()}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}updateDispatchCount(){const{count:t,workgroupSize:e}=this;let n=e[0];for(let t=1;t<e.length;t++)n*=e[t];this.dispatchCount=Math.ceil(t/n)}onInit(){}updateBefore({renderer:t}){t.compute(this)}generate(t){const{shaderStage:e}=t;if("compute"===e){const e=this.computeNode.build(t,"void");""!==e&&t.addLineFlowCode(e,this)}}}uE("compute",((t,e,n)=>BE(new jN(BE(t),e,n))));class WN extends $T{static get type(){return"CacheNode"}constructor(t,e=!0){super(),this.node=t,this.parent=e,this.isCacheNode=!0}getNodeType(t){return this.node.getNodeType(t)}build(t,...e){const n=t.getCache(),i=t.getCacheFromNode(this,this.parent);t.setCache(i);const r=this.node.build(t,...e);return t.setCache(n),r}}const XN=(t,...e)=>BE(new WN(BE(t),...e));uE("cache",XN);class YN extends $T{static get type(){return"BypassNode"}constructor(t,e){super(),this.isBypassNode=!0,this.outputNode=t,this.callNode=e}getNodeType(t){return this.outputNode.getNodeType(t)}generate(t){const e=this.callNode.build(t,"void");return""!==e&&t.addLineFlowCode(e,this),this.outputNode.build(t)}}uE("bypass",FE(YN));class QN extends $T{static get type(){return"RemapNode"}constructor(t,e,n,i=jE(0),r=jE(1)){super(),this.node=t,this.inLowNode=e,this.inHighNode=n,this.outLowNode=i,this.outHighNode=r,this.doClamp=!0}setup(){const{node:t,inLowNode:e,inHighNode:n,outLowNode:i,outHighNode:r,doClamp:s}=this;let a=t.sub(e).div(n.sub(e));return!0===s&&(a=a.clamp()),a.mul(r.sub(i)).add(i)}}const $N=FE(QN,null,null,{doClamp:!1}),ZN=FE(QN);uE("remap",$N),uE("remapClamp",ZN);class KN extends $T{static get type(){return"ExpressionNode"}constructor(t="",e="void"){super(e),this.snippet=t}generate(t,e){const n=this.getNodeType(t),i=this.snippet;if("void"!==n)return t.format(`( ${i} )`,n,e);t.addLineFlowCode(i,this)}}const JN=FE(KN);uE("discard",(t=>(t?bN(t,JN("discard")):JN("discard")).append()));class tP extends JT{static get type(){return"RenderOutputNode"}constructor(t,e,n){super("vec4"),this.colorNode=t,this.toneMapping=e,this.outputColorSpace=n,this.isRenderOutput=!0}setup({context:t}){let e=this.colorNode||t.color;const n=(null!==this.toneMapping?this.toneMapping:t.toneMapping)||0,i=(null!==this.outputColorSpace?this.outputColorSpace:t.outputColorSpace)||gb;return 0!==n&&(e=e.toneMapping(n)),i!==gb&&i!==sS.workingColorSpace&&(e=e.workingToColorSpace(i)),e}}uE("renderOutput",((t,e=null,n=null)=>BE(new tP(BE(t),e,n))));class eP extends $T{static get type(){return"AttributeNode"}constructor(t,e=null){super(e),this.global=!0,this._attributeName=t}getHash(t){return this.getAttributeName(t)}getNodeType(t){let e=this.nodeType;if(null===e){const n=this.getAttributeName(t);if(t.hasGeometryAttribute(n)){const i=t.geometry.getAttribute(n);e=t.getTypeFromAttribute(i)}else e="float"}return e}setAttributeName(t){return this._attributeName=t,this}getAttributeName(){return this._attributeName}generate(t){const e=this.getAttributeName(t),n=this.getNodeType(t);if(!0===t.hasGeometryAttribute(e)){const i=t.geometry.getAttribute(e),r=t.getTypeFromAttribute(i),s=t.getAttribute(e,r);if("vertex"===t.shaderStage)return t.format(s.name,r,n);return CN(this).build(t,n)}return console.warn(`AttributeNode: Vertex attribute "${e}" not found on geometry.`),t.generateConst(n)}serialize(t){super.serialize(t),t.global=this.global,t._attributeName=this._attributeName}deserialize(t){super.deserialize(t),this.global=t.global,this._attributeName=t._attributeName}}const nP=(t,e)=>BE(new eP(t,e)),iP=t=>nP("uv"+(t>0?t:""),"vec2");class rP extends $T{static get type(){return"TextureSizeNode"}constructor(t,e=null){super("uvec2"),this.isTextureSizeNode=!0,this.textureNode=t,this.levelNode=e}generate(t,e){const n=this.textureNode.build(t,"property"),i=null===this.levelNode?"0":this.levelNode.build(t,"int");return t.format(`${t.getMethod("textureDimensions")}( ${n}, ${i} )`,this.getNodeType(t),e)}}const sP=FE(rP);class aP extends mC{static get type(){return"MaxMipLevelNode"}constructor(t){super(0),this._textureNode=t,this.updateType=VT}get textureNode(){return this._textureNode}get texture(){return this._textureNode.value}update(){const t=this.texture,e=t.images,n=e&&e.length>0?e[0]&&e[0].image||e[0]:t.image;if(n&&void 0!==n.width){const{width:t,height:e}=n;this.value=Math.log2(Math.max(t,e))}}}const oP=FE(aP);class lP extends mC{static get type(){return"TextureNode"}constructor(t,e=null,n=null,i=null){super(t),this.isTextureNode=!0,this.uvNode=e,this.levelNode=n,this.biasNode=i,this.compareNode=null,this.depthNode=null,this.gradNode=null,this.sampler=!0,this.updateMatrix=!1,this.updateType=GT,this.referenceNode=null,this._value=t,this._matrixUniform=null,this.setUpdateMatrix(null===e)}set value(t){this.referenceNode?this.referenceNode.value=t:this._value=t}get value(){return this.referenceNode?this.referenceNode.value:this._value}getUniformHash(){return this.value.uuid}getNodeType(){return!0===this.value.isDepthTexture?"float":this.value.type===Ox?"uvec4":this.value.type===Ux?"ivec4":"vec4"}getInputType(){return"texture"}getDefaultUV(){return iP(this.value.channel)}updateReference(){return this.value}getTransformedUV(t){return null===this._matrixUniform&&(this._matrixUniform=gC(this.value.matrix)),this._matrixUniform.mul(JE(t,1)).xy}setUpdateMatrix(t){return this.updateMatrix=t,this.updateType=t?VT:GT,this}setupUV(t,e){const n=this.value;return!t.isFlipY()||!0!==n.isRenderTargetTexture&&!0!==n.isFramebufferTexture&&!0!==n.isDepthTexture||(e=this.sampler?e.flipY():e.setY(WE(sP(this,this.levelNode).y).sub(e.y).sub(1))),e}setup(t){const e=t.getNodeProperties(this);e.referenceNode=this.referenceNode;let n=this.uvNode;null!==n&&!0!==t.context.forceUVContext||!t.context.getUV||(n=t.context.getUV(this)),n||(n=this.getDefaultUV()),!0===this.updateMatrix&&(n=this.getTransformedUV(n)),n=this.setupUV(t,n);let i=this.levelNode;null===i&&t.context.getTextureLevel&&(i=t.context.getTextureLevel(this)),e.uvNode=n,e.levelNode=i,e.biasNode=this.biasNode,e.compareNode=this.compareNode,e.gradNode=this.gradNode,e.depthNode=this.depthNode}generateUV(t,e){return e.build(t,!0===this.sampler?"vec2":"ivec2")}generateSnippet(t,e,n,i,r,s,a,o){const l=this.value;let u;return u=i?t.generateTextureLevel(l,e,n,i,s):r?t.generateTextureBias(l,e,n,r,s):o?t.generateTextureGrad(l,e,n,o,s):a?t.generateTextureCompare(l,e,n,a,s):!1===this.sampler?t.generateTextureLoad(l,e,n,s):t.generateTexture(l,e,n,s),u}generate(t,e){const n=t.getNodeProperties(this),i=this.value;if(!i||!0!==i.isTexture)throw new Error("TextureNode: Need a three.js texture.");const r=super.generate(t,"property");if("sampler"===e)return r+"_sampler";if(t.isReference(e))return r;{const s=t.getDataFromNode(this);let a=s.propertyName;if(void 0===a){const{uvNode:e,levelNode:i,biasNode:o,compareNode:l,depthNode:u,gradNode:h}=n,c=this.generateUV(t,e),A=i?i.build(t,"float"):null,d=o?o.build(t,"float"):null,p=u?u.build(t,"int"):null,f=l?l.build(t,"float"):null,m=h?[h[0].build(t,"vec2"),h[1].build(t,"vec2")]:null,g=t.getVarFromNode(this);a=t.getPropertyName(g);const y=this.generateSnippet(t,r,c,A,d,p,f,m);t.addLineFlowCode(`${a} = ${y}`,this),s.snippet=y,s.propertyName=a}let o=a;const l=this.getNodeType(t);return t.needsToWorkingColorSpace(i)&&(o=LN(JN(o,l),i.colorSpace).setup(t).build(t,l)),t.format(o,l,e)}}setSampler(t){return this.sampler=t,this}getSampler(){return this.sampler}uv(t){const e=this.clone();return e.uvNode=BE(t),e.referenceNode=this.getSelf(),BE(e)}blur(t){const e=this.clone();return e.biasNode=BE(t).mul(oP(e)),e.referenceNode=this.getSelf(),BE(e)}level(t){const e=this.clone();return e.levelNode=BE(t),e.referenceNode=this.getSelf(),BE(e)}size(t){return sP(this,t)}bias(t){const e=this.clone();return e.biasNode=BE(t),e.referenceNode=this.getSelf(),BE(e)}compare(t){const e=this.clone();return e.compareNode=BE(t),e.referenceNode=this.getSelf(),BE(e)}grad(t,e){const n=this.clone();return n.gradNode=[BE(t),BE(e)],n.referenceNode=this.getSelf(),BE(n)}depth(t){const e=this.clone();return e.depthNode=BE(t),e.referenceNode=this.getSelf(),BE(e)}serialize(t){super.serialize(t),t.value=this.value.toJSON(t.meta).uuid,t.sampler=this.sampler,t.updateMatrix=this.updateMatrix,t.updateType=this.updateType}deserialize(t){super.deserialize(t),this.value=t.meta.textures[t.value],this.sampler=t.sampler,this.updateMatrix=t.updateMatrix,this.updateType=t.updateType}update(){const t=this.value,e=this._matrixUniform;null!==e&&(e.value=t.matrix),!0===t.matrixAutoUpdate&&t.updateMatrix()}clone(){const t=new this.constructor(this.value,this.uvNode,this.levelNode,this.biasNode);return t.sampler=this.sampler,t}}const uP=FE(lP),hP=(...t)=>uP(...t).setSampler(!1),cP=gC("float").label("cameraNear").setGroup(pC).onRenderUpdate((({camera:t})=>t.near)),AP=gC("float").label("cameraFar").setGroup(pC).onRenderUpdate((({camera:t})=>t.far)),dP=gC("float").label("cameraLogDepth").setGroup(pC).onRenderUpdate((({camera:t})=>2/(Math.log(t.far+1)/Math.LN2))),pP=gC("mat4").label("cameraProjectionMatrix").setGroup(pC).onRenderUpdate((({camera:t})=>t.projectionMatrix)),fP=gC("mat4").label("cameraViewMatrix").setGroup(pC).onRenderUpdate((({camera:t})=>t.matrixWorldInverse)),mP=gC(new _S).label("cameraPosition").setGroup(pC).onRenderUpdate((({camera:t},e)=>e.value.setFromMatrixPosition(t.matrixWorld)));class gP extends $T{static get type(){return"Object3DNode"}constructor(t,e=null){super(),this.scope=t,this.object3d=e,this.updateType=jT,this._uniformNode=new mC(null)}getNodeType(){const t=this.scope;return t===gP.WORLD_MATRIX?"mat4":t===gP.POSITION||t===gP.VIEW_POSITION||t===gP.DIRECTION||t===gP.SCALE?"vec3":void 0}update(t){const e=this.object3d,n=this._uniformNode,i=this.scope;if(i===gP.WORLD_MATRIX)n.value=e.matrixWorld;else if(i===gP.POSITION)n.value=n.value||new _S,n.value.setFromMatrixPosition(e.matrixWorld);else if(i===gP.SCALE)n.value=n.value||new _S,n.value.setFromMatrixScale(e.matrixWorld);else if(i===gP.DIRECTION)n.value=n.value||new _S,e.getWorldDirection(n.value);else if(i===gP.VIEW_POSITION){const i=t.camera;n.value=n.value||new _S,n.value.setFromMatrixPosition(e.matrixWorld),n.value.applyMatrix4(i.matrixWorldInverse)}}generate(t){const e=this.scope;return e===gP.WORLD_MATRIX?this._uniformNode.nodeType="mat4":e!==gP.POSITION&&e!==gP.VIEW_POSITION&&e!==gP.DIRECTION&&e!==gP.SCALE||(this._uniformNode.nodeType="vec3"),this._uniformNode.build(t)}serialize(t){super.serialize(t),t.scope=this.scope}deserialize(t){super.deserialize(t),this.scope=t.scope}}gP.WORLD_MATRIX="worldMatrix",gP.POSITION="position",gP.SCALE="scale",gP.VIEW_POSITION="viewPosition",gP.DIRECTION="direction",gP.DIRECTION,gP.WORLD_MATRIX,gP.POSITION,gP.SCALE,gP.VIEW_POSITION;class yP extends gP{static get type(){return"ModelNode"}constructor(t){super(t)}update(t){this.object3d=t.object,super.update(t)}}const vP=kE(yP,yP.WORLD_MATRIX),_P=gC(new Zb).onObjectUpdate((({object:t},e)=>e.value.getNormalMatrix(t.matrixWorld))),xP=fP.mul(vP).toVar("modelViewMatrix"),bP=nP("position","vec3"),SP=bP.varying("positionLocal"),MP=bP.varying("positionPrevious"),wP=vP.mul(SP).xyz.varying("v_positionWorld"),TP=SP.transformDirection(vP).varying("v_positionWorldDirection").normalize().toVar("positionWorldDirection"),EP=xP.mul(SP).xyz.varying("v_positionView"),CP=EP.negate().varying("v_positionViewDirection").normalize().toVar("positionViewDirection");class RP extends $T{static get type(){return"FrontFacingNode"}constructor(){super("bool"),this.isFrontFacingNode=!0}generate(t){const{renderer:e,material:n}=t;return e.coordinateSystem===Ub&&1===n.side?"false":t.getFrontFacing()}}const NP=jE(kE(RP)).mul(2).sub(1),PP=nP("normal","vec3"),DP=zE((t=>!1===t.geometry.hasAttribute("normal")?(console.warn('TSL.NormalNode: Vertex attribute "normal" not found on geometry.'),JE(0,1,0)):PP),"vec3").once()().toVar("normalLocal"),IP=EP.dFdx().cross(EP.dFdy()).normalize().toVar("normalFlat"),LP=zE((t=>{let e;return e=!0===t.material.flatShading?IP:CN(zP(DP),"v_normalView").normalize(),e}),"vec3").once()().toVar("normalView"),BP=CN(LP.transformDirection(fP),"v_normalWorld").normalize().toVar("normalWorld"),UP=zE((t=>t.context.setupNormal()),"vec3").once()().mul(NP).toVar("transformedNormalView"),OP=UP.transformDirection(fP).toVar("transformedNormalWorld"),FP=zE((t=>t.context.setupClearcoatNormal()),"vec3").once()().mul(NP).toVar("transformedClearcoatNormalView"),kP=zE((([t,e=vP])=>{const n=lC(e),i=t.div(JE(n[0].dot(n[0]),n[1].dot(n[1]),n[2].dot(n[2])));return n.mul(i).xyz})),zP=zE((([t],e)=>{const n=e.renderer.nodes.modelNormalViewMatrix;if(null!==n)return n.transformDirection(t);const i=_P.mul(t);return fP.transformDirection(i)})),qP=gC(0).onReference((({material:t})=>t)).onRenderUpdate((({material:t})=>t.refractionRatio)),GP=CP.negate().reflect(UP),VP=CP.negate().refract(UP,qP),HP=GP.transformDirection(fP).toVar("reflectVector"),jP=VP.transformDirection(fP).toVar("reflectVector");class WP extends lP{static get type(){return"CubeTextureNode"}constructor(t,e=null,n=null,i=null){super(t,e,n,i),this.isCubeTextureNode=!0}getInputType(){return"cubeTexture"}getDefaultUV(){const t=this.value;return t.mapping===vx?HP:t.mapping===_x?jP:(console.error('THREE.CubeTextureNode: Mapping "%s" not supported.',t.mapping),JE(0,0,0))}setUpdateMatrix(){}setupUV(t,e){const n=this.value;return t.renderer.coordinateSystem!==Ob&&n.isRenderTargetTexture?e:JE(e.x.negate(),e.yz)}generateUV(t,e){return e.build(t,"vec3")}}const XP=FE(WP);class YP extends mC{static get type(){return"BufferNode"}constructor(t,e,n=0){super(t,e),this.isBufferNode=!0,this.bufferType=e,this.bufferCount=n}getElementType(t){return this.getNodeType(t)}getInputType(){return"buffer"}}const QP=(t,e,n)=>BE(new YP(t,e,n));class $P extends ZT{static get type(){return"UniformArrayElementNode"}constructor(t,e){super(t,e),this.isArrayBufferElementNode=!0}generate(t){const e=super.generate(t),n=this.getNodeType();return t.format(e,"vec4",n)}}class ZP extends YP{static get type(){return"UniformArrayNode"}constructor(t,e=null){super(null,"vec4"),this.array=t,this.elementType=e,this._elementType=null,this._elementLength=0,this.updateType=HT,this.isArrayBufferNode=!0}getElementType(){return this.elementType||this._elementType}getElementLength(){return this._elementLength}update(){const{array:t,value:e}=this,n=this.getElementLength(),i=this.getElementType();if(1===n)for(let n=0;n<t.length;n++){e[4*n]=t[n]}else if("color"===i)for(let n=0;n<t.length;n++){const i=4*n,r=t[n];e[i]=r.r,e[i+1]=r.g,e[i+2]=r.b||0}else for(let n=0;n<t.length;n++){const i=4*n,r=t[n];e[i]=r.x,e[i+1]=r.y,e[i+2]=r.z||0,e[i+3]=r.w||0}}setup(t){const e=this.array.length;this._elementType=null===this.elementType?kT(this.array[0]):this.elementType,this._elementLength=t.getTypeLength(this._elementType);let n=Float32Array;return"i"===this._elementType.charAt(0)?n=Int32Array:"u"===this._elementType.charAt(0)&&(n=Uint32Array),this.value=new n(4*e),this.bufferCount=e,this.bufferType=t.changeComponentType("vec4",t.getComponentType(this._elementType)),super.setup(t)}element(t){return BE(new $P(this,BE(t)))}}const KP=(t,e)=>BE(new ZP(t,e));class JP extends ZT{static get type(){return"ReferenceElementNode"}constructor(t,e){super(t,e),this.referenceNode=t,this.isReferenceElementNode=!0}getNodeType(){return this.referenceNode.uniformType}generate(t){const e=super.generate(t),n=this.referenceNode.getNodeType(),i=this.getNodeType();return t.format(e,n,i)}}class tD extends $T{static get type(){return"ReferenceNode"}constructor(t,e,n=null,i=null){super(),this.property=t,this.uniformType=e,this.object=n,this.count=i,this.properties=t.split("."),this.reference=n,this.node=null,this.group=null,this.name=null,this.updateType=jT}element(t){return BE(new JP(this,BE(t)))}setGroup(t){return this.group=t,this}label(t){return this.name=t,this}setNodeType(t){let e=null;e=null!==this.count?QP(null,t,this.count):Array.isArray(this.getValueFromReference())?KP(null,t):"texture"===t?uP(null):"cubeTexture"===t?XP(null):gC(null,t),null!==this.group&&e.setGroup(this.group),null!==this.name&&e.label(this.name),this.node=e.getSelf()}getNodeType(t){return null===this.node&&(this.updateReference(t),this.updateValue()),this.node.getNodeType(t)}getValueFromReference(t=this.reference){const{properties:e}=this;let n=t[e[0]];for(let t=1;t<e.length;t++)n=n[e[t]];return n}updateReference(t){return this.reference=null!==this.object?this.object:t.object,this.reference}setup(){return this.updateValue(),this.node}update(){this.updateValue()}updateValue(){null===this.node&&this.setNodeType(this.uniformType);const t=this.getValueFromReference();Array.isArray(t)?this.node.array=t:this.node.value=t}}const eD=(t,e,n)=>BE(new tD(t,e,n)),nD=(t,e,n,i)=>BE(new tD(t,e,i,n));class iD extends tD{static get type(){return"MaterialReferenceNode"}constructor(t,e,n=null){super(t,e,n),this.material=n,this.isMaterialReferenceNode=!0}updateReference(t){return this.reference=null!==this.material?this.material:t.material,this.reference}}const rD=(t,e,n)=>BE(new iD(t,e,n)),sD=zE((t=>(!1===t.geometry.hasAttribute("tangent")&&t.geometry.computeTangents(),nP("tangent","vec4"))))(),aD=sD.xyz.toVar("tangentLocal"),oD=xP.mul(iC(aD,0)).xyz.varying("v_tangentView").normalize().toVar("tangentView");var lD;const uD=lC(oD,CN((lD=LP.cross(oD),lD.mul(sD.w).xyz),"v_bitangentView").normalize().toVar("bitangentView"),LP),hD=(()=>{let t=BC.cross(CP);return t=t.cross(BC).normalize(),t=fN(t,UP,IC.mul(SC.oneMinus()).oneMinus().pow2().pow2()).normalize(),t})(),cD=zE((t=>{const{eye_pos:e,surf_norm:n,mapN:i,uv:r}=t,s=e.dFdx(),a=e.dFdy(),o=r.dFdx(),l=r.dFdy(),u=n,h=a.cross(u),c=u.cross(s),A=h.mul(o.x).add(c.mul(l.x)),d=h.mul(o.y).add(c.mul(l.y)),p=A.dot(A).max(d.dot(d)),f=NP.mul(p.inverseSqrt());return ZC(A.mul(i.x,f),d.mul(i.y,f),u.mul(i.z)).normalize()}));class AD extends JT{static get type(){return"NormalMapNode"}constructor(t,e=null){super("vec3"),this.node=t,this.scaleNode=e,this.normalMapType=0}setup(t){const{normalMapType:e,scaleNode:n}=this;let i=this.node.mul(2).sub(1);null!==n&&(i=JE(i.xy.mul(n),i.z));let r=null;if(1===e)r=zP(i);else if(0===e){r=!0===t.hasGeometryAttribute("tangent")?uD.mul(i).normalize():cD({eye_pos:EP,surf_norm:LP,mapN:i,uv:iP()})}return r}}const dD=FE(AD),pD=zE((({textureNode:t,bumpScale:e})=>{const n=e=>t.cache().context({getUV:t=>e(t.uvNode||iP()),forceUVContext:!0}),i=jE(n((t=>t)));return QE(jE(n((t=>t.add(t.dFdx())))).sub(i),jE(n((t=>t.add(t.dFdy())))).sub(i)).mul(e)})),fD=zE((t=>{const{surf_pos:e,surf_norm:n,dHdxy:i}=t,r=e.dFdx().normalize(),s=n,a=e.dFdy().normalize().cross(s),o=s.cross(r),l=r.dot(a).mul(NP),u=l.sign().mul(i.x.mul(a).add(i.y.mul(o)));return l.abs().mul(n).sub(u).normalize()}));class mD extends JT{static get type(){return"BumpMapNode"}constructor(t,e=null){super("vec3"),this.textureNode=t,this.scaleNode=e}setup(){const t=null!==this.scaleNode?this.scaleNode:1,e=pD({textureNode:this.textureNode,bumpScale:t});return fD({surf_pos:EP,surf_norm:LP,dHdxy:e})}}const gD=FE(mD),yD=new Map;class vD extends $T{static get type(){return"MaterialNode"}constructor(t){super(),this.scope=t}getCache(t,e){let n=yD.get(t);return void 0===n&&(n=rD(t,e),yD.set(t,n)),n}getFloat(t){return this.getCache(t,"float")}getColor(t){return this.getCache(t,"color")}getTexture(t){return this.getCache("map"===t?"map":t+"Map","texture")}setup(t){const e=t.context.material,n=this.scope;let i=null;if(n===vD.COLOR){const t=void 0!==e.color?this.getColor(n):JE();i=e.map&&!0===e.map.isTexture?t.mul(this.getTexture("map")):t}else if(n===vD.OPACITY){const t=this.getFloat(n);i=e.alphaMap&&!0===e.alphaMap.isTexture?t.mul(this.getTexture("alpha")):t}else if(n===vD.SPECULAR_STRENGTH)i=e.specularMap&&!0===e.specularMap.isTexture?this.getTexture("specular").r:jE(1);else if(n===vD.SPECULAR_INTENSITY){const t=this.getFloat(n);i=e.specularMap?t.mul(this.getTexture(n).a):t}else if(n===vD.SPECULAR_COLOR){const t=this.getColor(n);i=e.specularColorMap&&!0===e.specularColorMap.isTexture?t.mul(this.getTexture(n).rgb):t}else if(n===vD.ROUGHNESS){const t=this.getFloat(n);i=e.roughnessMap&&!0===e.roughnessMap.isTexture?t.mul(this.getTexture(n).g):t}else if(n===vD.METALNESS){const t=this.getFloat(n);i=e.metalnessMap&&!0===e.metalnessMap.isTexture?t.mul(this.getTexture(n).b):t}else if(n===vD.EMISSIVE){const t=this.getFloat("emissiveIntensity"),r=this.getColor(n).mul(t);i=e.emissiveMap&&!0===e.emissiveMap.isTexture?r.mul(this.getTexture(n)):r}else if(n===vD.NORMAL)e.normalMap?(i=dD(this.getTexture("normal"),this.getCache("normalScale","vec2")),i.normalMapType=e.normalMapType):i=e.bumpMap?gD(this.getTexture("bump").r,this.getFloat("bumpScale")):LP;else if(n===vD.CLEARCOAT){const t=this.getFloat(n);i=e.clearcoatMap&&!0===e.clearcoatMap.isTexture?t.mul(this.getTexture(n).r):t}else if(n===vD.CLEARCOAT_ROUGHNESS){const t=this.getFloat(n);i=e.clearcoatRoughnessMap&&!0===e.clearcoatRoughnessMap.isTexture?t.mul(this.getTexture(n).r):t}else if(n===vD.CLEARCOAT_NORMAL)i=e.clearcoatNormalMap?dD(this.getTexture(n),this.getCache(n+"Scale","vec2")):LP;else if(n===vD.SHEEN){const t=this.getColor("sheenColor").mul(this.getFloat("sheen"));i=e.sheenColorMap&&!0===e.sheenColorMap.isTexture?t.mul(this.getTexture("sheenColor").rgb):t}else if(n===vD.SHEEN_ROUGHNESS){const t=this.getFloat(n);i=e.sheenRoughnessMap&&!0===e.sheenRoughnessMap.isTexture?t.mul(this.getTexture(n).a):t,i=i.clamp(.07,1)}else if(n===vD.ANISOTROPY)if(e.anisotropyMap&&!0===e.anisotropyMap.isTexture){const t=this.getTexture(n);i=oC(tI.x,tI.y,tI.y.negate(),tI.x).mul(t.rg.mul(2).sub(QE(1)).normalize().mul(t.b))}else i=tI;else if(n===vD.IRIDESCENCE_THICKNESS){const t=eD("1","float",e.iridescenceThicknessRange);if(e.iridescenceThicknessMap){const r=eD("0","float",e.iridescenceThicknessRange);i=t.sub(r).mul(this.getTexture(n).g).add(r)}else i=t}else if(n===vD.TRANSMISSION){const t=this.getFloat(n);i=e.transmissionMap?t.mul(this.getTexture(n).r):t}else if(n===vD.THICKNESS){const t=this.getFloat(n);i=e.thicknessMap?t.mul(this.getTexture(n).g):t}else if(n===vD.IOR)i=this.getFloat(n);else if(n===vD.LIGHT_MAP)i=this.getTexture(n).rgb.mul(this.getFloat("lightMapIntensity"));else if(n===vD.AO_MAP)i=this.getTexture(n).r.sub(1).mul(this.getFloat("aoMapIntensity")).add(1);else{const e=this.getNodeType(t);i=this.getCache(n,e)}return i}}vD.ALPHA_TEST="alphaTest",vD.COLOR="color",vD.OPACITY="opacity",vD.SHININESS="shininess",vD.SPECULAR="specular",vD.SPECULAR_STRENGTH="specularStrength",vD.SPECULAR_INTENSITY="specularIntensity",vD.SPECULAR_COLOR="specularColor",vD.REFLECTIVITY="reflectivity",vD.ROUGHNESS="roughness",vD.METALNESS="metalness",vD.NORMAL="normal",vD.CLEARCOAT="clearcoat",vD.CLEARCOAT_ROUGHNESS="clearcoatRoughness",vD.CLEARCOAT_NORMAL="clearcoatNormal",vD.EMISSIVE="emissive",vD.ROTATION="rotation",vD.SHEEN="sheen",vD.SHEEN_ROUGHNESS="sheenRoughness",vD.ANISOTROPY="anisotropy",vD.IRIDESCENCE="iridescence",vD.IRIDESCENCE_IOR="iridescenceIOR",vD.IRIDESCENCE_THICKNESS="iridescenceThickness",vD.IOR="ior",vD.TRANSMISSION="transmission",vD.THICKNESS="thickness",vD.ATTENUATION_DISTANCE="attenuationDistance",vD.ATTENUATION_COLOR="attenuationColor",vD.LINE_SCALE="scale",vD.LINE_DASH_SIZE="dashSize",vD.LINE_GAP_SIZE="gapSize",vD.LINE_WIDTH="linewidth",vD.LINE_DASH_OFFSET="dashOffset",vD.POINT_WIDTH="pointWidth",vD.DISPERSION="dispersion",vD.LIGHT_MAP="light",vD.AO_MAP="ao";const _D=kE(vD,vD.ALPHA_TEST),xD=kE(vD,vD.COLOR),bD=kE(vD,vD.SHININESS),SD=kE(vD,vD.EMISSIVE),MD=kE(vD,vD.OPACITY),wD=kE(vD,vD.SPECULAR),TD=kE(vD,vD.SPECULAR_INTENSITY),ED=kE(vD,vD.SPECULAR_COLOR),CD=kE(vD,vD.SPECULAR_STRENGTH),RD=kE(vD,vD.REFLECTIVITY),ND=kE(vD,vD.ROUGHNESS),PD=kE(vD,vD.METALNESS),DD=kE(vD,vD.NORMAL).context({getUV:null}),ID=kE(vD,vD.CLEARCOAT),LD=kE(vD,vD.CLEARCOAT_ROUGHNESS),BD=kE(vD,vD.CLEARCOAT_NORMAL).context({getUV:null}),UD=kE(vD,vD.ROTATION),OD=kE(vD,vD.SHEEN),FD=kE(vD,vD.SHEEN_ROUGHNESS),kD=kE(vD,vD.ANISOTROPY),zD=kE(vD,vD.IRIDESCENCE),qD=kE(vD,vD.IRIDESCENCE_IOR),GD=kE(vD,vD.IRIDESCENCE_THICKNESS),VD=kE(vD,vD.TRANSMISSION),HD=kE(vD,vD.THICKNESS),jD=kE(vD,vD.IOR),WD=kE(vD,vD.ATTENUATION_DISTANCE),XD=kE(vD,vD.ATTENUATION_COLOR),YD=kE(vD,vD.LINE_SCALE),QD=kE(vD,vD.LINE_DASH_SIZE),$D=kE(vD,vD.LINE_GAP_SIZE);vD.LINE_WIDTH,vD.LINE_DASH_OFFSET,vD.POINT_WIDTH;const ZD=kE(vD,vD.DISPERSION),KD=kE(vD,vD.LIGHT_MAP),JD=kE(vD,vD.AO_MAP),tI=gC(new $b).onReference((function(t){return t.material})).onRenderUpdate((function({material:t}){this.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation))}));class eI extends JT{static get type(){return"ModelViewProjectionNode"}constructor(t=null){super("vec4"),this.positionNode=t}setup(t){if("fragment"===t.shaderStage)return CN(t.context.mvp);const e=this.positionNode||SP,n=t.renderer.nodes.modelViewMatrix||xP;return pP.mul(n).mul(e)}}const nI=FE(eI);class iI extends $T{static get type(){return"IndexNode"}constructor(t){super("uint"),this.scope=t,this.isInstanceIndexNode=!0}generate(t){const e=this.getNodeType(t),n=this.scope;let i,r;if(n===iI.VERTEX)i=t.getVertexIndex();else if(n===iI.INSTANCE)i=t.getInstanceIndex();else if(n===iI.DRAW)i=t.getDrawIndex();else if(n===iI.INVOCATION_LOCAL)i=t.getInvocationLocalIndex();else if(n===iI.INVOCATION_SUBGROUP)i=t.getInvocationSubgroupIndex();else{if(n!==iI.SUBGROUP)throw new Error("THREE.IndexNode: Unknown scope: "+n);i=t.getSubgroupIndex()}if("vertex"===t.shaderStage||"compute"===t.shaderStage)r=i;else{r=CN(this).build(t,e)}return r}}iI.VERTEX="vertex",iI.INSTANCE="instance",iI.SUBGROUP="subgroup",iI.INVOCATION_LOCAL="invocationLocal",iI.INVOCATION_SUBGROUP="invocationSubgroup",iI.DRAW="draw";const rI=kE(iI,iI.VERTEX),sI=kE(iI,iI.INSTANCE);iI.SUBGROUP,iI.INVOCATION_SUBGROUP,iI.INVOCATION_LOCAL;const aI=kE(iI,iI.DRAW);class oI extends $T{static get type(){return"InstanceNode"}constructor(t){super("void"),this.instanceMesh=t,this.instanceMatrixNode=null,this.instanceColorNode=null,this.updateType=VT,this.buffer=null,this.bufferColor=null}setup(t){let e=this.instanceMatrixNode,n=this.instanceColorNode;const i=this.instanceMesh;if(null===e){const t=i.instanceMatrix;if(i.count<=1e3)e=QP(t.array,"mat4",Math.max(i.count,1)).element(sI);else{const n=new PT(t.array,16,1);this.buffer=n;const i=t.usage===Bb?HN:VN,r=[i(n,"vec4",16,0),i(n,"vec4",16,4),i(n,"vec4",16,8),i(n,"vec4",16,12)];e=uC(...r)}this.instanceMatrixNode=e}const r=i.instanceColor;if(r&&null===n){const t=new Vw(r.array,3),e=r.usage===Bb?HN:VN;this.bufferColor=t,n=JE(e(t,"vec3",3,0)),this.instanceColorNode=n}const s=e.mul(SP).xyz;if(SP.assign(s),t.hasGeometryAttribute("normal")){const t=kP(DP,e);DP.assign(t)}null!==this.instanceColorNode&&_C("vec3","vInstanceColor").assign(this.instanceColorNode)}update(){this.instanceMesh.instanceMatrix.usage!==Bb&&null!=this.buffer&&this.instanceMesh.instanceMatrix.version!==this.buffer.version&&(this.buffer.version=this.instanceMesh.instanceMatrix.version),this.instanceMesh.instanceColor&&this.instanceMesh.instanceColor.usage!==Bb&&null!=this.bufferColor&&this.instanceMesh.instanceColor.version!==this.bufferColor.version&&(this.bufferColor.version=this.instanceMesh.instanceColor.version)}}const lI=FE(oI);class uI extends $T{static get type(){return"BatchNode"}constructor(t){super("void"),this.batchMesh=t,this.batchingIdNode=null}setup(t){null===this.batchingIdNode&&(null===t.getDrawIndex()?this.batchingIdNode=sI:this.batchingIdNode=aI);const e=zE((([t])=>{const e=sP(hP(this.batchMesh._indirectTexture),0),n=WE(t).modInt(WE(e)),i=WE(t).div(WE(e));return hP(this.batchMesh._indirectTexture,$E(n,i)).x})).setLayout({name:"getIndirectIndex",type:"uint",inputs:[{name:"id",type:"int"}]}),n=e(WE(this.batchingIdNode)),i=this.batchMesh._matricesTexture,r=sP(hP(i),0),s=jE(n).mul(4).toInt().toVar(),a=s.modInt(r),o=s.div(WE(r)),l=uC(hP(i,$E(a,o)),hP(i,$E(a.add(1),o)),hP(i,$E(a.add(2),o)),hP(i,$E(a.add(3),o))),u=this.batchMesh._colorsTexture;if(null!==u){const t=zE((([t])=>{const e=sP(hP(u),0).x,n=t,i=n.modInt(e),r=n.div(e);return hP(u,$E(i,r)).rgb})).setLayout({name:"getBatchingColor",type:"vec3",inputs:[{name:"id",type:"int"}]}),e=t(n);_C("vec3","vBatchColor").assign(e)}const h=lC(l);SP.assign(l.mul(SP));const c=DP.div(JE(h[0].dot(h[0]),h[1].dot(h[1]),h[2].dot(h[2]))),A=h.mul(c).xyz;DP.assign(A),t.hasGeometryAttribute("tangent")&&aD.mulAssign(h)}}const hI=FE(uI),cI=new WeakMap;class AI extends $T{static get type(){return"SkinningNode"}constructor(t,e=!1){let n,i,r;super("void"),this.skinnedMesh=t,this.useReference=e,this.updateType=jT,this.skinIndexNode=nP("skinIndex","uvec4"),this.skinWeightNode=nP("skinWeight","vec4"),e?(n=eD("bindMatrix","mat4"),i=eD("bindMatrixInverse","mat4"),r=nD("skeleton.boneMatrices","mat4",t.skeleton.bones.length)):(n=gC(t.bindMatrix,"mat4"),i=gC(t.bindMatrixInverse,"mat4"),r=QP(t.skeleton.boneMatrices,"mat4",t.skeleton.bones.length)),this.bindMatrixNode=n,this.bindMatrixInverseNode=i,this.boneMatricesNode=r,this.previousBoneMatricesNode=null}getSkinnedPosition(t=this.boneMatricesNode,e=SP){const{skinIndexNode:n,skinWeightNode:i,bindMatrixNode:r,bindMatrixInverseNode:s}=this,a=t.element(n.x),o=t.element(n.y),l=t.element(n.z),u=t.element(n.w),h=r.mul(e),c=ZC(a.mul(i.x).mul(h),o.mul(i.y).mul(h),l.mul(i.z).mul(h),u.mul(i.w).mul(h));return s.mul(c).xyz}getSkinnedNormal(t=this.boneMatricesNode,e=DP){const{skinIndexNode:n,skinWeightNode:i,bindMatrixNode:r,bindMatrixInverseNode:s}=this,a=t.element(n.x),o=t.element(n.y),l=t.element(n.z),u=t.element(n.w);let h=ZC(i.x.mul(a),i.y.mul(o),i.z.mul(l),i.w.mul(u));return h=s.mul(h).mul(r),h.transformDirection(e).xyz}getPreviousSkinnedPosition(t){const e=t.object;return null===this.previousBoneMatricesNode&&(e.skeleton.previousBoneMatrices=new Float32Array(e.skeleton.boneMatrices),this.previousBoneMatricesNode=nD("skeleton.previousBoneMatrices","mat4",e.skeleton.bones.length)),this.getSkinnedPosition(this.previousBoneMatricesNode,MP)}needsPreviousBoneMatrices(t){const e=t.renderer.getMRT();return e&&e.has("velocity")}setup(t){this.needsPreviousBoneMatrices(t)&&MP.assign(this.getPreviousSkinnedPosition(t));const e=this.getSkinnedPosition();if(SP.assign(e),t.hasGeometryAttribute("normal")){const e=this.getSkinnedNormal();DP.assign(e),t.hasGeometryAttribute("tangent")&&aD.assign(e)}}generate(t,e){if("void"!==e)return SP.build(t,e)}update(t){const e=(this.useReference?t.object:this.skinnedMesh).skeleton;cI.get(e)!==t.frameId&&(cI.set(e,t.frameId),null!==this.previousBoneMatricesNode&&e.previousBoneMatrices.set(e.boneMatrices),e.update())}}class dI extends $T{static get type(){return"LoopNode"}constructor(t=[]){super(),this.params=t}getVarName(t){return String.fromCharCode("i".charCodeAt()+t)}getProperties(t){const e=t.getNodeProperties(this);if(void 0!==e.stackNode)return e;const n={};for(let t=0,e=this.params.length-1;t<e;t++){const e=this.params[t],i=!0!==e.isNode&&e.name||this.getVarName(t),r=!0!==e.isNode&&e.type||"int";n[i]=JN(i,r)}const i=t.addStack();return e.returnsNode=this.params[this.params.length-1](n,i,t),e.stackNode=i,t.removeStack(),e}getNodeType(t){const{returnsNode:e}=this.getProperties(t);return e?e.getNodeType(t):"void"}setup(t){this.getProperties(t)}generate(t){const e=this.getProperties(t),n=this.params,i=e.stackNode;for(let e=0,i=n.length-1;e<i;e++){const i=n[e];let r=null,s=null,a=null,o=null,l=null,u=null;i.isNode?(o="int",a=this.getVarName(e),r="0",s=i.build(t,o),l="<"):(o=i.type||"int",a=i.name||this.getVarName(e),r=i.start,s=i.end,l=i.condition,u=i.update,"number"==typeof r?r=r.toString():r&&r.isNode&&(r=r.build(t,o)),"number"==typeof s?s=s.toString():s&&s.isNode&&(s=s.build(t,o)),void 0!==r&&void 0===s?(r+=" - 1",s="0",l=">="):void 0!==s&&void 0===r&&(r="0",l="<"),void 0===l&&(l=Number(r)>Number(s)?">=":"<"));const h={start:r,end:s,condition:l},c=h.start,A=h.end;let d="",p="",f="";u||(u="int"===o||"uint"===o?l.includes("<")?"++":"--":l.includes("<")?"+= 1.":"-= 1."),d+=t.getVar(o,a)+" = "+c,p+=a+" "+l+" "+A,f+=a+" "+u;const m=`for ( ${d}; ${p}; ${f} )`;t.addFlowCode((0===e?"\n":"")+t.tab+m+" {\n\n").addFlowTab()}const r=i.build(t,"void"),s=e.returnsNode?e.returnsNode.build(t):"";t.removeFlowTab().addFlowCode("\n"+t.tab+r);for(let e=0,n=this.params.length-1;e<n;e++)t.addFlowCode((0===e?"":t.tab)+"}\n\n").removeFlowTab();return t.addFlowTab(),s}}const pI=(...t)=>BE(new dI(OE(t,"int"))).append(),fI=new WeakMap,mI=new fS,gI=zE((({bufferMap:t,influence:e,stride:n,width:i,depth:r,offset:s})=>{const a=WE(rI).mul(n).add(s),o=a.div(i),l=a.sub(o.mul(i));return hP(t,$E(l,o)).depth(r).mul(e)}));class yI extends $T{static get type(){return"MorphNode"}constructor(t){super("void"),this.mesh=t,this.morphBaseInfluence=gC(1),this.updateType=jT}setup(t){const{geometry:e}=t,n=void 0!==e.morphAttributes.position,i=e.hasAttribute("normal")&&void 0!==e.morphAttributes.normal,r=e.morphAttributes.position||e.morphAttributes.normal||e.morphAttributes.color,s=void 0!==r?r.length:0,{texture:a,stride:o,size:l}=function(t){const e=void 0!==t.morphAttributes.position,n=void 0!==t.morphAttributes.normal,i=void 0!==t.morphAttributes.color,r=t.morphAttributes.position||t.morphAttributes.normal||t.morphAttributes.color,s=void 0!==r?r.length:0;let a=fI.get(t);if(void 0===a||a.count!==s){void 0!==a&&a.texture.dispose();const o=t.morphAttributes.position||[],l=t.morphAttributes.normal||[],u=t.morphAttributes.color||[];let h=0;!0===e&&(h=1),!0===n&&(h=2),!0===i&&(h=3);let c=t.attributes.position.count*h,A=1;const d=4096;c>d&&(A=Math.ceil(c/d),c=d);const p=new Float32Array(c*A*4*s),f=new yS(p,c,A,s);f.type=Fx,f.needsUpdate=!0;const m=4*h;for(let y=0;y<s;y++){const v=o[y],_=l[y],x=u[y],b=c*A*4*y;for(let S=0;S<v.count;S++){const M=S*m;!0===e&&(mI.fromBufferAttribute(v,S),p[b+M+0]=mI.x,p[b+M+1]=mI.y,p[b+M+2]=mI.z,p[b+M+3]=0),!0===n&&(mI.fromBufferAttribute(_,S),p[b+M+4]=mI.x,p[b+M+5]=mI.y,p[b+M+6]=mI.z,p[b+M+7]=0),!0===i&&(mI.fromBufferAttribute(x,S),p[b+M+8]=mI.x,p[b+M+9]=mI.y,p[b+M+10]=mI.z,p[b+M+11]=4===x.itemSize?mI.w:1)}}function g(){f.dispose(),fI.delete(t),t.removeEventListener("dispose",g)}a={count:s,texture:f,stride:h,size:new $b(c,A)},fI.set(t,a),t.addEventListener("dispose",g)}return a}(e);!0===n&&SP.mulAssign(this.morphBaseInfluence),!0===i&&DP.mulAssign(this.morphBaseInfluence);const u=WE(l.width);pI(s,(({i:t})=>{const e=jE(0).toVar();this.mesh.count>1&&null!==this.mesh.morphTexture&&void 0!==this.mesh.morphTexture?e.assign(hP(this.mesh.morphTexture,$E(WE(t).add(1),WE(sI))).r):e.assign(eD("morphTargetInfluences","float").element(t).toVar()),!0===n&&SP.addAssign(gI({bufferMap:a,influence:e,stride:o,width:u,depth:t,offset:WE(0)})),!0===i&&DP.addAssign(gI({bufferMap:a,influence:e,stride:o,width:u,depth:t,offset:WE(1)}))}))}update(){const t=this.morphBaseInfluence;this.mesh.geometry.morphTargetsRelative?t.value=1:t.value=1-this.mesh.morphTargetInfluences.reduce(((t,e)=>t+e),0)}}const vI=FE(yI),_I=(t,e)=>{for(const n of e)if(n.isAnalyticLightNode&&n.light.id===t)return n;return null},xI=new WeakMap;class bI extends $T{static get type(){return"LightsNode"}constructor(t=[]){super("vec3"),this.totalDiffuseNode=JE().toVar("totalDiffuse"),this.totalSpecularNode=JE().toVar("totalSpecular"),this.outgoingLightNode=JE().toVar("outgoingLight"),this._lights=t,this._lightNodes=null,this._lightNodesHash=null,this.global=!0}getHash(t){if(null===this._lightNodesHash){null===this._lightNodes&&this.setupLightsNode(t);const e=[];for(const t of this._lightNodes)e.push(t.getHash());this._lightNodesHash="lights-"+e.join(",")}return this._lightNodesHash}analyze(t){const e=t.getDataFromNode(this);for(const n of e.nodes)n.build(t)}setupLightsNode(t){const e=[],n=this._lightNodes,i=(t=>t.sort(((t,e)=>t.id-e.id)))(this._lights),r=t.renderer.nodes.library;for(const t of i)if(t.isNode)e.push(BE(t));else{let i=null;if(null!==n&&(i=_I(t.id,n)),null===i){const n=r.getLightNodeClass(t.constructor);if(null===n){console.warn(`LightsNode.setupNodeLights: Light node not found for ${t.constructor.name}`);continue}let i=null;xI.has(t)?i=xI.get(t):(i=new n(t),xI.set(t,i)),e.push(i)}}this._lightNodes=e}setup(t){null===this._lightNodes&&this.setupLightsNode(t);const e=t.context,n=e.lightingModel;let i=this.outgoingLightNode;if(n){const{_lightNodes:r,totalDiffuseNode:s,totalSpecularNode:a}=this;e.outgoingLight=i;const o=t.addStack();t.getDataFromNode(this).nodes=o.nodes,n.start(e,o,t);for(const e of r)e.build(t);n.indirect(e,o,t);const{backdrop:l,backdropAlpha:u}=e,{directDiffuse:h,directSpecular:c,indirectDiffuse:A,indirectSpecular:d}=e.reflectedLight;let p=h.add(A);null!==l&&(p=JE(null!==u?u.mix(p,l):l),e.material.transparent=!0),s.assign(p),a.assign(c.add(d)),i.assign(s.add(a)),n.finish(e,o,t),i=i.bypass(t.removeStack())}return i}setLights(t){return this._lights=t,this._lightNodes=null,this._lightNodesHash=null,this}getLights(){return this._lights}}const SI=FE(bI);class MI extends $T{static get type(){return"LightingNode"}constructor(){super("vec3"),this.isLightingNode=!0}generate(){console.warn("Abstract function.")}}class wI extends MI{static get type(){return"AONode"}constructor(t=null){super(),this.aoNode=t}setup(t){t.context.ambientOcclusion.mulAssign(this.aoNode)}}class TI extends SN{static get type(){return"LightingContextNode"}constructor(t,e=null,n=null,i=null){super(t),this.lightingModel=e,this.backdropNode=n,this.backdropAlphaNode=i,this._value=null}getContext(){const{backdropNode:t,backdropAlphaNode:e}=this,n={directDiffuse:JE().toVar("directDiffuse"),directSpecular:JE().toVar("directSpecular"),indirectDiffuse:JE().toVar("indirectDiffuse"),indirectSpecular:JE().toVar("indirectSpecular")};return{radiance:JE().toVar("radiance"),irradiance:JE().toVar("irradiance"),iblIrradiance:JE().toVar("iblIrradiance"),ambientOcclusion:jE(1).toVar("ambientOcclusion"),reflectedLight:n,backdrop:t,backdropAlpha:e}}setup(t){return this.value=this._value||(this._value=this.getContext()),this.value.lightingModel=this.lightingModel||t.context.lightingModel,super.setup(t)}}const EI=FE(TI);class CI extends MI{static get type(){return"IrradianceNode"}constructor(t){super(),this.node=t}setup(t){t.context.irradiance.addAssign(this.node)}}let RI,NI;class PI extends $T{static get type(){return"ScreenNode"}constructor(t){super(),this.scope=t,this.isViewportNode=!0}getNodeType(){return this.scope===PI.VIEWPORT?"vec4":"vec2"}getUpdateType(){let t=GT;return this.scope!==PI.SIZE&&this.scope!==PI.VIEWPORT||(t=HT),this.updateType=t,t}update({renderer:t}){const e=t.getRenderTarget();this.scope===PI.VIEWPORT?null!==e?NI.copy(e.viewport):(t.getViewport(NI),NI.multiplyScalar(t.getPixelRatio())):null!==e?(RI.width=e.width,RI.height=e.height):t.getDrawingBufferSize(RI)}setup(){const t=this.scope;let e=null;return e=t===PI.SIZE?gC(RI||(RI=new $b)):t===PI.VIEWPORT?gC(NI||(NI=new fS)):QE(LI.div(II)),e}generate(t){if(this.scope===PI.COORDINATE){let e=t.getFragCoord();if(t.isFlipY()){const n=t.getNodeProperties(II).outputNode.build(t);e=`${t.getType("vec2")}( ${e}.x, ${n}.y - ${e}.y )`}return e}return super.generate(t)}}PI.COORDINATE="coordinate",PI.VIEWPORT="viewport",PI.SIZE="size",PI.UV="uv";const DI=kE(PI,PI.UV),II=kE(PI,PI.SIZE),LI=kE(PI,PI.COORDINATE),BI=kE(PI,PI.VIEWPORT);BI.zw,BI.xy;const UI=new $b;class OI extends lP{static get type(){return"ViewportTextureNode"}constructor(t=DI,e=null,n=null){null===n&&((n=new Jw).minFilter=Px),super(n,t,e),this.generateMipmaps=!1,this.isOutputTextureNode=!0,this.updateBeforeType=VT}updateBefore(t){const e=t.renderer;e.getDrawingBufferSize(UI);const n=this.value;n.image.width===UI.width&&n.image.height===UI.height||(n.image.width=UI.width,n.image.height=UI.height,n.needsUpdate=!0);const i=n.generateMipmaps;n.generateMipmaps=this.generateMipmaps,e.copyFramebufferToTexture(n),n.generateMipmaps=i}clone(){const t=new this.constructor(this.uvNode,this.levelNode,this.value);return t.generateMipmaps=this.generateMipmaps,t}}const FI=FE(OI,null,null,{generateMipmaps:!0});let kI=null;class zI extends OI{static get type(){return"ViewportDepthTextureNode"}constructor(t=DI,e=null){null===kI&&(kI=new tT),super(t,e,kI)}}const qI=FE(zI);class GI extends $T{static get type(){return"ViewportDepthNode"}constructor(t,e=null){super("float"),this.scope=t,this.valueNode=e,this.isViewportDepthNode=!0}generate(t){const{scope:e}=this;return e===GI.DEPTH_BASE?t.getFragDepth():super.generate(t)}setup({camera:t}){const{scope:e}=this,n=this.valueNode;let i=null;if(e===GI.DEPTH_BASE)null!==n&&(i=WI().assign(n));else if(e===GI.DEPTH)i=t.isPerspectiveCamera?HI(EP.z,cP,AP):VI(EP.z,cP,AP);else if(e===GI.LINEAR_DEPTH)if(null!==n)if(t.isPerspectiveCamera){const t=jI(n,cP,AP);i=VI(t,cP,AP)}else i=n;else i=VI(EP.z,cP,AP);return i}}GI.DEPTH_BASE="depthBase",GI.DEPTH="depth",GI.LINEAR_DEPTH="linearDepth";const VI=(t,e,n)=>t.add(e).div(e.sub(n)),HI=(t,e,n)=>e.add(t).mul(n).div(n.sub(e).mul(t)),jI=(t,e,n)=>e.mul(n).div(n.sub(e).mul(t).sub(n)),WI=FE(GI,GI.DEPTH_BASE),XI=kE(GI,GI.DEPTH);GI.LINEAR_DEPTH;qI(),XI.assign=t=>WI(t);class YI extends $T{static get type(){return"ClippingNode"}constructor(t=YI.DEFAULT){super(),this.scope=t}setup(t){super.setup(t);const e=t.clippingContext,{localClipIntersection:n,localClippingCount:i,globalClippingCount:r}=e,s=r+i,a=n?s-i:s;return this.scope===YI.ALPHA_TO_COVERAGE?this.setupAlphaToCoverage(e.planes,s,a):this.setupDefault(e.planes,s,a)}setupAlphaToCoverage(t,e,n){return zE((()=>{const i=KP(t),r=vC("float","distanceToPlane"),s=vC("float","distanceToGradient"),a=vC("float","clipOpacity");let o;if(a.assign(1),pI(n,(({i:t})=>{o=i.element(t),r.assign(EP.dot(o.xyz).negate().add(o.w)),s.assign(r.fwidth().div(2)),a.mulAssign(yN(s.negate(),s,r)),a.equal(0).discard()})),n<e){const t=vC("float","unionclipOpacity");t.assign(1),pI({start:n,end:e},(({i:e})=>{o=i.element(e),r.assign(EP.dot(o.xyz).negate().add(o.w)),s.assign(r.fwidth().div(2)),t.mulAssign(yN(s.negate(),s,r).oneMinus())})),a.mulAssign(t.oneMinus())}xC.a.mulAssign(a),xC.a.equal(0).discard()}))()}setupDefault(t,e,n){return zE((()=>{const i=KP(t);let r;if(pI(n,(({i:t})=>{r=i.element(t),EP.dot(r.xyz).greaterThan(r.w).discard()})),n<e){const t=vC("bool","clipped");t.assign(!0),pI({start:n,end:e},(({i:e})=>{r=i.element(e),t.assign(EP.dot(r.xyz).greaterThan(r.w).and(t))})),t.discard()}}))()}}YI.ALPHA_TO_COVERAGE="alphaToCoverage",YI.DEFAULT="default";class QI extends jM{static get type(){return"NodeMaterial"}constructor(){super(),this.isNodeMaterial=!0,this.type=this.constructor.type,this.forceSinglePass=!1,this.fog=!0,this.lights=!1,this.lightsNode=null,this.envNode=null,this.aoNode=null,this.colorNode=null,this.normalNode=null,this.opacityNode=null,this.backdropNode=null,this.backdropAlphaNode=null,this.alphaTestNode=null,this.positionNode=null,this.depthNode=null,this.shadowNode=null,this.shadowPositionNode=null,this.outputNode=null,this.mrtNode=null,this.fragmentNode=null,this.vertexNode=null}customProgramCacheKey(){return this.type+OT(this)}build(t){this.setup(t)}setupObserver(t){return new IT(t)}setup(t){let e;t.context.setupNormal=()=>this.setupNormal(t),t.addStack(),t.stack.outputNode=this.vertexNode||this.setupPosition(t),t.addFlow("vertex",t.removeStack()),t.addStack();const n=this.setupClipping(t);if(!0===this.depthWrite&&this.setupDepth(t),null===this.fragmentNode){this.setupDiffuseColor(t),this.setupVariants(t);const i=this.setupLighting(t);null!==n&&t.stack.add(n);const r=iC(i,xC.a).max(0);e=this.setupOutput(t,r),kC.assign(e),null!==this.outputNode&&(e=this.outputNode);if(null!==t.renderer.getRenderTarget()){const n=t.renderer.getMRT(),i=this.mrtNode;null!==n?(e=n,null!==i&&(e=n.merge(i))):null!==i&&(e=i)}}else{let n=this.fragmentNode;!0!==n.isOutputStructNode&&(n=iC(n)),e=this.setupOutput(t,n)}t.stack.outputNode=e,t.addFlow("fragment",t.removeStack()),t.monitor=this.setupObserver(t)}setupClipping(t){if(null===t.clippingContext)return null;const{globalClippingCount:e,localClippingCount:n}=t.clippingContext;let i=null;if(e||n){const e=t.renderer.samples;this.alphaToCoverage&&e>1?i=BE(new YI(YI.ALPHA_TO_COVERAGE)):t.stack.add(BE(new YI))}return i}setupDepth(t){const{renderer:e}=t;let n=this.depthNode;if(null===n){const t=e.getMRT();if(t&&t.has("depth"))n=t.get("depth");else if(!0===e.logarithmicDepthBuffer){n=nI().w.add(1).log2().mul(dP).mul(.5)}}null!==n&&XI.assign(n).append()}setupPosition(t){const{object:e}=t,n=e.geometry;var i;if(t.addStack(),(n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color)&&vI(e).append(),!0===e.isSkinnedMesh&&(i=e,BE(new AI(i,!0))).append(),this.displacementMap){const t=rD("displacementMap","texture"),e=rD("displacementScale","float"),n=rD("displacementBias","float");SP.addAssign(DP.normalize().mul(t.x.mul(e).add(n)))}e.isBatchedMesh&&hI(e).append(),e.instanceMatrix&&!0===e.instanceMatrix.isInstancedBufferAttribute&&lI(e).append(),null!==this.positionNode&&SP.assign(this.positionNode);const r=nI();return t.context.vertex=t.removeStack(),t.context.mvp=r,r}setupDiffuseColor({object:t,geometry:e}){let n=this.colorNode?iC(this.colorNode):xD;if(!0===this.vertexColors&&e.hasAttribute("color")&&(n=iC(n.xyz.mul(nP("color","vec3")),n.a)),t.instanceColor){n=_C("vec3","vInstanceColor").mul(n)}if(t.isBatchedMesh&&t._colorsTexture){n=_C("vec3","vBatchColor").mul(n)}xC.assign(n);const i=this.opacityNode?jE(this.opacityNode):MD;if(xC.a.assign(xC.a.mul(i)),null!==this.alphaTestNode||this.alphaTest>0){const t=null!==this.alphaTestNode?jE(this.alphaTestNode):_D;xC.a.lessThanEqual(t).discard()}!1===this.transparent&&1===this.blending&&!1===this.alphaToCoverage&&xC.a.assign(1)}setupVariants(){}setupOutgoingLight(){return!0===this.lights?JE(0):xC.rgb}setupNormal(){return this.normalNode?JE(this.normalNode):DD}setupEnvironment(){let t=null;return this.envNode?t=this.envNode:this.envMap&&(t=this.envMap.isCubeTexture?rD("envMap","cubeTexture"):rD("envMap","texture")),t}setupLightMap(t){let e=null;return t.material.lightMap&&(e=new CI(KD)),e}setupLights(t){const e=[],n=this.setupEnvironment(t);n&&n.isLightingNode&&e.push(n);const i=this.setupLightMap(t);if(i&&i.isLightingNode&&e.push(i),null!==this.aoNode||t.material.aoMap){const t=null!==this.aoNode?this.aoNode:JD;e.push(new wI(t))}let r=this.lightsNode||t.lightsNode;return e.length>0&&(r=SI([...r.getLights(),...e])),r}setupLightingModel(){}setupLighting(t){const{material:e}=t,{backdropNode:n,backdropAlphaNode:i,emissiveNode:r}=this,s=!0===this.lights||null!==this.lightsNode?this.setupLights(t):null;let a=this.setupOutgoingLight(t);if(s&&s.getScope().getLights().length>0){const e=this.setupLightingModel(t);a=EI(s,e,n,i)}else null!==n&&(a=JE(null!==i?fN(a,n,i):n));return(r&&!0===r.isNode||e.emissive&&!0===e.emissive.isColor)&&(bC.assign(JE(r||SD)),a=a.add(bC)),a}setupOutput(t,e){if(!0===this.fog){const n=t.fogNode;n&&(e=iC(n.mix(e.rgb,n.colorNode),e.a))}return e}setDefaultValues(t){for(const e in t){const n=t[e];void 0===this[e]&&(this[e]=n,n&&n.clone&&(this[e]=n.clone()))}const e=Object.getOwnPropertyDescriptors(t.constructor.prototype);for(const t in e)void 0===Object.getOwnPropertyDescriptor(this.constructor.prototype,t)&&void 0!==e[t].get&&Object.defineProperty(this.constructor.prototype,t,e[t])}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{},nodes:{}});const n=jM.prototype.toJSON.call(this,t),i=FT(this);n.inputNodes={};for(const{property:e,childNode:r}of i)n.inputNodes[e]=r.toJSON(t).uuid;function r(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}if(e){const e=r(t.textures),i=r(t.images),s=r(t.nodes);e.length>0&&(n.textures=e),i.length>0&&(n.images=i),s.length>0&&(n.nodes=s)}return n}copy(t){return this.lightsNode=t.lightsNode,this.envNode=t.envNode,this.colorNode=t.colorNode,this.normalNode=t.normalNode,this.opacityNode=t.opacityNode,this.backdropNode=t.backdropNode,this.backdropAlphaNode=t.backdropAlphaNode,this.alphaTestNode=t.alphaTestNode,this.positionNode=t.positionNode,this.depthNode=t.depthNode,this.shadowNode=t.shadowNode,this.shadowPositionNode=t.shadowPositionNode,this.outputNode=t.outputNode,this.mrtNode=t.mrtNode,this.fragmentNode=t.fragmentNode,this.vertexNode=t.vertexNode,super.copy(t)}}const $I=new Zw;class ZI extends QI{static get type(){return"LineBasicNodeMaterial"}constructor(t){super(),this.isLineBasicNodeMaterial=!0,this.lights=!1,this.setDefaultValues($I),this.setValues(t)}}const KI=new hT;class JI extends QI{static get type(){return"LineDashedNodeMaterial"}constructor(t){super(),this.isLineDashedNodeMaterial=!0,this.lights=!1,this.setDefaultValues(KI),this.offsetNode=null,this.dashScaleNode=null,this.dashSizeNode=null,this.gapSizeNode=null,this.setValues(t)}setupVariants(){const t=this.offsetNode,e=this.dashScaleNode?jE(this.dashScaleNode):YD,n=this.dashSizeNode?jE(this.dashSizeNode):QD,i=this.dashSizeNode?jE(this.dashGapNode):$D;zC.assign(n),qC.assign(i);const r=CN(nP("lineDistance").mul(e));(t?r.add(t):r).mod(zC.add(qC)).greaterThan(zC).discard()}}const tL=new oT;class eL extends QI{static get type(){return"MeshNormalNodeMaterial"}constructor(t){super(),this.lights=!1,this.isMeshNormalNodeMaterial=!0,this.setDefaultValues(tL),this.setValues(t)}setupDiffuseColor(){const t=this.opacityNode?jE(this.opacityNode):MD;xC.assign(iC(BE(UP).mul(.5).add(.5),t))}}class nL extends JT{static get type(){return"EquirectUVNode"}constructor(t=TP){super("vec2"),this.dirNode=t}setup(){const t=this.dirNode,e=t.z.atan2(t.x).mul(1/(2*Math.PI)).add(.5),n=t.y.clamp(-1,1).asin().mul(1/Math.PI).add(.5);return QE(e,n)}}const iL=FE(nL);class rL extends Uw{constructor(t=1,e={}){super(t,e),this.isCubeRenderTarget=!0}fromEquirectangularTexture(t,e){const n=e.minFilter,i=e.generateMipmaps;e.generateMipmaps=!0,this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const r=new ww(5,5,5),s=iL(TP),a=new QI;a.colorNode=uP(e,s,0),a.side=1,a.blending=0;const o=new Sw(r,a),l=new Ow;l.add(o),e.minFilter===Px&&(e.minFilter=Rx);const u=new Lw(1,10,this),h=t.getMRT();return t.setMRT(null),u.update(t,l),t.setMRT(h),e.minFilter=n,e.currentGenerateMipmaps=i,o.geometry.dispose(),o.material.dispose(),this}}const sL=new WeakMap;class aL extends JT{static get type(){return"CubeMapNode"}constructor(t){super("vec3"),this.envNode=t,this._cubeTexture=null,this._cubeTextureNode=XP();const e=new Bw;e.isRenderTargetTexture=!0,this._defaultTexture=e,this.updateBeforeType=HT}updateBefore(t){const{renderer:e,material:n}=t,i=this.envNode;if(i.isTextureNode||i.isMaterialReferenceNode){const t=i.isTextureNode?i.value:n[i.property];if(t&&t.isTexture){const n=t.mapping;if(n===xx||n===bx){if(sL.has(t)){const e=sL.get(t);lL(e,t.mapping),this._cubeTexture=e}else{const n=t.image;if(function(t){return null!=t&&t.height>0}(n)){const i=new rL(n.height);i.fromEquirectangularTexture(e,t),lL(i.texture,t.mapping),this._cubeTexture=i.texture,sL.set(t,i.texture),t.addEventListener("dispose",oL)}else this._cubeTexture=this._defaultTexture}this._cubeTextureNode.value=this._cubeTexture}else this._cubeTextureNode=this.envNode}}}setup(t){return this.updateBefore(t),this._cubeTextureNode}}function oL(t){const e=t.target;e.removeEventListener("dispose",oL);const n=sL.get(e);void 0!==n&&(sL.delete(e),n.dispose())}function lL(t,e){e===xx?t.mapping=vx:e===bx&&(t.mapping=_x)}const uL=FE(aL);class hL extends MI{static get type(){return"BasicEnvironmentNode"}constructor(t=null){super(),this.envNode=t}setup(t){t.context.environment=uL(this.envNode)}}class cL extends MI{static get type(){return"BasicLightMapNode"}constructor(t=null){super(),this.lightMapNode=t}setup(t){const e=jE(1/Math.PI);t.context.irradianceLightMap=this.lightMapNode.mul(e)}}class AL{start(){}finish(){}direct(){}directRectArea(){}indirect(){}ambientOcclusion(){}}class dL extends AL{constructor(){super()}indirect(t,e,n){const i=t.ambientOcclusion,r=t.reflectedLight,s=n.context.irradianceLightMap;r.indirectDiffuse.assign(iC(0)),s?r.indirectDiffuse.addAssign(s):r.indirectDiffuse.addAssign(iC(1,1,1,0)),r.indirectDiffuse.mulAssign(i),r.indirectDiffuse.mulAssign(xC.rgb)}finish(t,e,n){const i=n.material,r=t.outgoingLight,s=n.context.environment;if(s)switch(i.combine){case 0:r.rgb.assign(fN(r.rgb,r.rgb.mul(s.rgb),CD.mul(RD)));break;case 1:r.rgb.assign(fN(r.rgb,s.rgb,CD.mul(RD)));break;case 2:r.rgb.addAssign(s.rgb.mul(CD.mul(RD)));break;default:console.warn("THREE.BasicLightingModel: Unsupported .combine value:",i.combine)}}}const pL=new WM;class fL extends QI{static get type(){return"MeshBasicNodeMaterial"}constructor(t){super(),this.isMeshBasicNodeMaterial=!0,this.lights=!0,this.setDefaultValues(pL),this.setValues(t)}setupNormal(){return LP}setupEnvironment(t){const e=super.setupEnvironment(t);return e?new hL(e):null}setupLightMap(t){let e=null;return t.material.lightMap&&(e=new cL(KD)),e}setupOutgoingLight(){return xC.rgb}setupLightingModel(){return new dL}}const mL=zE((({f0:t,f90:e,dotVH:n})=>{const i=n.mul(-5.55473).sub(6.98316).mul(n).exp2();return t.mul(i.oneMinus()).add(e.mul(i))})),gL=zE((t=>t.diffuseColor.mul(1/Math.PI))),yL=zE((({dotNH:t})=>FC.mul(jE(.5)).add(1).mul(jE(1/Math.PI)).mul(t.pow(FC)))),vL=zE((({lightDirection:t})=>{const e=t.add(CP).normalize(),n=UP.dot(e).clamp(),i=CP.dot(e).clamp(),r=mL({f0:UC,f90:1,dotVH:i}),s=jE(.25),a=yL({dotNH:n});return r.mul(s).mul(a)}));class _L extends dL{constructor(t=!0){super(),this.specular=t}direct({lightDirection:t,lightColor:e,reflectedLight:n}){const i=UP.dot(t).clamp().mul(e);n.directDiffuse.addAssign(i.mul(gL({diffuseColor:xC.rgb}))),!0===this.specular&&n.directSpecular.addAssign(i.mul(vL({lightDirection:t})).mul(CD))}indirect({ambientOcclusion:t,irradiance:e,reflectedLight:n}){n.indirectDiffuse.addAssign(e.mul(gL({diffuseColor:xC}))),n.indirectDiffuse.mulAssign(t)}}const xL=new lT;class bL extends QI{static get type(){return"MeshLambertNodeMaterial"}constructor(t){super(),this.isMeshLambertNodeMaterial=!0,this.lights=!0,this.setDefaultValues(xL),this.setValues(t)}setupEnvironment(t){const e=super.setupEnvironment(t);return e?new hL(e):null}setupLightingModel(){return new _L(!1)}}const SL=new sT;class ML extends QI{static get type(){return"MeshPhongNodeMaterial"}constructor(t){super(),this.isMeshPhongNodeMaterial=!0,this.lights=!0,this.shininessNode=null,this.specularNode=null,this.setDefaultValues(SL),this.setValues(t)}setupEnvironment(t){const e=super.setupEnvironment(t);return e?new hL(e):null}setupLightingModel(){return new _L}setupVariants(){const t=(this.shininessNode?jE(this.shininessNode):bD).max(1e-4);FC.assign(t);const e=this.specularNode||wD;UC.assign(e)}copy(t){return this.shininessNode=t.shininessNode,this.specularNode=t.specularNode,super.copy(t)}}const wL=zE((()=>{const t=LP.dFdx().abs().max(LP.dFdy().abs());return t.x.max(t.y).max(t.z)})),TL=zE((t=>{const{roughness:e}=t,n=wL();let i=e.max(.0525);return i=i.add(n),i=i.min(1),i})),EL=zE((({alpha:t,dotNL:e,dotNV:n})=>{const i=t.pow2(),r=e.mul(i.add(i.oneMinus().mul(n.pow2())).sqrt()),s=n.mul(i.add(i.oneMinus().mul(e.pow2())).sqrt());return tR(.5,r.add(s).max(vR))})).setLayout({name:"V_GGX_SmithCorrelated",type:"float",inputs:[{name:"alpha",type:"float"},{name:"dotNL",type:"float"},{name:"dotNV",type:"float"}]}),CL=zE((({alphaT:t,alphaB:e,dotTV:n,dotBV:i,dotTL:r,dotBL:s,dotNV:a,dotNL:o})=>{const l=o.mul(JE(t.mul(n),e.mul(i),a).length()),u=a.mul(JE(t.mul(r),e.mul(s),o).length());return tR(.5,l.add(u)).saturate()})).setLayout({name:"V_GGX_SmithCorrelated_Anisotropic",type:"float",inputs:[{name:"alphaT",type:"float",qualifier:"in"},{name:"alphaB",type:"float",qualifier:"in"},{name:"dotTV",type:"float",qualifier:"in"},{name:"dotBV",type:"float",qualifier:"in"},{name:"dotTL",type:"float",qualifier:"in"},{name:"dotBL",type:"float",qualifier:"in"},{name:"dotNV",type:"float",qualifier:"in"},{name:"dotNL",type:"float",qualifier:"in"}]}),RL=zE((({alpha:t,dotNH:e})=>{const n=t.pow2(),i=e.pow2().mul(n.oneMinus()).oneMinus();return n.div(i.pow2()).mul(1/Math.PI)})).setLayout({name:"D_GGX",type:"float",inputs:[{name:"alpha",type:"float"},{name:"dotNH",type:"float"}]}),NL=jE(1/Math.PI),PL=zE((({alphaT:t,alphaB:e,dotNH:n,dotTH:i,dotBH:r})=>{const s=t.mul(e),a=JE(e.mul(i),t.mul(r),s.mul(n)),o=a.dot(a),l=s.div(o);return NL.mul(s.mul(l.pow2()))})).setLayout({name:"D_GGX_Anisotropic",type:"float",inputs:[{name:"alphaT",type:"float",qualifier:"in"},{name:"alphaB",type:"float",qualifier:"in"},{name:"dotNH",type:"float",qualifier:"in"},{name:"dotTH",type:"float",qualifier:"in"},{name:"dotBH",type:"float",qualifier:"in"}]}),DL=zE((t=>{const{lightDirection:e,f0:n,f90:i,roughness:r,f:s,USE_IRIDESCENCE:a,USE_ANISOTROPY:o}=t,l=t.normalView||UP,u=r.pow2(),h=e.add(CP).normalize(),c=l.dot(e).clamp(),A=l.dot(CP).clamp(),d=l.dot(h).clamp(),p=CP.dot(h).clamp();let f,m,g=mL({f0:n,f90:i,dotVH:p});if(IE(a)&&(g=RC.mix(g,s)),IE(o)){const t=LC.dot(e),n=LC.dot(CP),i=LC.dot(h),r=BC.dot(e),s=BC.dot(CP),a=BC.dot(h);f=CL({alphaT:DC,alphaB:u,dotTV:n,dotBV:s,dotTL:t,dotBL:r,dotNV:A,dotNL:c}),m=PL({alphaT:DC,alphaB:u,dotNH:d,dotTH:i,dotBH:a})}else f=EL({alpha:u,dotNL:c,dotNV:A}),m=RL({alpha:u,dotNH:d});return g.mul(f).mul(m)})),IL=zE((({roughness:t,dotNV:e})=>{const n=iC(-1,-.0275,-.572,.022),i=iC(1,.0425,1.04,-.04),r=t.mul(n).add(i),s=r.x.mul(r.x).min(e.mul(-9.28).exp2()).mul(r.x).add(r.y);return QE(-1.04,1.04).mul(s).add(r.zw)})).setLayout({name:"DFGApprox",type:"vec2",inputs:[{name:"roughness",type:"float"},{name:"dotNV",type:"vec3"}]}),LL=zE((t=>{const{dotNV:e,specularColor:n,specularF90:i,roughness:r}=t,s=IL({dotNV:e,roughness:r});return n.mul(s.x).add(i.mul(s.y))})),BL=zE((({f:t,f90:e,dotVH:n})=>{const i=n.oneMinus().saturate(),r=i.mul(i),s=i.mul(r,r).clamp(0,.9999);return t.sub(JE(e).mul(s)).div(s.oneMinus())})).setLayout({name:"Schlick_to_F0",type:"vec3",inputs:[{name:"f",type:"vec3"},{name:"f90",type:"float"},{name:"dotVH",type:"float"}]}),UL=zE((({roughness:t,dotNH:e})=>{const n=t.pow2(),i=jE(1).div(n),r=e.pow2().oneMinus().max(.0078125);return jE(2).add(i).mul(r.pow(i.mul(.5))).div(2*Math.PI)})).setLayout({name:"D_Charlie",type:"float",inputs:[{name:"roughness",type:"float"},{name:"dotNH",type:"float"}]}),OL=zE((({dotNV:t,dotNL:e})=>jE(1).div(jE(4).mul(e.add(t).sub(e.mul(t)))))).setLayout({name:"V_Neubelt",type:"float",inputs:[{name:"dotNV",type:"float"},{name:"dotNL",type:"float"}]}),FL=zE((({lightDirection:t})=>{const e=t.add(CP).normalize(),n=UP.dot(t).clamp(),i=UP.dot(CP).clamp(),r=UP.dot(e).clamp(),s=UL({roughness:CC,dotNH:r}),a=OL({dotNV:i,dotNL:n});return EC.mul(s).mul(a)})),kL=zE((({N:t,V:e,roughness:n})=>{const i=t.dot(e).saturate(),r=QE(n,i.oneMinus().sqrt());return r.assign(r.mul(.984375).add(.0078125)),r})).setLayout({name:"LTC_Uv",type:"vec2",inputs:[{name:"N",type:"vec3"},{name:"V",type:"vec3"},{name:"roughness",type:"float"}]}),zL=zE((({f:t})=>{const e=t.length();return nN(e.mul(e).add(t.z).div(e.add(1)),0)})).setLayout({name:"LTC_ClippedSphereFormFactor",type:"float",inputs:[{name:"f",type:"vec3"}]}),qL=zE((({v1:t,v2:e})=>{const n=t.dot(e),i=n.abs().toVar(),r=i.mul(.0145206).add(.4965155).mul(i).add(.8543985).toVar(),s=i.add(4.1616724).mul(i).add(3.417594).toVar(),a=r.div(s),o=n.greaterThan(0).select(a,nN(n.mul(n).oneMinus(),1e-7).inverseSqrt().mul(.5).sub(a));return t.cross(e).mul(o)})).setLayout({name:"LTC_EdgeVectorFormFactor",type:"vec3",inputs:[{name:"v1",type:"vec3"},{name:"v2",type:"vec3"}]}),GL=zE((({N:t,V:e,P:n,mInv:i,p0:r,p1:s,p2:a,p3:o})=>{const l=s.sub(r).toVar(),u=o.sub(r).toVar(),h=l.cross(u),c=JE().toVar();return VE(h.dot(n.sub(r)).greaterThanEqual(0),(()=>{const l=e.sub(t.mul(e.dot(t))).normalize(),u=t.cross(l).negate(),h=i.mul(lC(l,u,t).transpose()).toVar(),A=h.mul(r.sub(n)).normalize().toVar(),d=h.mul(s.sub(n)).normalize().toVar(),p=h.mul(a.sub(n)).normalize().toVar(),f=h.mul(o.sub(n)).normalize().toVar(),m=JE(0).toVar();m.addAssign(qL({v1:A,v2:d})),m.addAssign(qL({v1:d,v2:p})),m.addAssign(qL({v1:p,v2:f})),m.addAssign(qL({v1:f,v2:A})),c.assign(JE(zL({f:m})))})),c})).setLayout({name:"LTC_Evaluate",type:"vec3",inputs:[{name:"N",type:"vec3"},{name:"V",type:"vec3"},{name:"P",type:"vec3"},{name:"mInv",type:"mat3"},{name:"p0",type:"vec3"},{name:"p1",type:"vec3"},{name:"p2",type:"vec3"},{name:"p3",type:"vec3"}]}),VL=1/6,HL=t=>JC(VL,JC(t,JC(t,t.negate().add(3)).sub(3)).add(1)),jL=t=>JC(VL,JC(t,JC(t,JC(3,t).sub(6))).add(4)),WL=t=>JC(VL,JC(t,JC(t,JC(-3,t).add(3)).add(3)).add(1)),XL=t=>JC(VL,hN(t,3)),YL=t=>HL(t).add(jL(t)),QL=t=>WL(t).add(XL(t)),$L=t=>ZC(-1,jL(t).div(HL(t).add(jL(t)))),ZL=t=>ZC(1,XL(t).div(WL(t).add(XL(t)))),KL=(t,e,n)=>{const i=t.uvNode,r=JC(i,e.zw).add(.5),s=DR(r),a=BR(r),o=YL(a.x),l=QL(a.x),u=$L(a.x),h=ZL(a.x),c=$L(a.y),A=ZL(a.y),d=QE(s.x.add(u),s.y.add(c)).sub(.5).mul(e.xy),p=QE(s.x.add(h),s.y.add(c)).sub(.5).mul(e.xy),f=QE(s.x.add(u),s.y.add(A)).sub(.5).mul(e.xy),m=QE(s.x.add(h),s.y.add(A)).sub(.5).mul(e.xy),g=YL(a.y).mul(ZC(o.mul(t.uv(d).level(n)),l.mul(t.uv(p).level(n)))),y=QL(a.y).mul(ZC(o.mul(t.uv(f).level(n)),l.mul(t.uv(m).level(n))));return g.add(y)},JL=zE((([t,e=jE(3)])=>{const n=QE(t.size(WE(e))),i=QE(t.size(WE(e.add(1)))),r=tR(1,n),s=tR(1,i),a=KL(t,iC(r,n),DR(e)),o=KL(t,iC(s,i),IR(e));return BR(e).mix(a,o)})),tB=zE((([t,e,n,i,r])=>{const s=JE(gN(e.negate(),LR(t),tR(1,i))),a=JE(HR(r[0].xyz),HR(r[1].xyz),HR(r[2].xyz));return LR(s).mul(n.mul(a))})).setLayout({name:"getVolumeTransmissionRay",type:"vec3",inputs:[{name:"n",type:"vec3"},{name:"v",type:"vec3"},{name:"thickness",type:"float"},{name:"ior",type:"float"},{name:"modelMatrix",type:"mat4"}]}),eB=zE((([t,e])=>t.mul(mN(e.mul(2).sub(2),0,1)))).setLayout({name:"applyIorToRoughness",type:"float",inputs:[{name:"roughness",type:"float"},{name:"ior",type:"float"}]}),nB=FI(),iB=zE((([t,e,n])=>{const i=nB.uv(t),r=RR(jE(II.x)).mul(eB(e,n));return JL(i,r)})),rB=zE((([t,e,n])=>(VE(n.notEqual(0),(()=>{const i=CR(e).negate().div(n);return TR(i.negate().mul(t))})),JE(1)))).setLayout({name:"volumeAttenuation",type:"vec3",inputs:[{name:"transmissionDistance",type:"float"},{name:"attenuationColor",type:"vec3"},{name:"attenuationDistance",type:"float"}]}),sB=zE((([t,e,n,i,r,s,a,o,l,u,h,c,A,d,p])=>{let f,m;if(p){f=iC().toVar(),m=JE().toVar();const r=h.sub(1).mul(p.mul(.025)),s=JE(h.sub(r),h,h.add(r));pI({start:0,end:3},(({i:r})=>{const h=s.element(r),p=tB(t,e,c,h,o),g=a.add(p),y=u.mul(l.mul(iC(g,1))),v=QE(y.xy.div(y.w)).toVar();v.addAssign(1),v.divAssign(2),v.assign(QE(v.x,v.y.oneMinus()));const _=iB(v,n,h);f.element(r).assign(_.element(r)),f.a.addAssign(_.a),m.element(r).assign(i.element(r).mul(rB(HR(p),A,d).element(r)))})),f.a.divAssign(3)}else{const r=tB(t,e,c,h,o),s=a.add(r),p=u.mul(l.mul(iC(s,1))),g=QE(p.xy.div(p.w)).toVar();g.addAssign(1),g.divAssign(2),g.assign(QE(g.x,g.y.oneMinus())),f=iB(g,n,h),m=i.mul(rB(HR(r),A,d))}const g=m.rgb.mul(f.rgb),y=t.dot(e).clamp(),v=JE(LL({dotNV:y,specularColor:r,specularF90:s,roughness:n})),_=m.r.add(m.g,m.b).div(3);return iC(v.oneMinus().mul(g),f.a.oneMinus().mul(_).oneMinus())})),aB=lC(3.2404542,-.969266,.0556434,-1.5371385,1.8760108,-.2040259,-.4985314,.041556,1.0572252),oB=(t,e)=>t.sub(e).div(t.add(e)).pow2(),lB=(t,e)=>{const n=t.mul(2*Math.PI*1e-9),i=JE(54856e-17,44201e-17,52481e-17),r=JE(1681e3,1795300,2208400),s=JE(43278e5,93046e5,66121e5),a=jE(9747e-17*Math.sqrt(2*Math.PI*45282e5)).mul(n.mul(2239900).add(e.x).cos()).mul(n.pow2().mul(-45282e5).exp());let o=i.mul(s.mul(2*Math.PI).sqrt()).mul(r.mul(n).add(e).cos()).mul(n.pow2().negate().mul(s).exp());o=JE(o.x.add(a),o.y,o.z).div(1.0685e-7);return aB.mul(o)},uB=zE((({outsideIOR:t,eta2:e,cosTheta1:n,thinFilmThickness:i,baseF0:r})=>{const s=fN(t,e,yN(0,.03,i)),a=t.div(s).pow2().mul(jE(1).sub(n.pow2())),o=jE(1).sub(a).sqrt(),l=oB(s,t),u=mL({f0:l,f90:1,dotVH:n}),h=u.oneMinus(),c=s.lessThan(t).select(Math.PI,0),A=jE(Math.PI).sub(c),d=(t=>{const e=t.sqrt();return JE(1).add(e).div(JE(1).sub(e))})(r.clamp(0,.9999)),p=oB(d,s.toVec3()),f=mL({f0:p,f90:1,dotVH:o}),m=JE(d.x.lessThan(s).select(Math.PI,0),d.y.lessThan(s).select(Math.PI,0),d.z.lessThan(s).select(Math.PI,0)),g=s.mul(i,o,2),y=JE(A).add(m),v=u.mul(f).clamp(1e-5,.9999),_=v.sqrt(),x=h.pow2().mul(f).div(JE(1).sub(v));let b=u.add(x),S=x.sub(h);for(let t=1;t<=2;++t){S=S.mul(_);const e=lB(jE(t).mul(g),jE(t).mul(y)).mul(2);b=b.add(S.mul(e))}return b.max(JE(0))})).setLayout({name:"evalIridescence",type:"vec3",inputs:[{name:"outsideIOR",type:"float"},{name:"eta2",type:"float"},{name:"cosTheta1",type:"float"},{name:"thinFilmThickness",type:"float"},{name:"baseF0",type:"vec3"}]}),hB=zE((({normal:t,viewDir:e,roughness:n})=>{const i=t.dot(e).saturate(),r=n.pow2(),s=bN(n.lessThan(.25),jE(-339.2).mul(r).add(jE(161.4).mul(n)).sub(25.9),jE(-8.48).mul(r).add(jE(14.3).mul(n)).sub(9.95)),a=bN(n.lessThan(.25),jE(44).mul(r).sub(jE(23.7).mul(n)).add(3.26),jE(1.97).mul(r).sub(jE(3.27).mul(n)).add(.72));return bN(n.lessThan(.25),0,jE(.1).mul(n).sub(.025)).add(s.mul(i).add(a).exp()).mul(1/Math.PI).saturate()})),cB=JE(.04),AB=jE(1);class dB extends AL{constructor(t=!1,e=!1,n=!1,i=!1,r=!1,s=!1){super(),this.clearcoat=t,this.sheen=e,this.iridescence=n,this.anisotropy=i,this.transmission=r,this.dispersion=s,this.clearcoatRadiance=null,this.clearcoatSpecularDirect=null,this.clearcoatSpecularIndirect=null,this.sheenSpecularDirect=null,this.sheenSpecularIndirect=null,this.iridescenceFresnel=null,this.iridescenceF0=null}start(t){if(!0===this.clearcoat&&(this.clearcoatRadiance=JE().toVar("clearcoatRadiance"),this.clearcoatSpecularDirect=JE().toVar("clearcoatSpecularDirect"),this.clearcoatSpecularIndirect=JE().toVar("clearcoatSpecularIndirect")),!0===this.sheen&&(this.sheenSpecularDirect=JE().toVar("sheenSpecularDirect"),this.sheenSpecularIndirect=JE().toVar("sheenSpecularIndirect")),!0===this.iridescence){const t=UP.dot(CP).clamp();this.iridescenceFresnel=uB({outsideIOR:jE(1),eta2:NC,cosTheta1:t,thinFilmThickness:PC,baseF0:UC}),this.iridescenceF0=BL({f:this.iridescenceFresnel,f90:1,dotVH:t})}if(!0===this.transmission){const e=wP,n=mP.sub(wP).normalize(),i=OP;t.backdrop=sB(i,n,SC,xC,UC,OC,e,vP,fP,pP,GC,HC,WC,jC,this.dispersion?XC:null),t.backdropAlpha=VC,xC.a.mulAssign(fN(1,t.backdrop.a,VC))}}computeMultiscattering(t,e,n){const i=UP.dot(CP).clamp(),r=IL({roughness:SC,dotNV:i}),s=(this.iridescenceF0?RC.mix(UC,this.iridescenceF0):UC).mul(r.x).add(n.mul(r.y)),a=r.x.add(r.y).oneMinus(),o=UC.add(UC.oneMinus().mul(.047619)),l=s.mul(o).div(a.mul(o).oneMinus());t.addAssign(s),e.addAssign(l.mul(a))}direct({lightDirection:t,lightColor:e,reflectedLight:n}){const i=UP.dot(t).clamp().mul(e);if(!0===this.sheen&&this.sheenSpecularDirect.addAssign(i.mul(FL({lightDirection:t}))),!0===this.clearcoat){const n=FP.dot(t).clamp().mul(e);this.clearcoatSpecularDirect.addAssign(n.mul(DL({lightDirection:t,f0:cB,f90:AB,roughness:TC,normalView:FP})))}n.directDiffuse.addAssign(i.mul(gL({diffuseColor:xC.rgb}))),n.directSpecular.addAssign(i.mul(DL({lightDirection:t,f0:UC,f90:1,roughness:SC,iridescence:this.iridescence,f:this.iridescenceFresnel,USE_IRIDESCENCE:this.iridescence,USE_ANISOTROPY:this.anisotropy})))}directRectArea({lightColor:t,lightPosition:e,halfWidth:n,halfHeight:i,reflectedLight:r,ltc_1:s,ltc_2:a}){const o=e.add(n).sub(i),l=e.sub(n).sub(i),u=e.sub(n).add(i),h=e.add(n).add(i),c=UP,A=CP,d=EP.toVar(),p=kL({N:c,V:A,roughness:SC}),f=s.uv(p).toVar(),m=a.uv(p).toVar(),g=lC(JE(f.x,0,f.y),JE(0,1,0),JE(f.z,0,f.w)).toVar(),y=UC.mul(m.x).add(UC.oneMinus().mul(m.y)).toVar();r.directSpecular.addAssign(t.mul(y).mul(GL({N:c,V:A,P:d,mInv:g,p0:o,p1:l,p2:u,p3:h}))),r.directDiffuse.addAssign(t.mul(xC).mul(GL({N:c,V:A,P:d,mInv:lC(1,0,0,0,1,0,0,0,1),p0:o,p1:l,p2:u,p3:h})))}indirect(t,e,n){this.indirectDiffuse(t,e,n),this.indirectSpecular(t,e,n),this.ambientOcclusion(t,e,n)}indirectDiffuse({irradiance:t,reflectedLight:e}){e.indirectDiffuse.addAssign(t.mul(gL({diffuseColor:xC})))}indirectSpecular({radiance:t,iblIrradiance:e,reflectedLight:n}){if(!0===this.sheen&&this.sheenSpecularIndirect.addAssign(e.mul(EC,hB({normal:UP,viewDir:CP,roughness:CC}))),!0===this.clearcoat){const t=FP.dot(CP).clamp(),e=LL({dotNV:t,specularColor:cB,specularF90:AB,roughness:TC});this.clearcoatSpecularIndirect.addAssign(this.clearcoatRadiance.mul(e))}const i=JE().toVar("singleScattering"),r=JE().toVar("multiScattering"),s=e.mul(1/Math.PI);this.computeMultiscattering(i,r,OC);const a=i.add(r),o=xC.mul(a.r.max(a.g).max(a.b).oneMinus());n.indirectSpecular.addAssign(t.mul(i)),n.indirectSpecular.addAssign(r.mul(s)),n.indirectDiffuse.addAssign(o.mul(s))}ambientOcclusion({ambientOcclusion:t,reflectedLight:e}){const n=UP.dot(CP).clamp().add(t),i=SC.mul(-16).oneMinus().negate().exp2(),r=t.sub(n.pow(i).oneMinus()).clamp();!0===this.clearcoat&&this.clearcoatSpecularIndirect.mulAssign(t),!0===this.sheen&&this.sheenSpecularIndirect.mulAssign(t),e.indirectDiffuse.mulAssign(t),e.indirectSpecular.mulAssign(r)}finish(t){const{outgoingLight:e}=t;if(!0===this.clearcoat){const t=FP.dot(CP).clamp(),n=mL({dotVH:t,f0:cB,f90:AB}),i=e.mul(wC.mul(n).oneMinus()).add(this.clearcoatSpecularDirect.add(this.clearcoatSpecularIndirect).mul(wC));e.assign(i)}if(!0===this.sheen){const t=EC.r.max(EC.g).max(EC.b).mul(.157).oneMinus(),n=e.mul(t).add(this.sheenSpecularDirect,this.sheenSpecularIndirect);e.assign(n)}}}const pB=jE(1),fB=jE(-2),mB=jE(.8),gB=jE(-1),yB=jE(.4),vB=jE(2),_B=jE(.305),xB=jE(3),bB=jE(.21),SB=jE(4),MB=jE(4),wB=jE(16),TB=zE((([t])=>{const e=JE(GR(t)).toVar(),n=jE(-1).toVar();return VE(e.x.greaterThan(e.z),(()=>{VE(e.x.greaterThan(e.y),(()=>{n.assign(bN(t.x.greaterThan(0),0,3))})).Else((()=>{n.assign(bN(t.y.greaterThan(0),1,4))}))})).Else((()=>{VE(e.z.greaterThan(e.y),(()=>{n.assign(bN(t.z.greaterThan(0),2,5))})).Else((()=>{n.assign(bN(t.y.greaterThan(0),1,4))}))})),n})).setLayout({name:"getFace",type:"float",inputs:[{name:"direction",type:"vec3"}]}),EB=zE((([t,e])=>{const n=QE().toVar();return VE(e.equal(0),(()=>{n.assign(QE(t.z,t.y).div(GR(t.x)))})).ElseIf(e.equal(1),(()=>{n.assign(QE(t.x.negate(),t.z.negate()).div(GR(t.y)))})).ElseIf(e.equal(2),(()=>{n.assign(QE(t.x.negate(),t.y).div(GR(t.z)))})).ElseIf(e.equal(3),(()=>{n.assign(QE(t.z.negate(),t.y).div(GR(t.x)))})).ElseIf(e.equal(4),(()=>{n.assign(QE(t.x.negate(),t.z).div(GR(t.y)))})).Else((()=>{n.assign(QE(t.x,t.y).div(GR(t.z)))})),JC(.5,n.add(1))})).setLayout({name:"getUV",type:"vec2",inputs:[{name:"direction",type:"vec3"},{name:"face",type:"float"}]}),CB=zE((([t])=>{const e=jE(0).toVar();return VE(t.greaterThanEqual(mB),(()=>{e.assign(pB.sub(t).mul(gB.sub(fB)).div(pB.sub(mB)).add(fB))})).ElseIf(t.greaterThanEqual(yB),(()=>{e.assign(mB.sub(t).mul(vB.sub(gB)).div(mB.sub(yB)).add(gB))})).ElseIf(t.greaterThanEqual(_B),(()=>{e.assign(yB.sub(t).mul(xB.sub(vB)).div(yB.sub(_B)).add(vB))})).ElseIf(t.greaterThanEqual(bB),(()=>{e.assign(_B.sub(t).mul(SB.sub(xB)).div(_B.sub(bB)).add(xB))})).Else((()=>{e.assign(jE(-2).mul(RR(JC(1.16,t))))})),e})).setLayout({name:"roughnessToMip",type:"float",inputs:[{name:"roughness",type:"float"}]}),RB=zE((([t,e])=>{const n=t.toVar();n.assign(JC(2,n).sub(1));const i=JE(n,1).toVar();return VE(e.equal(0),(()=>{i.assign(i.zyx)})).ElseIf(e.equal(1),(()=>{i.assign(i.xzy),i.xz.mulAssign(-1)})).ElseIf(e.equal(2),(()=>{i.x.mulAssign(-1)})).ElseIf(e.equal(3),(()=>{i.assign(i.zyx),i.xz.mulAssign(-1)})).ElseIf(e.equal(4),(()=>{i.assign(i.xzy),i.xy.mulAssign(-1)})).ElseIf(e.equal(5),(()=>{i.z.mulAssign(-1)})),i})).setLayout({name:"getDirection",type:"vec3",inputs:[{name:"uv",type:"vec2"},{name:"face",type:"float"}]}),NB=zE((([t,e,n,i,r,s])=>{const a=jE(n),o=JE(e),l=mN(CB(a),fB,s),u=BR(l),h=DR(l),c=JE(PB(t,o,h,i,r,s)).toVar();return VE(u.notEqual(0),(()=>{const e=JE(PB(t,o,h.add(1),i,r,s)).toVar();c.assign(fN(c,e,u))})),c})),PB=zE((([t,e,n,i,r,s])=>{const a=jE(n).toVar(),o=JE(e),l=jE(TB(o)).toVar(),u=jE(nN(MB.sub(a),0)).toVar();a.assign(nN(a,MB));const h=jE(ER(a)).toVar(),c=QE(EB(o,l).mul(h.sub(2)).add(1)).toVar();return VE(l.greaterThan(2),(()=>{c.y.addAssign(h),l.subAssign(3)})),c.x.addAssign(l.mul(h)),c.x.addAssign(u.mul(JC(3,wB))),c.y.addAssign(JC(4,ER(s).sub(h))),c.x.mulAssign(i),c.y.mulAssign(r),t.uv(c).grad(QE(),QE())})),DB=zE((({envMap:t,mipInt:e,outputDirection:n,theta:i,axis:r,CUBEUV_TEXEL_WIDTH:s,CUBEUV_TEXEL_HEIGHT:a,CUBEUV_MAX_MIP:o})=>{const l=OR(i),u=n.mul(l).add(r.cross(n).mul(UR(i))).add(r.mul(r.dot(n).mul(l.oneMinus())));return PB(t,u,e,s,a,o)})),IB=zE((({n:t,latitudinal:e,poleAxis:n,outputDirection:i,weights:r,samples:s,dTheta:a,mipInt:o,envMap:l,CUBEUV_TEXEL_WIDTH:u,CUBEUV_TEXEL_HEIGHT:h,CUBEUV_MAX_MIP:c})=>{const A=JE(bN(e,n,uN(n,i))).toVar();VE(xR(A.equals(JE(0))),(()=>{A.assign(JE(i.z,0,i.x.negate()))})),A.assign(LR(A));const d=JE().toVar();return d.addAssign(r.element(WE(0)).mul(DB({theta:0,axis:A,outputDirection:i,mipInt:o,envMap:l,CUBEUV_TEXEL_WIDTH:u,CUBEUV_TEXEL_HEIGHT:h,CUBEUV_MAX_MIP:c}))),pI({start:WE(1),end:t},(({i:t})=>{VE(t.greaterThanEqual(s),(()=>{JN("break").append()}));const e=jE(a.mul(jE(t))).toVar();d.addAssign(r.element(t).mul(DB({theta:e.mul(-1),axis:A,outputDirection:i,mipInt:o,envMap:l,CUBEUV_TEXEL_WIDTH:u,CUBEUV_TEXEL_HEIGHT:h,CUBEUV_MAX_MIP:c}))),d.addAssign(r.element(t).mul(DB({theta:e,axis:A,outputDirection:i,mipInt:o,envMap:l,CUBEUV_TEXEL_WIDTH:u,CUBEUV_TEXEL_HEIGHT:h,CUBEUV_MAX_MIP:c})))})),iC(d,1)}));let LB=null;const BB=new WeakMap;function UB(t){let e=BB.get(t);if((void 0!==e?e.pmremVersion:-1)!==t.pmremVersion){const n=t.image;if(t.isCubeTexture){if(!function(t){if(null==t)return!1;let e=0;const n=6;for(let i=0;i<n;i++)void 0!==t[i]&&e++;return e===n}(n))return null;e=LB.fromCubemap(t,e)}else{if(!function(t){return null!=t&&t.height>0}(n))return null;e=LB.fromEquirectangular(t,e)}e.pmremVersion=t.pmremVersion,BB.set(t,e)}return e.texture}class OB extends JT{static get type(){return"PMREMNode"}constructor(t,e=null,n=null){super("vec3"),this._value=t,this._pmrem=null,this.uvNode=e,this.levelNode=n,this._generator=null;const i=new pS;i.isRenderTargetTexture=!0,this._texture=uP(i),this._width=gC(0),this._height=gC(0),this._maxMip=gC(0),this.updateBeforeType=HT}set value(t){this._value=t,this._pmrem=null}get value(){return this._value}updateFromTexture(t){const e=function(t){const e=Math.log2(t)-2,n=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,e),112)),texelHeight:n,maxMip:e}}(t.image.height);this._texture.value=t,this._width.value=e.texelWidth,this._height.value=e.texelHeight,this._maxMip.value=e.maxMip}updateBefore(){let t=this._pmrem;const e=t?t.pmremVersion:-1,n=this._value;e!==n.pmremVersion&&(t=!0===n.isPMREMTexture?n:UB(n),null!==t&&(this._pmrem=t,this.updateFromTexture(t)))}setup(t){null===LB&&(LB=t.createPMREMGenerator()),this.updateBefore(t);let e=this.uvNode;null===e&&t.context.getUV&&(e=t.context.getUV(this));const n=this.value;t.renderer.coordinateSystem===Ub&&!0!==n.isPMREMTexture&&!0===n.isRenderTargetTexture&&(e=JE(e.x.negate(),e.yz));let i=this.levelNode;return null===i&&t.context.getTextureLevel&&(i=t.context.getTextureLevel(this)),NB(this._texture,e,i,this._width,this._height,this._maxMip)}}const FB=FE(OB),kB=new WeakMap;class zB extends MI{static get type(){return"EnvironmentNode"}constructor(t=null){super(),this.envNode=t}setup(t){const{material:e}=t;let n=this.envNode;if(n.isTextureNode||n.isMaterialReferenceNode){const t=n.isTextureNode?n.value:e[n.property];let i=kB.get(t);void 0===i&&(i=FB(t),kB.set(t,i)),n=i}const i=e.envMap?eD("envMapIntensity","float",t.material):eD("environmentIntensity","float",t.scene),r=!0===e.useAnisotropy||e.anisotropy>0?hD:UP,s=n.context(qB(SC,r)).mul(i),a=n.context(GB(OP)).mul(Math.PI).mul(i),o=XN(s),l=XN(a);t.context.radiance.addAssign(o),t.context.iblIrradiance.addAssign(l);const u=t.context.lightingModel.clearcoatRadiance;if(u){const t=n.context(qB(TC,FP)).mul(i),e=XN(t);u.addAssign(e)}}}const qB=(t,e)=>{let n=null;return{getUV:()=>(null===n&&(n=CP.negate().reflect(e),n=t.mul(t).mix(n,e).normalize(),n=n.transformDirection(fP)),n),getTextureLevel:()=>t}},GB=t=>({getUV:()=>t,getTextureLevel:()=>jE(1)}),VB=new iT;class HB extends QI{static get type(){return"MeshStandardNodeMaterial"}constructor(t){super(),this.isMeshStandardNodeMaterial=!0,this.lights=!0,this.emissiveNode=null,this.metalnessNode=null,this.roughnessNode=null,this.setDefaultValues(VB),this.setValues(t)}setupEnvironment(t){let e=super.setupEnvironment(t);return null===e&&t.environmentNode&&(e=t.environmentNode),e?new zB(e):null}setupLightingModel(){return new dB}setupSpecular(){const t=fN(JE(.04),xC.rgb,MC);UC.assign(t),OC.assign(1)}setupVariants(){const t=this.metalnessNode?jE(this.metalnessNode):PD;MC.assign(t);let e=this.roughnessNode?jE(this.roughnessNode):ND;e=TL({roughness:e}),SC.assign(e),this.setupSpecular(),xC.assign(iC(xC.rgb.mul(t.oneMinus()),xC.a))}copy(t){return this.emissiveNode=t.emissiveNode,this.metalnessNode=t.metalnessNode,this.roughnessNode=t.roughnessNode,super.copy(t)}}const jB=new rT;class WB extends HB{static get type(){return"MeshPhysicalNodeMaterial"}constructor(t){super(),this.isMeshPhysicalNodeMaterial=!0,this.clearcoatNode=null,this.clearcoatRoughnessNode=null,this.clearcoatNormalNode=null,this.sheenNode=null,this.sheenRoughnessNode=null,this.iridescenceNode=null,this.iridescenceIORNode=null,this.iridescenceThicknessNode=null,this.specularIntensityNode=null,this.specularColorNode=null,this.iorNode=null,this.transmissionNode=null,this.thicknessNode=null,this.attenuationDistanceNode=null,this.attenuationColorNode=null,this.dispersionNode=null,this.anisotropyNode=null,this.setDefaultValues(jB),this.setValues(t)}get useClearcoat(){return this.clearcoat>0||null!==this.clearcoatNode}get useIridescence(){return this.iridescence>0||null!==this.iridescenceNode}get useSheen(){return this.sheen>0||null!==this.sheenNode}get useAnisotropy(){return this.anisotropy>0||null!==this.anisotropyNode}get useTransmission(){return this.transmission>0||null!==this.transmissionNode}get useDispersion(){return this.dispersion>0||null!==this.dispersionNode}setupSpecular(){const t=this.iorNode?jE(this.iorNode):jD;GC.assign(t),UC.assign(fN(eN(cN(GC.sub(1).div(GC.add(1))).mul(ED),JE(1)).mul(TD),xC.rgb,MC)),OC.assign(fN(TD,1,MC))}setupLightingModel(){return new dB(this.useClearcoat,this.useSheen,this.useIridescence,this.useAnisotropy,this.useTransmission,this.useDispersion)}setupVariants(t){if(super.setupVariants(t),this.useClearcoat){const t=this.clearcoatNode?jE(this.clearcoatNode):ID,e=this.clearcoatRoughnessNode?jE(this.clearcoatRoughnessNode):LD;wC.assign(t),TC.assign(TL({roughness:e}))}if(this.useSheen){const t=this.sheenNode?JE(this.sheenNode):OD,e=this.sheenRoughnessNode?jE(this.sheenRoughnessNode):FD;EC.assign(t),CC.assign(e)}if(this.useIridescence){const t=this.iridescenceNode?jE(this.iridescenceNode):zD,e=this.iridescenceIORNode?jE(this.iridescenceIORNode):qD,n=this.iridescenceThicknessNode?jE(this.iridescenceThicknessNode):GD;RC.assign(t),NC.assign(e),PC.assign(n)}if(this.useAnisotropy){const t=(this.anisotropyNode?QE(this.anisotropyNode):kD).toVar();IC.assign(t.length()),VE(IC.equal(0),(()=>{t.assign(QE(1,0))})).Else((()=>{t.divAssign(QE(IC)),IC.assign(IC.saturate())})),DC.assign(IC.pow2().mix(SC.pow2(),1)),LC.assign(uD[0].mul(t.x).add(uD[1].mul(t.y))),BC.assign(uD[1].mul(t.x).sub(uD[0].mul(t.y)))}if(this.useTransmission){const t=this.transmissionNode?jE(this.transmissionNode):VD,e=this.thicknessNode?jE(this.thicknessNode):HD,n=this.attenuationDistanceNode?jE(this.attenuationDistanceNode):WD,i=this.attenuationColorNode?JE(this.attenuationColorNode):XD;if(VC.assign(t),HC.assign(e),jC.assign(n),WC.assign(i),this.useDispersion){const t=this.dispersionNode?jE(this.dispersionNode):ZD;XC.assign(t)}}}setupClearcoatNormal(){return this.clearcoatNormalNode?JE(this.clearcoatNormalNode):BD}setup(t){t.context.setupClearcoatNormal=()=>this.setupClearcoatNormal(t),super.setup(t)}copy(t){return this.clearcoatNode=t.clearcoatNode,this.clearcoatRoughnessNode=t.clearcoatRoughnessNode,this.clearcoatNormalNode=t.clearcoatNormalNode,this.sheenNode=t.sheenNode,this.sheenRoughnessNode=t.sheenRoughnessNode,this.iridescenceNode=t.iridescenceNode,this.iridescenceIORNode=t.iridescenceIORNode,this.iridescenceThicknessNode=t.iridescenceThicknessNode,this.specularIntensityNode=t.specularIntensityNode,this.specularColorNode=t.specularColorNode,this.transmissionNode=t.transmissionNode,this.thicknessNode=t.thicknessNode,this.attenuationDistanceNode=t.attenuationDistanceNode,this.attenuationColorNode=t.attenuationColorNode,this.dispersionNode=t.dispersionNode,this.anisotropyNode=t.anisotropyNode,super.copy(t)}}const XB=zE((({normal:t,lightDirection:e,builder:n})=>{const i=t.dot(e),r=QE(i.mul(.5).add(.5),0);if(n.material.gradientMap){const t=rD("gradientMap","texture").context({getUV:()=>r});return JE(t.r)}{const t=r.fwidth().mul(.5);return fN(JE(.7),JE(1),yN(jE(.7).sub(t.x),jE(.7).add(t.x),r.x))}}));class YB extends AL{direct({lightDirection:t,lightColor:e,reflectedLight:n},i,r){const s=XB({normal:PP,lightDirection:t,builder:r}).mul(e);n.directDiffuse.addAssign(s.mul(gL({diffuseColor:xC.rgb})))}indirect({ambientOcclusion:t,irradiance:e,reflectedLight:n}){n.indirectDiffuse.addAssign(e.mul(gL({diffuseColor:xC}))),n.indirectDiffuse.mulAssign(t)}}const QB=new aT;class $B extends QI{static get type(){return"MeshToonNodeMaterial"}constructor(t){super(),this.isMeshToonNodeMaterial=!0,this.lights=!0,this.setDefaultValues(QB),this.setValues(t)}setupLightingModel(){return new YB}}class ZB extends JT{static get type(){return"MatcapUVNode"}constructor(){super("vec2")}setup(){const t=JE(CP.z,0,CP.x.negate()).normalize(),e=CP.cross(t);return QE(t.dot(UP),e.dot(UP)).mul(.495).add(.5)}}const KB=kE(ZB),JB=new uT;class tU extends QI{static get type(){return"MeshMatcapNodeMaterial"}constructor(t){super(),this.lights=!1,this.isMeshMatcapNodeMaterial=!0,this.setDefaultValues(JB),this.setValues(t)}setupVariants(t){const e=KB;let n;n=t.material.matcap?rD("matcap","texture").context({getUV:()=>e}):JE(fN(.2,.8,e.y)),xC.rgb.mulAssign(n.rgb)}}const eU=new Kw;class nU extends QI{static get type(){return"PointsNodeMaterial"}constructor(t){super(),this.isPointsNodeMaterial=!0,this.lights=!1,this.transparent=!0,this.sizeNode=null,this.setDefaultValues(eU),this.setValues(t)}copy(t){return this.sizeNode=t.sizeNode,super.copy(t)}}class iU extends JT{static get type(){return"RotateNode"}constructor(t,e){super(),this.positionNode=t,this.rotationNode=e}getNodeType(t){return this.positionNode.getNodeType(t)}setup(t){const{rotationNode:e,positionNode:n}=this;if("vec2"===this.getNodeType(t)){const t=e.cos(),i=e.sin();return oC(t,i,i.negate(),t).mul(n)}{const t=e,i=uC(iC(1,0,0,0),iC(0,OR(t.x),UR(t.x).negate(),0),iC(0,UR(t.x),OR(t.x),0),iC(0,0,0,1)),r=uC(iC(OR(t.y),0,UR(t.y),0),iC(0,1,0,0),iC(UR(t.y).negate(),0,OR(t.y),0),iC(0,0,0,1)),s=uC(iC(OR(t.z),UR(t.z).negate(),0,0),iC(UR(t.z),OR(t.z),0,0),iC(0,0,1,0),iC(0,0,0,1));return i.mul(r).mul(s).mul(iC(n,1)).xyz}}}const rU=FE(iU),sU=new qw;class aU extends QI{static get type(){return"SpriteNodeMaterial"}constructor(t){super(),this.isSpriteNodeMaterial=!0,this.lights=!1,this._useSizeAttenuation=!0,this.positionNode=null,this.rotationNode=null,this.scaleNode=null,this.setDefaultValues(sU),this.setValues(t)}setupPosition({object:t,camera:e,context:n}){const i=this.sizeAttenuation,{positionNode:r,rotationNode:s,scaleNode:a}=this,o=SP;let l=xP.mul(JE(r||0)),u=QE(vP[0].xyz.length(),vP[1].xyz.length());null!==a&&(u=u.mul(a)),!i&&e.isPerspectiveCamera&&(u=u.mul(l.z.negate()));let h=o.xy;if(t.center&&!0===t.center.isVector2){const t=((t,e,n)=>BE(new UN(t,e,n)))("center","vec2");h=h.sub(t.sub(.5))}h=h.mul(u);const c=jE(s||UD),A=rU(h,c);l=iC(l.xy.add(A),l.zw);const d=pP.mul(l);return n.vertex=o,d}copy(t){return this.positionNode=t.positionNode,this.rotationNode=t.rotationNode,this.scaleNode=t.scaleNode,super.copy(t)}get sizeAttenuation(){return this._useSizeAttenuation}set sizeAttenuation(t){this._useSizeAttenuation!==t&&(this._useSizeAttenuation=t,this.needsUpdate=!0)}}class oU extends AL{constructor(){super(),this.shadowNode=jE(1).toVar("shadowMask")}direct({shadowMask:t}){this.shadowNode.mulAssign(t)}finish(t){xC.a.mulAssign(this.shadowNode.oneMinus()),t.outgoingLight.rgb.assign(xC.rgb)}}const lU=new nT;class uU extends QI{static get type(){return"ShadowNodeMaterial"}constructor(t){super(),this.isShadowNodeMaterial=!0,this.lights=!0,this.setDefaultValues(lU),this.setValues(t)}setupLightingModel(){return new oU}}zE((({texture:t,uv:e})=>{const n=1e-4,i=JE().toVar();return VE(e.x.lessThan(n),(()=>{i.assign(JE(1,0,0))})).ElseIf(e.y.lessThan(n),(()=>{i.assign(JE(0,1,0))})).ElseIf(e.z.lessThan(n),(()=>{i.assign(JE(0,0,1))})).ElseIf(e.x.greaterThan(.9999),(()=>{i.assign(JE(-1,0,0))})).ElseIf(e.y.greaterThan(.9999),(()=>{i.assign(JE(0,-1,0))})).ElseIf(e.z.greaterThan(.9999),(()=>{i.assign(JE(0,0,-1))})).Else((()=>{const n=.01,r=t.uv(e.add(JE(-.01,0,0))).r.sub(t.uv(e.add(JE(n,0,0))).r),s=t.uv(e.add(JE(0,-.01,0))).r.sub(t.uv(e.add(JE(0,n,0))).r),a=t.uv(e.add(JE(0,0,-.01))).r.sub(t.uv(e.add(JE(0,0,n))).r);i.assign(JE(r,s,a))})),i.normalize()}));class hU{constructor(t,e){this.nodes=t,this.info=e,this.animationLoop=null,this.requestId=null,this._init()}_init(){const t=(e,n)=>{this.requestId=self.requestAnimationFrame(t),!0===this.info.autoReset&&this.info.reset(),this.nodes.nodeFrame.update(),this.info.frame=this.nodes.nodeFrame.frameId,null!==this.animationLoop&&this.animationLoop(e,n)};t()}dispose(){self.cancelAnimationFrame(this.requestId),this.requestId=null}setAnimationLoop(t){this.animationLoop=t}}class cU{constructor(){this.weakMap=new WeakMap}get(t){let e=this.weakMap;for(let n=0;n<t.length;n++)if(e=e.get(t[n]),void 0===e)return;return e.get(t[t.length-1])}set(t,e){let n=this.weakMap;for(let e=0;e<t.length;e++){const i=t[e];!1===n.has(i)&&n.set(i,new WeakMap),n=n.get(i)}return n.set(t[t.length-1],e)}delete(t){let e=this.weakMap;for(let n=0;n<t.length;n++)if(e=e.get(t[n]),void 0===e)return!1;return e.delete(t[t.length-1])}}const AU=new Xw;class dU{constructor(){this.version=0,this.globalClippingCount=0,this.localClippingCount=0,this.localClippingEnabled=!1,this.localClipIntersection=!1,this.planes=[],this.parentVersion=0,this.viewNormalMatrix=new Zb,this.cacheKey=0}projectPlanes(t,e){const n=t.length,i=this.planes;for(let r=0;r<n;r++){AU.copy(t[r]).applyMatrix4(this.viewMatrix,this.viewNormalMatrix);const n=i[e+r],s=AU.normal;n.x=-s.x,n.y=-s.y,n.z=-s.z,n.w=AU.constant}}updateGlobal(t,e){const n=t.clippingPlanes;this.viewMatrix=e.matrixWorldInverse,this.viewNormalMatrix.getNormalMatrix(this.viewMatrix);let i=!1;if(Array.isArray(n)&&0!==n.length){const t=n.length;if(t!==this.globalClippingCount){const e=[];for(let n=0;n<t;n++)e.push(new fS);this.globalClippingCount=t,this.planes=e,i=!0}this.projectPlanes(n,0)}else 0!==this.globalClippingCount&&(this.globalClippingCount=0,this.planes=[],i=!0);t.localClippingEnabled!==this.localClippingEnabled&&(this.localClippingEnabled=t.localClippingEnabled,i=!0),i&&(this.version++,this.cacheKey=UT(this.globalClippingCount,!0===this.localClippingEnabled?1:0))}update(t,e){let n=!1;if(this!==t&&t.version!==this.parentVersion&&(this.globalClippingCount=e.isShadowNodeMaterial?0:t.globalClippingCount,this.localClippingEnabled=t.localClippingEnabled,this.planes=Array.from(t.planes),this.parentVersion=t.version,this.viewMatrix=t.viewMatrix,this.viewNormalMatrix=t.viewNormalMatrix,n=!0),this.localClippingEnabled){const t=e.clippingPlanes;if(Array.isArray(t)&&0!==t.length){const e=t.length,i=this.planes,r=this.globalClippingCount;if(n||e!==this.localClippingCount){i.length=r+e;for(let t=0;t<e;t++)i[r+t]=new fS;this.localClippingCount=e,n=!0}this.projectPlanes(t,r)}else 0!==this.localClippingCount&&(this.localClippingCount=0,n=!0);this.localClipIntersection!==e.clipIntersection&&(this.localClipIntersection=e.clipIntersection,n=!0)}n&&(this.version+=t.version,this.cacheKey=UT(t.cacheKey,this.localClippingCount,!0===this.localClipIntersection?1:0))}}let pU=0;class fU{constructor(t,e,n,i,r,s,a,o,l){this._nodes=t,this._geometries=e,this.id=pU++,this.renderer=n,this.object=i,this.material=r,this.scene=s,this.camera=a,this.lightsNode=o,this.context=l,this.geometry=i.geometry,this.version=r.version,this.drawRange=null,this.attributes=null,this.pipeline=null,this.vertexBuffers=null,this.drawParams=null,this.bundle=null,this.updateClipping(l.clippingContext),this.clippingContextVersion=this.clippingContext.version,this.initialNodesCacheKey=this.getDynamicCacheKey(),this.initialCacheKey=this.getCacheKey(),this._nodeBuilderState=null,this._bindings=null,this._monitor=null,this.onDispose=null,this.isRenderObject=!0,this.onMaterialDispose=()=>{this.dispose()},this.material.addEventListener("dispose",this.onMaterialDispose)}updateClipping(t){const e=this.material;let n=this.clippingContext;Array.isArray(e.clippingPlanes)?(n!==t&&n||(n=new dU,this.clippingContext=n),n.update(t,e)):this.clippingContext!==t&&(this.clippingContext=t)}get clippingNeedsUpdate(){return this.clippingContext.version!==this.clippingContextVersion&&(this.clippingContextVersion=this.clippingContext.version,!0)}getNodeBuilderState(){return this._nodeBuilderState||(this._nodeBuilderState=this._nodes.getForRender(this))}getMonitor(){return this._monitor||(this._monitor=this.getNodeBuilderState().monitor)}getBindings(){return this._bindings||(this._bindings=this.getNodeBuilderState().createBindings())}getIndex(){return this._geometries.getIndex(this)}getChainArray(){return[this.object,this.material,this.context,this.lightsNode]}getAttributes(){if(null!==this.attributes)return this.attributes;const t=this.getNodeBuilderState().nodeAttributes,e=this.geometry,n=[],i=new Set;for(const r of t){const t=r.node&&r.node.attribute?r.node.attribute:e.getAttribute(r.name);if(void 0===t)continue;n.push(t);const s=t.isInterleavedBufferAttribute?t.data:t;i.add(s)}return this.attributes=n,this.vertexBuffers=Array.from(i.values()),n}getVertexBuffers(){return null===this.vertexBuffers&&this.getAttributes(),this.vertexBuffers}getDrawParameters(){const{object:t,material:e,geometry:n,group:i,drawRange:r}=this,s=this.drawParams||(this.drawParams={vertexCount:0,firstVertex:0,instanceCount:0,firstInstance:0}),a=this.getIndex(),o=null!==a,l=n.isInstancedBufferGeometry?n.instanceCount:t.count>1?t.count:1;if(0===l)return null;if(s.instanceCount=l,!0===t.isBatchedMesh)return s;let u=1;!0!==e.wireframe||t.isPoints||t.isLineSegments||t.isLine||t.isLineLoop||(u=2);let h=r.start*u,c=(r.start+r.count)*u;null!==i&&(h=Math.max(h,i.start*u),c=Math.min(c,(i.start+i.count)*u));const A=!0===o?a.count:n.attributes.position.count;h=Math.max(h,0),c=Math.min(c,A);const d=c-h;return d<0||d===1/0?null:(s.vertexCount=d,s.firstVertex=h,s)}getGeometryCacheKey(){const{geometry:t}=this;let e="";for(const n of Object.keys(t.attributes).sort()){const i=t.attributes[n];e+=n+",",i.data&&(e+=i.data.stride+","),i.offset&&(e+=i.offset+","),i.itemSize&&(e+=i.itemSize+","),i.normalized&&(e+="n,")}return t.index&&(e+="index,"),e}getMaterialCacheKey(){const{object:t,material:e}=this;let n=e.customProgramCacheKey();for(const t of function(t){const e=Object.keys(t);let n=Object.getPrototypeOf(t);for(;n;){const t=Object.getOwnPropertyDescriptors(n);for(const n in t)if(void 0!==t[n]){const i=t[n];i&&"function"==typeof i.get&&e.push(n)}n=Object.getPrototypeOf(n)}return e}(e)){if(/^(is[A-Z]|_)|^(visible|version|uuid|name|opacity|userData)$/.test(t))continue;const i=e[t];let r;if(null!==i){const t=typeof i;"number"===t?r=0!==i?"1":"0":"object"===t?(r="{",i.isTexture&&(r+=i.mapping),r+="}"):r=String(i)}else r=String(i);n+=r+","}return n+=this.clippingContext.cacheKey+",",t.geometry&&(n+=this.getGeometryCacheKey()),t.skeleton&&(n+=t.skeleton.bones.length+","),t.morphTargetInfluences&&(n+=t.morphTargetInfluences.length+","),t.isBatchedMesh&&(n+=t._matricesTexture.uuid+",",null!==t._colorsTexture&&(n+=t._colorsTexture.uuid+",")),t.count>1&&(n+=t.uuid+","),LT(n)}get needsUpdate(){return this.initialNodesCacheKey!==this.getDynamicCacheKey()||this.clippingNeedsUpdate}getDynamicCacheKey(){let t=this._nodes.getCacheKey(this.scene,this.lightsNode);return this.object.receiveShadow&&(t+=1),t}getCacheKey(){return this.getMaterialCacheKey()+this.getDynamicCacheKey()}dispose(){this.material.removeEventListener("dispose",this.onMaterialDispose),this.onDispose()}}const mU=[];class gU{constructor(t,e,n,i,r,s){this.renderer=t,this.nodes=e,this.geometries=n,this.pipelines=i,this.bindings=r,this.info=s,this.chainMaps={}}get(t,e,n,i,r,s,a){const o=this.getChainMap(a);mU[0]=t,mU[1]=e,mU[2]=s,mU[3]=r;let l=o.get(mU);return void 0===l?(l=this.createRenderObject(this.nodes,this.geometries,this.renderer,t,e,n,i,r,s,a),o.set(mU,l)):(l.updateClipping(s.clippingContext),(l.version!==e.version||l.needsUpdate)&&(l.initialCacheKey!==l.getCacheKey()?(l.dispose(),l=this.get(t,e,n,i,r,s,a)):l.version=e.version)),l}getChainMap(t="default"){return this.chainMaps[t]||(this.chainMaps[t]=new cU)}dispose(){this.chainMaps={}}createRenderObject(t,e,n,i,r,s,a,o,l,u){const h=this.getChainMap(u),c=new fU(t,e,n,i,r,s,a,o,l);return c.onDispose=()=>{this.pipelines.delete(c),this.bindings.delete(c),this.nodes.delete(c),h.delete(c.getChainArray())},c}}class yU{constructor(){this.data=new WeakMap}get(t){let e=this.data.get(t);return void 0===e&&(e={},this.data.set(t,e)),e}delete(t){let e;return this.data.has(t)&&(e=this.data.get(t),this.data.delete(t)),e}has(t){return this.data.has(t)}dispose(){this.data=new WeakMap}}const vU=1,_U=2,xU=4,bU=16;class SU extends yU{constructor(t){super(),this.backend=t}delete(t){const e=super.delete(t);return void 0!==e&&this.backend.destroyAttribute(t),e}update(t,e){const n=this.get(t);if(void 0===n.version)e===vU?this.backend.createAttribute(t):e===_U?this.backend.createIndexAttribute(t):e===xU&&this.backend.createStorageAttribute(t),n.version=this._getBufferAttribute(t).version;else{const e=this._getBufferAttribute(t);(n.version<e.version||e.usage===Bb)&&(this.backend.updateAttribute(t),n.version=e.version)}}_getBufferAttribute(t){return t.isInterleavedBufferAttribute&&(t=t.data),t}}function MU(t){return null!==t.index?t.index.version:t.attributes.position.version}function wU(t){const e=[],n=t.index,i=t.attributes.position;if(null!==n){const t=n.array;for(let n=0,i=t.length;n<i;n+=3){const i=t[n+0],r=t[n+1],s=t[n+2];e.push(i,r,r,s,s,i)}}else{for(let t=0,n=i.array.length/3-1;t<n;t+=3){const n=t+0,i=t+1,r=t+2;e.push(n,i,i,r,r,n)}}const r=new(function(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}(e)?ew:tw)(e,1);return r.version=MU(t),r}class TU extends yU{constructor(t,e){super(),this.attributes=t,this.info=e,this.wireframes=new WeakMap,this.attributeCall=new WeakMap}has(t){const e=t.geometry;return super.has(e)&&!0===this.get(e).initialized}updateForRender(t){!1===this.has(t)&&this.initGeometry(t),this.updateAttributes(t)}initGeometry(t){const e=t.geometry;this.get(e).initialized=!0,this.info.memory.geometries++;const n=()=>{this.info.memory.geometries--;const i=e.index,r=t.getAttributes();null!==i&&this.attributes.delete(i);for(const t of r)this.attributes.delete(t);const s=this.wireframes.get(e);void 0!==s&&this.attributes.delete(s),e.removeEventListener("dispose",n)};e.addEventListener("dispose",n)}updateAttributes(t){const e=t.getAttributes();for(const t of e)t.isStorageBufferAttribute||t.isStorageInstancedBufferAttribute?this.updateAttribute(t,xU):this.updateAttribute(t,vU);const n=this.getIndex(t);null!==n&&this.updateAttribute(n,_U)}updateAttribute(t,e){const n=this.info.render.calls;t.isInterleavedBufferAttribute?void 0===this.attributeCall.get(t)?(this.attributes.update(t,e),this.attributeCall.set(t,n)):this.attributeCall.get(t.data)!==n&&(this.attributes.update(t,e),this.attributeCall.set(t.data,n),this.attributeCall.set(t,n)):this.attributeCall.get(t)!==n&&(this.attributes.update(t,e),this.attributeCall.set(t,n))}getIndex(t){const{geometry:e,material:n}=t;let i=e.index;if(!0===n.wireframe){const t=this.wireframes;let n=t.get(e);void 0===n?(n=wU(e),t.set(e,n)):n.version!==MU(e)&&(this.attributes.delete(n),n=wU(e),t.set(e,n)),i=n}return i}}class EU{constructor(){this.autoReset=!0,this.frame=0,this.calls=0,this.render={calls:0,frameCalls:0,drawCalls:0,triangles:0,points:0,lines:0,timestamp:0,previousFrameCalls:0,timestampCalls:0},this.compute={calls:0,frameCalls:0,timestamp:0,previousFrameCalls:0,timestampCalls:0},this.memory={geometries:0,textures:0}}update(t,e,n){this.render.drawCalls++,t.isMesh||t.isSprite?this.render.triangles+=n*(e/3):t.isPoints?this.render.points+=n*e:t.isLineSegments?this.render.lines+=n*(e/2):t.isLine?this.render.lines+=n*(e-1):console.error("THREE.WebGPUInfo: Unknown object type.")}updateTimestamp(t,e){0===this[t].timestampCalls&&(this[t].timestamp=0),this[t].timestamp+=e,this[t].timestampCalls++,this[t].timestampCalls>=this[t].previousFrameCalls&&(this[t].timestampCalls=0)}reset(){const t=this.render.frameCalls;this.render.previousFrameCalls=t;const e=this.compute.frameCalls;this.compute.previousFrameCalls=e,this.render.drawCalls=0,this.render.frameCalls=0,this.compute.frameCalls=0,this.render.triangles=0,this.render.points=0,this.render.lines=0}dispose(){this.reset(),this.calls=0,this.render.calls=0,this.compute.calls=0,this.render.timestamp=0,this.compute.timestamp=0,this.memory.geometries=0,this.memory.textures=0}}class CU{constructor(t){this.cacheKey=t,this.usedTimes=0}}class RU extends CU{constructor(t,e,n){super(t),this.vertexProgram=e,this.fragmentProgram=n}}class NU extends CU{constructor(t,e){super(t),this.computeProgram=e,this.isComputePipeline=!0}}let PU=0;class DU{constructor(t,e,n=null,i=null){this.id=PU++,this.code=t,this.stage=e,this.transforms=n,this.attributes=i,this.usedTimes=0}}class IU extends yU{constructor(t,e){super(),this.backend=t,this.nodes=e,this.bindings=null,this.caches=new Map,this.programs={vertex:new Map,fragment:new Map,compute:new Map}}getForCompute(t,e){const{backend:n}=this,i=this.get(t);if(this._needsComputeUpdate(t)){const r=i.pipeline;r&&(r.usedTimes--,r.computeProgram.usedTimes--);const s=this.nodes.getForCompute(t);let a=this.programs.compute.get(s.computeShader);void 0===a&&(r&&0===r.computeProgram.usedTimes&&this._releaseProgram(r.computeProgram),a=new DU(s.computeShader,"compute",s.transforms,s.nodeAttributes),this.programs.compute.set(s.computeShader,a),n.createProgram(a));const o=this._getComputeCacheKey(t,a);let l=this.caches.get(o);void 0===l&&(r&&0===r.usedTimes&&this._releasePipeline(r),l=this._getComputePipeline(t,a,o,e)),l.usedTimes++,a.usedTimes++,i.version=t.version,i.pipeline=l}return i.pipeline}getForRender(t,e=null){const{backend:n}=this,i=this.get(t);if(this._needsRenderUpdate(t)){const r=i.pipeline;r&&(r.usedTimes--,r.vertexProgram.usedTimes--,r.fragmentProgram.usedTimes--);const s=t.getNodeBuilderState();let a=this.programs.vertex.get(s.vertexShader);void 0===a&&(r&&0===r.vertexProgram.usedTimes&&this._releaseProgram(r.vertexProgram),a=new DU(s.vertexShader,"vertex"),this.programs.vertex.set(s.vertexShader,a),n.createProgram(a));let o=this.programs.fragment.get(s.fragmentShader);void 0===o&&(r&&0===r.fragmentProgram.usedTimes&&this._releaseProgram(r.fragmentProgram),o=new DU(s.fragmentShader,"fragment"),this.programs.fragment.set(s.fragmentShader,o),n.createProgram(o));const l=this._getRenderCacheKey(t,a,o);let u=this.caches.get(l);void 0===u?(r&&0===r.usedTimes&&this._releasePipeline(r),u=this._getRenderPipeline(t,a,o,l,e)):t.pipeline=u,u.usedTimes++,a.usedTimes++,o.usedTimes++,i.pipeline=u}return i.pipeline}delete(t){const e=this.get(t).pipeline;return e&&(e.usedTimes--,0===e.usedTimes&&this._releasePipeline(e),e.isComputePipeline?(e.computeProgram.usedTimes--,0===e.computeProgram.usedTimes&&this._releaseProgram(e.computeProgram)):(e.fragmentProgram.usedTimes--,e.vertexProgram.usedTimes--,0===e.vertexProgram.usedTimes&&this._releaseProgram(e.vertexProgram),0===e.fragmentProgram.usedTimes&&this._releaseProgram(e.fragmentProgram))),super.delete(t)}dispose(){super.dispose(),this.caches=new Map,this.programs={vertex:new Map,fragment:new Map,compute:new Map}}updateForRender(t){this.getForRender(t)}_getComputePipeline(t,e,n,i){n=n||this._getComputeCacheKey(t,e);let r=this.caches.get(n);return void 0===r&&(r=new NU(n,e),this.caches.set(n,r),this.backend.createComputePipeline(r,i)),r}_getRenderPipeline(t,e,n,i,r){i=i||this._getRenderCacheKey(t,e,n);let s=this.caches.get(i);return void 0===s&&(s=new RU(i,e,n),this.caches.set(i,s),t.pipeline=s,this.backend.createRenderPipeline(t,r)),s}_getComputeCacheKey(t,e){return t.id+","+e.id}_getRenderCacheKey(t,e,n){return e.id+","+n.id+","+this.backend.getRenderCacheKey(t)}_releasePipeline(t){this.caches.delete(t.cacheKey)}_releaseProgram(t){const e=t.code,n=t.stage;this.programs[n].delete(e)}_needsComputeUpdate(t){const e=this.get(t);return void 0===e.pipeline||e.version!==t.version}_needsRenderUpdate(t){return void 0===this.get(t).pipeline||this.backend.needsRenderUpdate(t)}}class LU extends yU{constructor(t,e,n,i,r,s){super(),this.backend=t,this.textures=n,this.pipelines=r,this.attributes=i,this.nodes=e,this.info=s,this.pipelines.bindings=this}getForRender(t){const e=t.getBindings();for(const t of e){const n=this.get(t);void 0===n.bindGroup&&(this._init(t),this.backend.createBindings(t,e),n.bindGroup=t)}return e}getForCompute(t){const e=this.nodes.getForCompute(t).bindings;for(const t of e){const n=this.get(t);void 0===n.bindGroup&&(this._init(t),this.backend.createBindings(t,e),n.bindGroup=t)}return e}updateForCompute(t){this._updateBindings(this.getForCompute(t))}updateForRender(t){this._updateBindings(this.getForRender(t))}_updateBindings(t){for(const e of t)this._update(e,t)}_init(t){for(const e of t.bindings)if(e.isSampledTexture)this.textures.updateTexture(e.texture);else if(e.isStorageBuffer){const t=e.attribute;this.attributes.update(t,xU)}}_update(t,e){const{backend:n}=this;let i=!1;for(const e of t.bindings){if(e.isNodeUniformsGroup){if(!this.nodes.updateGroup(e))continue}if(e.isUniformBuffer){e.update()&&n.updateBinding(e)}else if(e.isSampler)e.update();else if(e.isSampledTexture){e.needsBindingsUpdate(this.textures.get(e.texture).generation)&&(i=!0);const t=e.update(),r=e.texture;t&&this.textures.updateTexture(r);const s=n.get(r);if(!0===n.isWebGPUBackend&&void 0===s.texture&&void 0===s.externalTexture&&(console.error("Bindings._update: binding should be available:",e,t,r,e.textureNode.value,i),this.textures.updateTexture(r),i=!0),!0===r.isStorageTexture){const t=this.get(r);!0===e.store?t.needsMipmap=!0:!0===r.generateMipmaps&&this.textures.needsMipmaps(r)&&!0===t.needsMipmap&&(this.backend.generateMipmaps(r),t.needsMipmap=!1)}}}!0===i&&this.backend.updateBindings(t,e)}}class BU{constructor(t,e,n=null){this.isNodeAttribute=!0,this.name=t,this.type=e,this.node=n}}class UU{constructor(t,e,n){this.isNodeUniform=!0,this.name=t,this.type=e,this.node=n.getSelf()}get value(){return this.node.value}set value(t){this.node.value=t}get id(){return this.node.id}get groupNode(){return this.node.groupNode}}class OU{constructor(t,e){this.isNodeVar=!0,this.name=t,this.type=e}}class FU extends OU{constructor(t,e){super(t,e),this.needsInterpolation=!1,this.isNodeVarying=!0}}class kU{constructor(t,e,n=""){this.name=t,this.type=e,this.code=n,Object.defineProperty(this,"isNodeCode",{value:!0})}}let zU=0;class qU{constructor(t=null){this.id=zU++,this.nodesData=new WeakMap,this.parent=t}getData(t){let e=this.nodesData.get(t);return void 0===e&&null!==this.parent&&(e=this.parent.getData(t)),e}setData(t,e){this.nodesData.set(t,e)}}class GU extends yC{static get type(){return"ParameterNode"}constructor(t,e=null){super(t,e),this.isParameterNode=!0}getHash(){return this.uuid}generate(){return this.name}}class VU extends $T{static get type(){return"CodeNode"}constructor(t="",e=[],n=""){super("code"),this.isCodeNode=!0,this.code=t,this.language=n,this.includes=e}isGlobal(){return!0}setIncludes(t){return this.includes=t,this}getIncludes(){return this.includes}generate(t){const e=this.getIncludes(t);for(const n of e)n.build(t);const n=t.getCodeFromNode(this,this.getNodeType(t));return n.code=this.code,n.code}serialize(t){super.serialize(t),t.code=this.code,t.language=this.language}deserialize(t){super.deserialize(t),this.code=t.code,this.language=t.language}}class HU extends VU{static get type(){return"FunctionNode"}constructor(t="",e=[],n=""){super(t,e,n)}getNodeType(t){return this.getNodeFunction(t).type}getInputs(t){return this.getNodeFunction(t).inputs}getNodeFunction(t){const e=t.getDataFromNode(this);let n=e.nodeFunction;return void 0===n&&(n=t.parser.parseFunction(this.code),e.nodeFunction=n),n}generate(t,e){super.generate(t);const n=this.getNodeFunction(t),i=n.name,r=n.type,s=t.getCodeFromNode(this,r);""!==i&&(s.name=i);const a=t.getPropertyName(s),o=this.getNodeFunction(t).getCode(a);return s.code=o+"\n","property"===e?a:t.format(`${a}()`,r,e)}}class jU{constructor(t,e){this.name=t,this.value=e,this.boundary=0,this.itemSize=0,this.offset=0}setValue(t){this.value=t}getValue(){return this.value}}class WU extends jU{constructor(t,e=0){super(t,e),this.isNumberUniform=!0,this.boundary=4,this.itemSize=1}}class XU extends jU{constructor(t,e=new $b){super(t,e),this.isVector2Uniform=!0,this.boundary=8,this.itemSize=2}}class YU extends jU{constructor(t,e=new _S){super(t,e),this.isVector3Uniform=!0,this.boundary=16,this.itemSize=3}}class QU extends jU{constructor(t,e=new fS){super(t,e),this.isVector4Uniform=!0,this.boundary=16,this.itemSize=4}}class $U extends jU{constructor(t,e=new GM){super(t,e),this.isColorUniform=!0,this.boundary=16,this.itemSize=3}}class ZU extends jU{constructor(t,e=new Zb){super(t,e),this.isMatrix3Uniform=!0,this.boundary=48,this.itemSize=12}}class KU extends jU{constructor(t,e=new $S){super(t,e),this.isMatrix4Uniform=!0,this.boundary=64,this.itemSize=16}}class JU extends WU{constructor(t){super(t.name,t.value),this.nodeUniform=t}getValue(){return this.nodeUniform.value}}class tO extends XU{constructor(t){super(t.name,t.value),this.nodeUniform=t}getValue(){return this.nodeUniform.value}}class eO extends YU{constructor(t){super(t.name,t.value),this.nodeUniform=t}getValue(){return this.nodeUniform.value}}class nO extends QU{constructor(t){super(t.name,t.value),this.nodeUniform=t}getValue(){return this.nodeUniform.value}}class iO extends $U{constructor(t){super(t.name,t.value),this.nodeUniform=t}getValue(){return this.nodeUniform.value}}class rO extends ZU{constructor(t){super(t.name,t.value),this.nodeUniform=t}getValue(){return this.nodeUniform.value}}class sO extends KU{constructor(t){super(t.name,t.value),this.nodeUniform=t}getValue(){return this.nodeUniform.value}}class aO extends $T{static get type(){return"StackNode"}constructor(t=null){super(),this.nodes=[],this.outputNode=null,this.parent=t,this._currentCond=null,this.isStackNode=!0}getNodeType(t){return this.outputNode?this.outputNode.getNodeType(t):"void"}add(t){return this.nodes.push(t),this}If(t,e){const n=new LE(e);return this._currentCond=bN(t,n),this.add(this._currentCond)}ElseIf(t,e){const n=new LE(e),i=bN(t,n);return this._currentCond.elseNode=i,this._currentCond=i,this}Else(t){return this._currentCond.elseNode=new LE(t),this}build(t,...e){const n=GE();qE(this);for(const e of this.nodes)e.build(t,"void");return qE(n),this.outputNode?this.outputNode.build(t,...e):super.build(t,...e)}else(...t){return console.warn("TSL.StackNode: .else() has been renamed to .Else()."),this.Else(...t)}elseif(...t){return console.warn("TSL.StackNode: .elseif() has been renamed to .ElseIf()."),this.ElseIf(...t)}}const oO=FE(aO),lO=[.125,.215,.35,.446,.526,.582],uO=20,hO=new MT(-1,1,1,-1,0,1),cO=new Dw(90,1),AO=new GM;let dO=null,pO=0,fO=0;const mO=(1+Math.sqrt(5))/2,gO=1/mO,yO=[new _S(-mO,gO,0),new _S(mO,gO,0),new _S(-gO,0,mO),new _S(gO,0,mO),new _S(0,mO,-gO),new _S(0,mO,gO),new _S(-1,1,-1),new _S(1,1,-1),new _S(-1,1,1),new _S(1,1,1)],vO=[3,1,5,0,4,2],_O=RB(iP(),nP("faceIndex")).normalize(),xO=JE(_O.x,_O.y.negate(),_O.z);class bO{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._backgroundBox=null}fromScene(t,e=0,n=.1,i=100){dO=this._renderer.getRenderTarget(),pO=this._renderer.getActiveCubeFace(),fO=this._renderer.getActiveMipmapLevel(),this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(t,n,i,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}async compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=TO(),await this._compileMaterial(this._cubemapMaterial))}async compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=EO(),await this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose(),null!==this._backgroundBox&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(dO,pO,fO),t.scissorTest=!1,MO(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===vx||t.mapping===_x?this._setSize(0===t.image.length?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),dO=this._renderer.getRenderTarget(),pO=this._renderer.getActiveCubeFace(),fO=this._renderer.getActiveMipmapLevel();const n=e||this._allocateTargets();return this._textureToCubeUV(t,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,n={magFilter:Rx,minFilter:Rx,generateMipmaps:!1,type:kx,format:Gx,colorSpace:vb},i=SO(t,e,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=SO(t,e,n);const{_lodMax:i}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas,lodMeshes:this._lodMeshes}=function(t){const e=[],n=[],i=[],r=[];let s=t;const a=t-4+1+lO.length;for(let o=0;o<a;o++){const a=Math.pow(2,s);n.push(a);let l=1/a;o>t-4?l=lO[o-t+4-1]:0===o&&(l=0),i.push(l);const u=1/(a-2),h=-u,c=1+u,A=[h,h,c,h,c,c,h,h,c,c,h,c],d=6,p=6,f=3,m=2,g=1,y=new Float32Array(f*p*d),v=new Float32Array(m*p*d),_=new Float32Array(g*p*d);for(let t=0;t<d;t++){const e=t%3*2/3-1,n=t>2?0:-1,i=[e,n,0,e+2/3,n,0,e+2/3,n+1,0,e,n,0,e+2/3,n+1,0,e,n+1,0],r=vO[t];y.set(i,f*p*r),v.set(A,m*p*r);const s=[r,r,r,r,r,r];_.set(s,g*p*r)}const x=new cw;x.setAttribute("position",new JM(y,f)),x.setAttribute("uv",new JM(v,m)),x.setAttribute("faceIndex",new JM(_,g)),e.push(x),r.push(new Sw(x,null)),s>4&&s--}return{lodPlanes:e,sizeLods:n,sigmas:i,lodMeshes:r}}(i)),this._blurMaterial=function(t,e,n){const i=KP(new Array(uO).fill(0)),r=gC(new _S(0,1,0)),s=gC(0),a=jE(uO),o=gC(0),l=gC(1),u=uP(null),h=gC(0),c=jE(1/e),A=jE(1/n),d=jE(t),p={n:a,latitudinal:o,weights:i,poleAxis:r,outputDirection:xO,dTheta:s,samples:l,envMap:u,mipInt:h,CUBEUV_TEXEL_WIDTH:c,CUBEUV_TEXEL_HEIGHT:A,CUBEUV_MAX_MIP:d},f=wO("blur");return f.uniforms=p,f.fragmentNode=IB({...p,latitudinal:o.equal(1)}),f}(i,t,e)}return i}async _compileMaterial(t){const e=new Sw(this._lodPlanes[0],t);await this._renderer.compile(e,hO)}_sceneToCubeUV(t,e,n,i){const r=cO;r.near=e,r.far=n;const s=[-1,1,-1,-1,-1,-1],a=[1,1,1,-1,-1,-1],o=this._renderer,l=o.autoClear;o.getClearColor(AO),o.autoClear=!1;let u=this._backgroundBox;if(null===u){const t=new WM({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1});u=new Sw(new ww,t)}let h=!1;const c=t.background;c?c.isColor&&(u.material.color.copy(c),t.background=null,h=!0):(u.material.color.copy(AO),h=!0),o.setRenderTarget(i),o.clear(),h&&o.render(u,r);for(let e=0;e<6;e++){const n=e%3;0===n?(r.up.set(0,s[e],0),r.lookAt(a[e],0,0)):1===n?(r.up.set(0,0,s[e]),r.lookAt(0,a[e],0)):(r.up.set(0,s[e],0),r.lookAt(0,0,a[e]));const l=this._cubeSize;MO(i,n*l,e>2?l:0,l,l),o.render(t,r)}o.autoClear=l,t.background=c}_textureToCubeUV(t,e){const n=this._renderer,i=t.mapping===vx||t.mapping===_x;i?null===this._cubemapMaterial&&(this._cubemapMaterial=TO(t)):null===this._equirectMaterial&&(this._equirectMaterial=EO(t));const r=i?this._cubemapMaterial:this._equirectMaterial;r.fragmentNode.value=t;const s=this._lodMeshes[0];s.material=r;const a=this._cubeSize;MO(e,0,0,3*a,2*a),n.setRenderTarget(e),n.render(s,hO)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;const i=this._lodPlanes.length;for(let e=1;e<i;e++){const n=Math.sqrt(this._sigmas[e]*this._sigmas[e]-this._sigmas[e-1]*this._sigmas[e-1]),r=yO[(i-e-1)%yO.length];this._blur(t,e-1,e,n,r)}e.autoClear=n}_blur(t,e,n,i,r){const s=this._pingPongRenderTarget;this._halfBlur(t,s,e,n,i,"latitudinal",r),this._halfBlur(s,t,n,n,i,"longitudinal",r)}_halfBlur(t,e,n,i,r,s,a){const o=this._renderer,l=this._blurMaterial;"latitudinal"!==s&&"longitudinal"!==s&&console.error("blur direction must be either latitudinal or longitudinal!");const u=this._lodMeshes[i];u.material=l;const h=l.uniforms,c=this._sizeLods[n]-1,A=isFinite(r)?Math.PI/(2*c):2*Math.PI/39,d=r/A,p=isFinite(r)?1+Math.floor(3*d):uO;p>uO&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${p} samples when the maximum is set to 20`);const f=[];let m=0;for(let t=0;t<uO;++t){const e=t/d,n=Math.exp(-e*e/2);f.push(n),0===t?m+=n:t<p&&(m+=2*n)}for(let t=0;t<f.length;t++)f[t]=f[t]/m;t.texture.frame=(t.texture.frame||0)+1,h.envMap.value=t.texture,h.samples.value=p,h.weights.array=f,h.latitudinal.value="latitudinal"===s?1:0,a&&(h.poleAxis.value=a);const{_lodMax:g}=this;h.dTheta.value=A,h.mipInt.value=g-n;const y=this._sizeLods[i];MO(e,3*y*(i>g-4?i-g+4:0),4*(this._cubeSize-y),3*y,2*y),o.setRenderTarget(e),o.render(u,hO)}}function SO(t,e,n){const i=new mS(t,e,n);return i.texture.mapping=306,i.texture.name="PMREM.cubeUv",i.texture.isPMREMTexture=!0,i.scissorTest=!0,i}function MO(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function wO(t){const e=new QI;return e.depthTest=!1,e.depthWrite=!1,e.blending=0,e.name=`PMREM_${t}`,e}function TO(t){const e=wO("cubemap");return e.fragmentNode=XP(t,xO),e}function EO(t){const e=wO("equirect");return e.fragmentNode=uP(t,iL(xO),0),e}let CO=0;class RO{constructor(t="",e=[],n=0,i=[]){this.name=t,this.bindings=e,this.index=n,this.bindingsReference=i,this.id=CO++}}const NO=new WeakMap,PO=new Map([[2,"vec2"],[3,"vec3"],[4,"vec4"],[9,"mat3"],[16,"mat4"]]),DO=new Map([[Int8Array,"int"],[Int16Array,"int"],[Int32Array,"int"],[Uint8Array,"uint"],[Uint16Array,"uint"],[Uint32Array,"uint"],[Float32Array,"float"]]),IO=t=>(t=Number(t))+(t%1?"":".0");class LO{constructor(t,e,n){this.object=t,this.material=t&&t.material||null,this.geometry=t&&t.geometry||null,this.renderer=e,this.parser=n,this.scene=null,this.camera=null,this.nodes=[],this.updateNodes=[],this.updateBeforeNodes=[],this.updateAfterNodes=[],this.hashNodes={},this.monitor=null,this.lightsNode=null,this.environmentNode=null,this.fogNode=null,this.clippingContext=null,this.vertexShader=null,this.fragmentShader=null,this.computeShader=null,this.flowNodes={vertex:[],fragment:[],compute:[]},this.flowCode={vertex:"",fragment:"",compute:""},this.uniforms={vertex:[],fragment:[],compute:[],index:0},this.structs={vertex:[],fragment:[],compute:[],index:0},this.bindings={vertex:{},fragment:{},compute:{}},this.bindingsIndexes={},this.bindGroups=null,this.attributes=[],this.bufferAttributes=[],this.varyings=[],this.codes={},this.vars={},this.flow={code:""},this.chaining=[],this.stack=oO(),this.stacks=[],this.tab="\t",this.currentFunctionNode=null,this.context={material:this.material},this.cache=new qU,this.globalCache=this.cache,this.flowsData=new WeakMap,this.shaderStage=null,this.buildStage=null,this.useComparisonMethod=!1}getBindGroupsCache(){let t=NO.get(this.renderer);return void 0===t&&(t=new cU,NO.set(this.renderer,t)),t}createRenderTarget(t,e,n){return new mS(t,e,n)}createCubeRenderTarget(t,e){return new rL(t,e)}createPMREMGenerator(){return new bO(this.renderer)}includes(t){return this.nodes.includes(t)}_getBindGroup(t,e){const n=this.getBindGroupsCache(),i=[];let r,s=!0;for(const t of e)i.push(t),s=s&&!0!==t.groupNode.shared;return s?(r=n.get(i),void 0===r&&(r=new RO(t,i,this.bindingsIndexes[t].group,i),n.set(i,r))):r=new RO(t,i,this.bindingsIndexes[t].group,i),r}getBindGroupArray(t,e){const n=this.bindings[e];let i=n[t];return void 0===i&&(void 0===this.bindingsIndexes[t]&&(this.bindingsIndexes[t]={binding:0,group:Object.keys(this.bindingsIndexes).length}),n[t]=i=[]),i}getBindings(){let t=this.bindGroups;if(null===t){const e={},n=this.bindings;for(const t of XT)for(const i in n[t]){const r=n[t][i];(e[i]||(e[i]=[])).push(...r)}t=[];for(const n in e){const i=e[n],r=this._getBindGroup(n,i);t.push(r)}this.bindGroups=t}return t}sortBindingGroups(){const t=this.getBindings();t.sort(((t,e)=>t.bindings[0].groupNode.order-e.bindings[0].groupNode.order));for(let e=0;e<t.length;e++){const n=t[e];this.bindingsIndexes[n.name].group=e,n.index=e}}setHashNode(t,e){this.hashNodes[e]=t}addNode(t){!1===this.nodes.includes(t)&&(this.nodes.push(t),this.setHashNode(t,t.getHash(this)))}buildUpdateNodes(){for(const t of this.nodes){const e=t.getUpdateType(),n=t.getUpdateBeforeType(),i=t.getUpdateAfterType();e!==GT&&this.updateNodes.push(t.getSelf()),n!==GT&&this.updateBeforeNodes.push(t.getSelf()),i!==GT&&this.updateAfterNodes.push(t.getSelf())}}get currentNode(){return this.chaining[this.chaining.length-1]}isFilteredTexture(t){return t.magFilter===Rx||t.magFilter===Nx||t.magFilter===Cx||t.magFilter===Px||t.minFilter===Rx||t.minFilter===Nx||t.minFilter===Cx||t.minFilter===Px}addChain(t){this.chaining.push(t)}removeChain(t){if(this.chaining.pop()!==t)throw new Error("NodeBuilder: Invalid node chaining!")}getMethod(t){return t}getNodeFromHash(t){return this.hashNodes[t]}addFlow(t,e){return this.flowNodes[t].push(e),e}setContext(t){this.context=t}getContext(){return this.context}getSharedContext(){return this.context,this.context}setCache(t){this.cache=t}getCache(){return this.cache}getCacheFromNode(t,e=!0){const n=this.getDataFromNode(t);return void 0===n.cache&&(n.cache=new qU(e?this.getCache():null)),n.cache}isAvailable(){return!1}getVertexIndex(){console.warn("Abstract function.")}getInstanceIndex(){console.warn("Abstract function.")}getDrawIndex(){console.warn("Abstract function.")}getFrontFacing(){console.warn("Abstract function.")}getFragCoord(){console.warn("Abstract function.")}isFlipY(){return!1}increaseUsage(t){const e=this.getDataFromNode(t);return e.usageCount=void 0===e.usageCount?1:e.usageCount+1,e.usageCount}generateTexture(){console.warn("Abstract function.")}generateTextureLod(){console.warn("Abstract function.")}generateConst(t,e=null){if(null===e&&("float"===t||"int"===t||"uint"===t?e=0:"bool"===t?e=!1:"color"===t?e=new GM:"vec2"===t?e=new $b:"vec3"===t?e=new _S:"vec4"===t&&(e=new fS)),"float"===t)return IO(e);if("int"===t)return`${Math.round(e)}`;if("uint"===t)return e>=0?`${Math.round(e)}u`:"0u";if("bool"===t)return e?"true":"false";if("color"===t)return`${this.getType("vec3")}( ${IO(e.r)}, ${IO(e.g)}, ${IO(e.b)} )`;const n=this.getTypeLength(t),i=this.getComponentType(t),r=t=>this.generateConst(i,t);if(2===n)return`${this.getType(t)}( ${r(e.x)}, ${r(e.y)} )`;if(3===n)return`${this.getType(t)}( ${r(e.x)}, ${r(e.y)}, ${r(e.z)} )`;if(4===n)return`${this.getType(t)}( ${r(e.x)}, ${r(e.y)}, ${r(e.z)}, ${r(e.w)} )`;if(n>4&&e&&(e.isMatrix3||e.isMatrix4))return`${this.getType(t)}( ${e.elements.map(r).join(", ")} )`;if(n>4)return`${this.getType(t)}()`;throw new Error(`NodeBuilder: Type '${t}' not found in generate constant attempt.`)}getType(t){return"color"===t?"vec3":t}hasGeometryAttribute(t){return this.geometry&&void 0!==this.geometry.getAttribute(t)}getAttribute(t,e){const n=this.attributes;for(const e of n)if(e.name===t)return e;const i=new BU(t,e);return n.push(i),i}getPropertyName(t){return t.name}isVector(t){return/vec\d/.test(t)}isMatrix(t){return/mat\d/.test(t)}isReference(t){return"void"===t||"property"===t||"sampler"===t||"texture"===t||"cubeTexture"===t||"storageTexture"===t||"depthTexture"===t||"texture3D"===t}needsToWorkingColorSpace(){return!1}getComponentTypeFromTexture(t){const e=t.type;if(t.isDataTexture){if(e===Ux)return"int";if(e===Ox)return"uint"}return"float"}getElementType(t){return"mat2"===t?"vec2":"mat3"===t?"vec3":"mat4"===t?"vec4":this.getComponentType(t)}getComponentType(t){if("float"===(t=this.getVectorType(t))||"bool"===t||"int"===t||"uint"===t)return t;const e=/(b|i|u|)(vec|mat)([2-4])/.exec(t);return null===e?null:"b"===e[1]?"bool":"i"===e[1]?"int":"u"===e[1]?"uint":"float"}getVectorType(t){return"color"===t?"vec3":"texture"===t||"cubeTexture"===t||"storageTexture"===t||"texture3D"===t?"vec4":t}getTypeFromLength(t,e="float"){if(1===t)return e;const n=PO.get(t);return("float"===e?"":e[0])+n}getTypeFromArray(t){return DO.get(t.constructor)}getTypeFromAttribute(t){let e=t;t.isInterleavedBufferAttribute&&(e=t.data);const n=e.array,i=t.itemSize,r=t.normalized;let s;return t instanceof nw||!0===r||(s=this.getTypeFromArray(n)),this.getTypeFromLength(i,s)}getTypeLength(t){const e=this.getVectorType(t),n=/vec([2-4])/.exec(e);return null!==n?Number(n[1]):"float"===e||"bool"===e||"int"===e||"uint"===e?1:!0===/mat2/.test(t)?4:!0===/mat3/.test(t)?9:!0===/mat4/.test(t)?16:0}getVectorFromMatrix(t){return t.replace("mat","vec")}changeComponentType(t,e){return this.getTypeFromLength(this.getTypeLength(t),e)}getIntegerType(t){const e=this.getComponentType(t);return"int"===e||"uint"===e?t:this.changeComponentType(t,"int")}addStack(){return this.stack=oO(this.stack),this.stacks.push(GE()||this.stack),qE(this.stack),this.stack}removeStack(){const t=this.stack;return this.stack=t.parent,qE(this.stacks.pop()),t}getDataFromNode(t,e=this.shaderStage,n=null){let i=(n=null===n?t.isGlobal(this)?this.globalCache:this.cache:n).getData(t);return void 0===i&&(i={},n.setData(t,i)),void 0===i[e]&&(i[e]={}),i[e]}getNodeProperties(t,e="any"){const n=this.getDataFromNode(t,e);return n.properties||(n.properties={outputNode:null})}getBufferAttributeFromNode(t,e){const n=this.getDataFromNode(t);let i=n.bufferAttribute;if(void 0===i){const r=this.uniforms.index++;i=new BU("nodeAttribute"+r,e,t),this.bufferAttributes.push(i),n.bufferAttribute=i}return i}getStructTypeFromNode(t,e=this.shaderStage){const n=this.getDataFromNode(t,e);if(void 0===n.structType){const i=this.structs.index++;t.name=`StructType${i}`,this.structs[e].push(t),n.structType=t}return t}getUniformFromNode(t,e,n=this.shaderStage,i=null){const r=this.getDataFromNode(t,n,this.globalCache);let s=r.uniform;if(void 0===s){const a=this.uniforms.index++;s=new UU(i||"nodeUniform"+a,e,t),this.uniforms[n].push(s),r.uniform=s}return s}getVarFromNode(t,e=null,n=t.getNodeType(this),i=this.shaderStage){const r=this.getDataFromNode(t,i);let s=r.variable;if(void 0===s){const t=this.vars[i]||(this.vars[i]=[]);null===e&&(e="nodeVar"+t.length),s=new OU(e,n),t.push(s),r.variable=s}return s}getVaryingFromNode(t,e=null,n=t.getNodeType(this)){const i=this.getDataFromNode(t,"any");let r=i.varying;if(void 0===r){const t=this.varyings,s=t.length;null===e&&(e="nodeVarying"+s),r=new FU(e,n),t.push(r),i.varying=r}return r}getCodeFromNode(t,e,n=this.shaderStage){const i=this.getDataFromNode(t);let r=i.code;if(void 0===r){const t=this.codes[n]||(this.codes[n]=[]),s=t.length;r=new kU("nodeCode"+s,e),t.push(r),i.code=r}return r}addFlowCodeHierarchy(t,e){const{flowCodes:n,flowCodeBlock:i}=this.getDataFromNode(t);let r=!0,s=e;for(;s;){if(!0===i.get(s)){r=!1;break}s=this.getDataFromNode(s).parentNodeBlock}if(r)for(const t of n)this.addLineFlowCode(t)}addLineFlowCodeBlock(t,e,n){const i=this.getDataFromNode(t),r=i.flowCodes||(i.flowCodes=[]),s=i.flowCodeBlock||(i.flowCodeBlock=new WeakMap);r.push(e),s.set(n,!0)}addLineFlowCode(t,e=null){return""===t||(null!==e&&this.context.nodeBlock&&this.addLineFlowCodeBlock(e,t,this.context.nodeBlock),t=this.tab+t,/;\s*$/.test(t)||(t+=";\n"),this.flow.code+=t),this}addFlowCode(t){return this.flow.code+=t,this}addFlowTab(){return this.tab+="\t",this}removeFlowTab(){return this.tab=this.tab.slice(0,-1),this}getFlowData(t){return this.flowsData.get(t)}flowNode(t){const e=t.getNodeType(this),n=this.flowChildNode(t,e);return this.flowsData.set(t,n),n}buildFunctionNode(t){const e=new HU,n=this.currentFunctionNode;return this.currentFunctionNode=e,e.code=this.buildFunctionCode(t),this.currentFunctionNode=n,e}flowShaderNode(t){const e=t.layout,n={[Symbol.iterator](){let t=0;const e=Object.values(this);return{next:()=>({value:e[t],done:t++>=e.length})}}};for(const t of e.inputs)n[t.name]=new GU(t.type,t.name);t.layout=null;const i=t.call(n),r=this.flowStagesNode(i,e.type);return t.layout=e,r}flowStagesNode(t,e=null){const n=this.flow,i=this.vars,r=this.cache,s=this.buildStage,a=this.stack,o={code:""};this.flow=o,this.vars={},this.cache=new qU,this.stack=oO();for(const n of WT)this.setBuildStage(n),o.result=t.build(this,e);return o.vars=this.getVars(this.shaderStage),this.flow=n,this.vars=i,this.cache=r,this.stack=a,this.setBuildStage(s),o}getFunctionOperator(){return null}flowChildNode(t,e=null){const n=this.flow,i={code:""};return this.flow=i,i.result=t.build(this,e),this.flow=n,i}flowNodeFromShaderStage(t,e,n=null,i=null){const r=this.shaderStage;this.setShaderStage(t);const s=this.flowChildNode(e,n);return null!==i&&(s.code+=`${this.tab+i} = ${s.result};\n`),this.flowCode[t]=this.flowCode[t]+s.code,this.setShaderStage(r),s}getAttributesArray(){return this.attributes.concat(this.bufferAttributes)}getAttributes(){console.warn("Abstract function.")}getVaryings(){console.warn("Abstract function.")}getVar(t,e){return`${this.getType(t)} ${e}`}getVars(t){let e="";const n=this.vars[t];if(void 0!==n)for(const t of n)e+=`${this.getVar(t.type,t.name)}; `;return e}getUniforms(){console.warn("Abstract function.")}getCodes(t){const e=this.codes[t];let n="";if(void 0!==e)for(const t of e)n+=t.code+"\n";return n}getHash(){return this.vertexShader+this.fragmentShader+this.computeShader}setShaderStage(t){this.shaderStage=t}getShaderStage(){return this.shaderStage}setBuildStage(t){this.buildStage=t}getBuildStage(){return this.buildStage}buildCode(){console.warn("Abstract function.")}build(){const{object:t,material:e,renderer:n}=this;if(null!==e){let t=n.nodes.library.fromMaterial(e);null===t&&(console.error(`NodeMaterial: Material "${e.type}" is not compatible.`),t=new QI),t.build(this)}else this.addFlow("compute",t);for(const t of WT){this.setBuildStage(t),this.context.vertex&&this.context.vertex.isNode&&this.flowNodeFromShaderStage("vertex",this.context.vertex);for(const e of XT){this.setShaderStage(e);const n=this.flowNodes[e];for(const e of n)"generate"===t?this.flowNode(e):e.build(this)}}return this.setBuildStage(null),this.setShaderStage(null),this.buildCode(),this.buildUpdateNodes(),this}getNodeUniform(t,e){if("float"===e||"int"===e||"uint"===e)return new JU(t);if("vec2"===e||"ivec2"===e||"uvec2"===e)return new tO(t);if("vec3"===e||"ivec3"===e||"uvec3"===e)return new eO(t);if("vec4"===e||"ivec4"===e||"uvec4"===e)return new nO(t);if("color"===e)return new iO(t);if("mat3"===e)return new rO(t);if("mat4"===e)return new sO(t);throw new Error(`Uniform "${e}" not declared.`)}createNodeMaterial(t="NodeMaterial"){throw new Error(`THREE.NodeBuilder: createNodeMaterial() was deprecated. Use new ${t}() instead.`)}format(t,e,n){if((e=this.getVectorType(e))===(n=this.getVectorType(n))||null===n||this.isReference(n))return t;const i=this.getTypeLength(e),r=this.getTypeLength(n);return 16===i&&9===r?`${this.getType(n)}(${t}[0].xyz, ${t}[1].xyz, ${t}[2].xyz)`:9===i&&4===r?`${this.getType(n)}(${t}[0].xy, ${t}[1].xy)`:i>4||r>4||0===r?t:i===r?`${this.getType(n)}( ${t} )`:i>r?this.format(`${t}.${"xyz".slice(0,r)}`,this.getTypeFromLength(r,this.getComponentType(e)),n):4===r&&i>1?`${this.getType(n)}( ${this.format(t,e,"vec3")}, 1.0 )`:2===i?`${this.getType(n)}( ${this.format(t,e,"vec2")}, 0.0 )`:(1===i&&r>1&&e!==this.getComponentType(n)&&(t=`${this.getType(this.getComponentType(n))}( ${t} )`),`${this.getType(n)}( ${t} )`)}getSignature(){return`// Three.js r${rx} - Node System\n`}}class BO{constructor(){this.time=0,this.deltaTime=0,this.frameId=0,this.renderId=0,this.startTime=null,this.updateMap=new WeakMap,this.updateBeforeMap=new WeakMap,this.updateAfterMap=new WeakMap,this.renderer=null,this.material=null,this.camera=null,this.object=null,this.scene=null}_getMaps(t,e){let n=t.get(e);return void 0===n&&(n={renderMap:new WeakMap,frameMap:new WeakMap},t.set(e,n)),n}updateBeforeNode(t){const e=t.getUpdateBeforeType(),n=t.updateReference(this);if(e===VT){const{frameMap:e}=this._getMaps(this.updateBeforeMap,n);e.get(n)!==this.frameId&&!1!==t.updateBefore(this)&&e.set(n,this.frameId)}else if(e===HT){const{renderMap:e}=this._getMaps(this.updateBeforeMap,n);e.get(n)!==this.renderId&&!1!==t.updateBefore(this)&&e.set(n,this.renderId)}else e===jT&&t.updateBefore(this)}updateAfterNode(t){const e=t.getUpdateAfterType(),n=t.updateReference(this);if(e===VT){const{frameMap:e}=this._getMaps(this.updateAfterMap,n);e.get(n)!==this.frameId&&!1!==t.updateAfter(this)&&e.set(n,this.frameId)}else if(e===HT){const{renderMap:e}=this._getMaps(this.updateAfterMap,n);e.get(n)!==this.renderId&&!1!==t.updateAfter(this)&&e.set(n,this.renderId)}else e===jT&&t.updateAfter(this)}updateNode(t){const e=t.getUpdateType(),n=t.updateReference(this);if(e===VT){const{frameMap:e}=this._getMaps(this.updateMap,n);e.get(n)!==this.frameId&&!1!==t.update(this)&&e.set(n,this.frameId)}else if(e===HT){const{renderMap:e}=this._getMaps(this.updateMap,n);e.get(n)!==this.renderId&&!1!==t.update(this)&&e.set(n,this.renderId)}else e===jT&&t.update(this)}update(){this.frameId++,void 0===this.lastTime&&(this.lastTime=performance.now()),this.deltaTime=(performance.now()-this.lastTime)/1e3,this.lastTime=performance.now(),this.time+=this.deltaTime}}class UO{constructor(t,e,n=null,i="",r=!1){this.type=t,this.name=e,this.count=n,this.qualifier=i,this.isConst=r}}UO.isNodeFunctionInput=!0;class OO extends mC{static get type(){return"TimerNode"}constructor(t=OO.LOCAL,e=1,n=0){super(n),this.scope=t,this.scale=e,this.updateType=VT}update(t){const e=this.scope,n=this.scale;e===OO.LOCAL?this.value+=t.deltaTime*n:e===OO.DELTA?this.value=t.deltaTime*n:e===OO.FRAME?this.value=t.frameId:this.value=t.time*n}serialize(t){super.serialize(t),t.scope=this.scope,t.scale=this.scale}deserialize(t){super.deserialize(t),this.scope=t.scope,this.scale=t.scale}}OO.LOCAL="local",OO.GLOBAL="global",OO.DELTA="delta",OO.FRAME="frame";class FO extends $T{static get type(){return"OscNode"}constructor(t=FO.SINE,e=((t,e=0)=>BE(new OO(OO.LOCAL,t,e)))()){super(),this.method=t,this.timeNode=e}getNodeType(t){return this.timeNode.getNodeType(t)}setup(){const t=this.method,e=BE(this.timeNode);let n=null;return t===FO.SINE?n=e.add(.75).mul(2*Math.PI).sin().mul(.5).add(.5):t===FO.SQUARE?n=e.fract().round():t===FO.TRIANGLE?n=e.add(.5).fract().mul(2).sub(1).abs():t===FO.SAWTOOTH&&(n=e.fract()),n}serialize(t){super.serialize(t),t.method=this.method}deserialize(t){super.deserialize(t),this.method=t.method}}FO.SINE="sine",FO.SQUARE="square",FO.TRIANGLE="triangle",FO.SAWTOOTH="sawtooth",FO.SINE,FO.SQUARE,FO.TRIANGLE,FO.SAWTOOTH,new Xw,new _S,new _S,new _S,new $S,new _S(0,0,-1),new fS,new _S,new _S,new fS,new $b,new mS,DI.flipX();const kO=new MT(-1,1,1,-1,0,1);class zO extends cw{constructor(t=!1){super();const e=!1===t?[0,-1,0,1,2,1]:[0,2,0,0,2,0];this.setAttribute("position",new iw([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new iw(e,2))}}const qO=new zO;class GO extends Sw{constructor(t=null){super(qO,t),this.camera=kO,this.isQuadMesh=!0}renderAsync(t){return t.renderAsync(this,kO)}render(t){t.render(this,kO)}}class VO extends $T{static get type(){return"SceneNode"}constructor(t=VO.BACKGROUND_BLURRINESS,e=null){super(),this.scope=t,this.scene=e}setup(t){const e=this.scope,n=null!==this.scene?this.scene:t.scene;let i;return e===VO.BACKGROUND_BLURRINESS?i=eD("backgroundBlurriness","float",n):e===VO.BACKGROUND_INTENSITY?i=eD("backgroundIntensity","float",n):console.error("THREE.SceneNode: Unknown scope:",e),i}}VO.BACKGROUND_BLURRINESS="backgroundBlurriness",VO.BACKGROUND_INTENSITY="backgroundIntensity";const HO=kE(VO,VO.BACKGROUND_BLURRINESS),jO=kE(VO,VO.BACKGROUND_INTENSITY),WO="point-list",XO="line-list",YO="line-strip",QO="triangle-list",$O="triangle-strip",ZO="never",KO="less",JO="equal",tF="less-equal",eF="greater",nF="not-equal",iF="greater-equal",rF="always",sF="store",aF="load",oF="clear",lF="ccw",uF="none",hF="front",cF="back",AF="uint16",dF="uint32",pF={R8Unorm:"r8unorm",R8Snorm:"r8snorm",R8Uint:"r8uint",R8Sint:"r8sint",R16Uint:"r16uint",R16Sint:"r16sint",R16Float:"r16float",RG8Unorm:"rg8unorm",RG8Snorm:"rg8snorm",RG8Uint:"rg8uint",RG8Sint:"rg8sint",R32Uint:"r32uint",R32Sint:"r32sint",R32Float:"r32float",RG16Uint:"rg16uint",RG16Sint:"rg16sint",RG16Float:"rg16float",RGBA8Unorm:"rgba8unorm",RGBA8UnormSRGB:"rgba8unorm-srgb",RGBA8Snorm:"rgba8snorm",RGBA8Uint:"rgba8uint",RGBA8Sint:"rgba8sint",BGRA8Unorm:"bgra8unorm",BGRA8UnormSRGB:"bgra8unorm-srgb",RGB9E5UFloat:"rgb9e5ufloat",RGB10A2Unorm:"rgb10a2unorm",RG11B10uFloat:"rgb10a2unorm",RG32Uint:"rg32uint",RG32Sint:"rg32sint",RG32Float:"rg32float",RGBA16Uint:"rgba16uint",RGBA16Sint:"rgba16sint",RGBA16Float:"rgba16float",RGBA32Uint:"rgba32uint",RGBA32Sint:"rgba32sint",RGBA32Float:"rgba32float",Stencil8:"stencil8",Depth16Unorm:"depth16unorm",Depth24Plus:"depth24plus",Depth24PlusStencil8:"depth24plus-stencil8",Depth32Float:"depth32float",Depth32FloatStencil8:"depth32float-stencil8",BC1RGBAUnorm:"bc1-rgba-unorm",BC1RGBAUnormSRGB:"bc1-rgba-unorm-srgb",BC2RGBAUnorm:"bc2-rgba-unorm",BC2RGBAUnormSRGB:"bc2-rgba-unorm-srgb",BC3RGBAUnorm:"bc3-rgba-unorm",BC3RGBAUnormSRGB:"bc3-rgba-unorm-srgb",BC4RUnorm:"bc4-r-unorm",BC4RSnorm:"bc4-r-snorm",BC5RGUnorm:"bc5-rg-unorm",BC5RGSnorm:"bc5-rg-snorm",BC6HRGBUFloat:"bc6h-rgb-ufloat",BC6HRGBFloat:"bc6h-rgb-float",BC7RGBAUnorm:"bc7-rgba-unorm",BC7RGBAUnormSRGB:"bc7-rgba-srgb",ETC2RGB8Unorm:"etc2-rgb8unorm",ETC2RGB8UnormSRGB:"etc2-rgb8unorm-srgb",ETC2RGB8A1Unorm:"etc2-rgb8a1unorm",ETC2RGB8A1UnormSRGB:"etc2-rgb8a1unorm-srgb",ETC2RGBA8Unorm:"etc2-rgba8unorm",ETC2RGBA8UnormSRGB:"etc2-rgba8unorm-srgb",EACR11Unorm:"eac-r11unorm",EACR11Snorm:"eac-r11snorm",EACRG11Unorm:"eac-rg11unorm",EACRG11Snorm:"eac-rg11snorm",ASTC4x4Unorm:"astc-4x4-unorm",ASTC4x4UnormSRGB:"astc-4x4-unorm-srgb",ASTC5x4Unorm:"astc-5x4-unorm",ASTC5x4UnormSRGB:"astc-5x4-unorm-srgb",ASTC5x5Unorm:"astc-5x5-unorm",ASTC5x5UnormSRGB:"astc-5x5-unorm-srgb",ASTC6x5Unorm:"astc-6x5-unorm",ASTC6x5UnormSRGB:"astc-6x5-unorm-srgb",ASTC6x6Unorm:"astc-6x6-unorm",ASTC6x6UnormSRGB:"astc-6x6-unorm-srgb",ASTC8x5Unorm:"astc-8x5-unorm",ASTC8x5UnormSRGB:"astc-8x5-unorm-srgb",ASTC8x6Unorm:"astc-8x6-unorm",ASTC8x6UnormSRGB:"astc-8x6-unorm-srgb",ASTC8x8Unorm:"astc-8x8-unorm",ASTC8x8UnormSRGB:"astc-8x8-unorm-srgb",ASTC10x5Unorm:"astc-10x5-unorm",ASTC10x5UnormSRGB:"astc-10x5-unorm-srgb",ASTC10x6Unorm:"astc-10x6-unorm",ASTC10x6UnormSRGB:"astc-10x6-unorm-srgb",ASTC10x8Unorm:"astc-10x8-unorm",ASTC10x8UnormSRGB:"astc-10x8-unorm-srgb",ASTC10x10Unorm:"astc-10x10-unorm",ASTC10x10UnormSRGB:"astc-10x10-unorm-srgb",ASTC12x10Unorm:"astc-12x10-unorm",ASTC12x10UnormSRGB:"astc-12x10-unorm-srgb",ASTC12x12Unorm:"astc-12x12-unorm",ASTC12x12UnormSRGB:"astc-12x12-unorm-srgb"},fF="clamp-to-edge",mF="repeat",gF="mirror-repeat",yF="linear",vF="nearest",_F="zero",xF="one",bF="src",SF="one-minus-src",MF="src-alpha",wF="one-minus-src-alpha",TF="dst",EF="one-minus-dst",CF="dst-alpha",RF="one-minus-dst-alpha",NF="src-alpha-saturated",PF="constant",DF="one-minus-constant",IF="add",LF="subtract",BF="reverse-subtract",UF="min",OF="max",FF=0,kF=15,zF="keep",qF="zero",GF="replace",VF="invert",HF="increment-clamp",jF="decrement-clamp",WF="increment-wrap",XF="decrement-wrap",YF="storage",QF="read-only-storage",$F="write-only",ZF="read-only",KF="float",JF="unfilterable-float",tk="depth",ek="sint",nk="uint",ik="2d",rk="3d",sk="2d",ak="2d-array",ok="cube",lk="3d",uk="all",hk="vertex",ck="instance",Ak={DepthClipControl:"depth-clip-control",Depth32FloatStencil8:"depth32float-stencil8",TextureCompressionBC:"texture-compression-bc",TextureCompressionETC2:"texture-compression-etc2",TextureCompressionASTC:"texture-compression-astc",TimestampQuery:"timestamp-query",IndirectFirstInstance:"indirect-first-instance",ShaderF16:"shader-f16",RG11B10UFloat:"rg11b10ufloat-renderable",BGRA8UNormStorage:"bgra8unorm-storage",Float32Filterable:"float32-filterable",ClipDistances:"clip-distances",DualSourceBlending:"dual-source-blending",Subgroups:"subgroups"},dk=new $b;class pk extends lP{static get type(){return"PassTextureNode"}constructor(t,e){super(e),this.passNode=t,this.setUpdateMatrix(!1)}setup(t){return t.object.isQuadMesh&&this.passNode.build(t),super.setup(t)}clone(){return new this.constructor(this.passNode,this.value)}}class fk extends pk{static get type(){return"PassMultipleTextureNode"}constructor(t,e,n=!1){super(t,null),this.textureName=e,this.previousTexture=n}updateTexture(){this.value=this.previousTexture?this.passNode.getPreviousTexture(this.textureName):this.passNode.getTexture(this.textureName)}setup(t){return this.updateTexture(),super.setup(t)}clone(){return new this.constructor(this.passNode,this.textureName,this.previousTexture)}}class mk extends JT{static get type(){return"PassNode"}constructor(t,e,n,i={}){super("vec4"),this.scope=t,this.scene=e,this.camera=n,this.options=i,this._pixelRatio=1,this._width=1,this._height=1;const r=new tT;r.isRenderTargetTexture=!0,r.name="depth";const s=new mS(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:kx,...i});s.texture.name="output",s.depthTexture=r,this.renderTarget=s,this.updateBeforeType=VT,this._textures={output:s.texture,depth:r},this._textureNodes={},this._linearDepthNodes={},this._viewZNodes={},this._previousTextures={},this._previousTextureNodes={},this._cameraNear=gC(0),this._cameraFar=gC(0),this._mrt=null,this.isPassNode=!0}setMRT(t){return this._mrt=t,this}getMRT(){return this._mrt}isGlobal(){return!0}getTexture(t){let e=this._textures[t];if(void 0===e){e=this.renderTarget.texture.clone(),e.isRenderTargetTexture=!0,e.name=t,this._textures[t]=e,this.renderTarget.textures.push(e)}return e}getPreviousTexture(t){let e=this._previousTextures[t];return void 0===e&&(e=this.getTexture(t).clone(),e.isRenderTargetTexture=!0,this._previousTextures[t]=e),e}toggleTexture(t){const e=this._previousTextures[t];if(void 0!==e){const n=this._textures[t],i=this.renderTarget.textures.indexOf(n);this.renderTarget.textures[i]=e,this._textures[t]=e,this._previousTextures[t]=n,this._textureNodes[t].updateTexture(),this._previousTextureNodes[t].updateTexture()}}getTextureNode(t="output"){let e=this._textureNodes[t];return void 0===e&&(this._textureNodes[t]=e=BE(new fk(this,t)),this._textureNodes[t].updateTexture()),e}getPreviousTextureNode(t="output"){let e=this._previousTextureNodes[t];return void 0===e&&(void 0===this._textureNodes[t]&&this.getTextureNode(t),this._previousTextureNodes[t]=e=BE(new fk(this,t,!0)),this._previousTextureNodes[t].updateTexture()),e}getViewZNode(t="depth"){let e=this._viewZNodes[t];if(void 0===e){const n=this._cameraNear,i=this._cameraFar;this._viewZNodes[t]=e=jI(this.getTextureNode(t),n,i)}return e}getLinearDepthNode(t="depth"){let e=this._linearDepthNodes[t];if(void 0===e){const n=this._cameraNear,i=this._cameraFar,r=this.getViewZNode(t);this._linearDepthNodes[t]=e=VI(r,n,i)}return e}setup({renderer:t}){return this.renderTarget.samples=void 0===this.options.samples?t.samples:this.options.samples,!0===t.backend.isWebGLBackend&&(this.renderTarget.samples=0),this.renderTarget.depthTexture.isMultisampleRenderTargetTexture=this.renderTarget.samples>1,this.scope===mk.COLOR?this.getTextureNode():this.getLinearDepthNode()}updateBefore(t){const{renderer:e}=t,{scene:n,camera:i}=this;this._pixelRatio=e.getPixelRatio();const r=e.getSize(dk);this.setSize(r.width,r.height);const s=e.getRenderTarget(),a=e.getMRT();this._cameraNear.value=i.near,this._cameraFar.value=i.far;for(const t in this._previousTextures)this.toggleTexture(t);e.setRenderTarget(this.renderTarget),e.setMRT(this._mrt),e.render(n,i),e.setRenderTarget(s),e.setMRT(a)}setSize(t,e){this._width=t,this._height=e;const n=this._width*this._pixelRatio,i=this._height*this._pixelRatio;this.renderTarget.setSize(n,i)}setPixelRatio(t){this._pixelRatio=t,this.setSize(this._width,this._height)}dispose(){this.renderTarget.dispose()}}mk.COLOR="color",mk.DEPTH="depth";class gk extends $T{static get type(){return"FogNode"}constructor(t,e){super("float"),this.isFogNode=!0,this.colorNode=t,this.factorNode=e}getViewZNode(t){let e;const n=t.context.getViewZ;return void 0!==n&&(e=n(this)),(e||EP.z).negate()}setup(){return this.factorNode}}class yk extends gk{static get type(){return"FogRangeNode"}constructor(t,e,n){super(t),this.isFogRangeNode=!0,this.nearNode=e,this.farNode=n}setup(t){const e=this.getViewZNode(t);return yN(this.nearNode,this.farNode,e)}}const vk=FE(yk);class _k extends gk{static get type(){return"FogExp2Node"}constructor(t,e){super(t),this.isFogExp2Node=!0,this.densityNode=e}setup(t){const e=this.getViewZNode(t),n=this.densityNode;return n.mul(n,e,e).negate().exp().oneMinus()}}const xk=FE(_k),bk=zE((({depthTexture:t,shadowCoord:e})=>uP(t,e.xy).compare(e.z))),Sk=zE((({depthTexture:t,shadowCoord:e,shadow:n})=>{const i=(e,n)=>uP(t,e).compare(n),r=eD("mapSize","vec2",n).setGroup(pC),s=eD("radius","float",n).setGroup(pC),a=QE(1).div(r),o=a.x.negate().mul(s),l=a.y.negate().mul(s),u=a.x.mul(s),h=a.y.mul(s),c=o.div(2),A=l.div(2),d=u.div(2),p=h.div(2);return ZC(i(e.xy.add(QE(o,l)),e.z),i(e.xy.add(QE(0,l)),e.z),i(e.xy.add(QE(u,l)),e.z),i(e.xy.add(QE(c,A)),e.z),i(e.xy.add(QE(0,A)),e.z),i(e.xy.add(QE(d,A)),e.z),i(e.xy.add(QE(o,0)),e.z),i(e.xy.add(QE(c,0)),e.z),i(e.xy,e.z),i(e.xy.add(QE(d,0)),e.z),i(e.xy.add(QE(u,0)),e.z),i(e.xy.add(QE(c,p)),e.z),i(e.xy.add(QE(0,p)),e.z),i(e.xy.add(QE(d,p)),e.z),i(e.xy.add(QE(o,h)),e.z),i(e.xy.add(QE(0,h)),e.z),i(e.xy.add(QE(u,h)),e.z)).mul(1/17)})),Mk=zE((({depthTexture:t,shadowCoord:e,shadow:n})=>{const i=(e,n)=>uP(t,e).compare(n),r=eD("mapSize","vec2",n).setGroup(pC),s=QE(1).div(r),a=s.x,o=s.y,l=e.xy,u=BR(l.mul(r).add(.5));return l.subAssign(u.mul(s)),ZC(i(l,e.z),i(l.add(QE(a,0)),e.z),i(l.add(QE(0,o)),e.z),i(l.add(s),e.z),fN(i(l.add(QE(a.negate(),0)),e.z),i(l.add(QE(a.mul(2),0)),e.z),u.x),fN(i(l.add(QE(a.negate(),o)),e.z),i(l.add(QE(a.mul(2),o)),e.z),u.x),fN(i(l.add(QE(0,o.negate())),e.z),i(l.add(QE(0,o.mul(2))),e.z),u.y),fN(i(l.add(QE(a,o.negate())),e.z),i(l.add(QE(a,o.mul(2))),e.z),u.y),fN(fN(i(l.add(QE(a.negate(),o.negate())),e.z),i(l.add(QE(a.mul(2),o.negate())),e.z),u.x),fN(i(l.add(QE(a.negate(),o.mul(2))),e.z),i(l.add(QE(a.mul(2),o.mul(2))),e.z),u.x),u.y)).mul(1/9)})),wk=zE((({depthTexture:t,shadowCoord:e})=>{const n=jE(1).toVar(),i=uP(t).uv(e.xy).rg,r=rN(e.z,i.x);return VE(r.notEqual(jE(1)),(()=>{const t=e.z.sub(i.x),s=nN(0,i.y.mul(i.y));let a=s.div(s.add(t.mul(t)));a=mN(KC(a,.3).div(.95-.3)),n.assign(mN(nN(r,a)))})),n})),Tk=zE((({samples:t,radius:e,size:n,shadowPass:i})=>{const r=jE(0).toVar(),s=jE(0).toVar(),a=t.lessThanEqual(jE(1)).select(jE(0),jE(2).div(t.sub(1))),o=t.lessThanEqual(jE(1)).select(jE(0),jE(-1));pI({start:WE(0),end:WE(t),type:"int",condition:"<"},(({i:t})=>{const l=o.add(jE(t).mul(a)),u=i.uv(ZC(LI.xy,QE(0,l).mul(e)).div(n)).x;r.addAssign(u),s.addAssign(u.mul(u))})),r.divAssign(t),s.divAssign(t);const l=NR(s.sub(r.mul(r)));return QE(r,l)})),Ek=zE((({samples:t,radius:e,size:n,shadowPass:i})=>{const r=jE(0).toVar(),s=jE(0).toVar(),a=t.lessThanEqual(jE(1)).select(jE(0),jE(2).div(t.sub(1))),o=t.lessThanEqual(jE(1)).select(jE(0),jE(-1));pI({start:WE(0),end:WE(t),type:"int",condition:"<"},(({i:t})=>{const l=o.add(jE(t).mul(a)),u=i.uv(ZC(LI.xy,QE(l,0).mul(e)).div(n));r.addAssign(u.x),s.addAssign(ZC(u.y.mul(u.y),u.x.mul(u.x)))})),r.divAssign(t),s.divAssign(t);const l=NR(s.sub(r.mul(r)));return QE(r,l)})),Ck=[bk,Sk,Mk,wk];let Rk=null;const Nk=new GO;class Pk extends MI{static get type(){return"AnalyticLightNode"}constructor(t=null){super(),this.updateType=VT,this.light=t,this.color=new GM,this.colorNode=gC(this.color).setGroup(pC),this.baseColorNode=null,this.shadowMap=null,this.shadowNode=null,this.shadowColorNode=null,this.vsmShadowMapVertical=null,this.vsmShadowMapHorizontal=null,this.vsmMaterialVertical=null,this.vsmMaterialHorizontal=null,this.isAnalyticLightNode=!0}getCacheKey(){return UT(super.getCacheKey(),this.light.id,this.light.castShadow?1:0)}getHash(){return this.light.uuid}setupShadow(t){const{object:e,renderer:n}=t;if(!1===n.shadowMap.enabled)return;let i=this.shadowColorNode;if(null===i){null===Rk&&(Rk=new QI,Rk.fragmentNode=iC(0,0,0,1),Rk.isShadowNodeMaterial=!0,Rk.name="ShadowMaterial");const r=n.shadowMap.type,s=this.light.shadow,a=new tT;a.compareFunction=513;const o=t.createRenderTarget(s.mapSize.width,s.mapSize.height);if(o.depthTexture=a,s.camera.updateProjectionMatrix(),3===r){a.compareFunction=null,this.vsmShadowMapVertical=t.createRenderTarget(s.mapSize.width,s.mapSize.height,{format:Xx,type:kx}),this.vsmShadowMapHorizontal=t.createRenderTarget(s.mapSize.width,s.mapSize.height,{format:Xx,type:kx});const e=uP(a),n=uP(this.vsmShadowMapVertical.texture),i=eD("blurSamples","float",s).setGroup(pC),r=eD("radius","float",s).setGroup(pC),o=eD("mapSize","vec2",s).setGroup(pC);let l=this.vsmMaterialVertical||(this.vsmMaterialVertical=new QI);l.fragmentNode=Tk({samples:i,radius:r,size:o,shadowPass:e}).context(t.getSharedContext()),l.name="VSMVertical",l=this.vsmMaterialHorizontal||(this.vsmMaterialHorizontal=new QI),l.fragmentNode=Ek({samples:i,radius:r,size:o,shadowPass:n}).context(t.getSharedContext()),l.name="VSMHorizontal"}const l=eD("intensity","float",s).setGroup(pC),u=eD("bias","float",s).setGroup(pC),h=eD("normalBias","float",s).setGroup(pC),c=e.material.shadowPositionNode||wP;let A=gC(s.matrix).setGroup(pC).mul(c.add(BP.mul(h)));A=A.xyz.div(A.w);let d=A.z.add(u);n.coordinateSystem===Ob&&(d=d.mul(2).sub(1)),A=JE(A.x,A.y.oneMinus(),d);const p=A.x.greaterThanEqual(0).and(A.x.lessThanEqual(1)).and(A.y.greaterThanEqual(0)).and(A.y.lessThanEqual(1)).and(A.z.lessThanEqual(1)),f=s.filterNode||Ck[n.shadowMap.type]||null;if(null===f)throw new Error("THREE.WebGPURenderer: Shadow map type not supported yet.");const m=uP(o.texture,A),g=p.select(f({depthTexture:3===r?this.vsmShadowMapHorizontal.texture:a,shadowCoord:A,shadow:s}),jE(1));this.shadowMap=o,this.light.shadow.map=o,this.shadowNode=g,this.shadowColorNode=i=this.colorNode.mul(fN(1,g.rgb.mix(m,1),l.mul(m.a))),this.baseColorNode=this.colorNode}this.colorNode=i,this.updateBeforeType=HT}setup(t){this.colorNode=this.baseColorNode||this.colorNode,this.light.castShadow?t.object.receiveShadow&&this.setupShadow(t):null!==this.shadowNode&&this.disposeShadow()}updateShadow(t){const{shadowMap:e,light:n}=this,{renderer:i,scene:r,camera:s}=t,a=i.shadowMap.type,o=e.depthTexture.version;this._depthVersionCached=o;const l=r.overrideMaterial;r.overrideMaterial=Rk,e.setSize(n.shadow.mapSize.width,n.shadow.mapSize.height),n.shadow.updateMatrices(n),n.shadow.camera.layers.mask=s.layers.mask;const u=i.getRenderTarget(),h=i.getRenderObjectFunction();i.setRenderObjectFunction(((t,...e)=>{(!0===t.castShadow||t.receiveShadow&&3===a)&&i.renderObject(t,...e)})),i.setRenderTarget(e),i.render(r,n.shadow.camera),i.setRenderObjectFunction(h),!0!==n.isPointLight&&3===a&&this.vsmPass(t,n),i.setRenderTarget(u),r.overrideMaterial=l}vsmPass(t,e){const{renderer:n}=t;this.vsmShadowMapVertical.setSize(e.shadow.mapSize.width,e.shadow.mapSize.height),this.vsmShadowMapHorizontal.setSize(e.shadow.mapSize.width,e.shadow.mapSize.height),n.setRenderTarget(this.vsmShadowMapVertical),Nk.material=this.vsmMaterialVertical,Nk.render(n),n.setRenderTarget(this.vsmShadowMapHorizontal),Nk.material=this.vsmMaterialHorizontal,Nk.render(n)}disposeShadow(){this.shadowMap.dispose(),this.shadowMap=null,null!==this.vsmShadowMapVertical&&(this.vsmShadowMapVertical.dispose(),this.vsmShadowMapVertical=null,this.vsmMaterialVertical.dispose(),this.vsmMaterialVertical=null),null!==this.vsmShadowMapHorizontal&&(this.vsmShadowMapHorizontal.dispose(),this.vsmShadowMapHorizontal=null,this.vsmMaterialHorizontal.dispose(),this.vsmMaterialHorizontal=null),this.shadowNode=null,this.shadowColorNode=null,this.baseColorNode=null,this.updateBeforeType=GT}updateBefore(t){const e=this.light.shadow;(e.needsUpdate||e.autoUpdate)&&(this.updateShadow(t),this.shadowMap.depthTexture.version===this._depthVersionCached&&(e.needsUpdate=!1))}update(){const{light:t}=this;this.color.copy(t.color).multiplyScalar(t.intensity)}}const Dk=zE((t=>{const{lightDistance:e,cutoffDistance:n,decayExponent:i}=t,r=e.pow(i).max(.01).reciprocal();return n.greaterThan(0).select(r.mul(e.div(n).pow4().oneMinus().clamp().pow2()),r)}));let Ik;function Lk(t){Ik=Ik||new WeakMap;let e=Ik.get(t);return void 0===e&&Ik.set(t,e={}),e}function Bk(t){const e=Lk(t);return e.position||(e.position=gC(new _S).setGroup(pC).onRenderUpdate(((e,n)=>n.value.setFromMatrixPosition(t.matrixWorld))))}function Uk(t){const e=Lk(t);return e.viewPosition||(e.viewPosition=gC(new _S).setGroup(pC).onRenderUpdate((({camera:e},n)=>{n.value=n.value||new _S,n.value.setFromMatrixPosition(t.matrixWorld),n.value.applyMatrix4(e.matrixWorldInverse)})))}const Ok=t=>fP.transformDirection(Bk(t).sub(function(t){const e=Lk(t);return e.targetPosition||(e.targetPosition=gC(new _S).setGroup(pC).onRenderUpdate(((e,n)=>n.value.setFromMatrixPosition(t.target.matrixWorld))))}(t))),Fk=zE((([t])=>{const e=t.mul(.9478672986).add(.0521327014).pow(2.4),n=t.mul(.0773993808),i=t.lessThanEqual(.04045);return fN(e,n,i)})).setLayout({name:"sRGBToLinearSRGB",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),kk=zE((([t])=>{const e=t.pow(.41666).mul(1.055).sub(.055),n=t.mul(12.92),i=t.lessThanEqual(.0031308);return fN(e,n,i)})).setLayout({name:"linearSRGBTosRGB",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),zk=zE((([t,e])=>t.mul(e).clamp())).setLayout({name:"linearToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),qk=zE((([t,e])=>(t=t.mul(e)).div(t.add(1)).clamp())).setLayout({name:"reinhardToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),Gk=zE((([t,e])=>{const n=(t=(t=t.mul(e)).sub(.004).max(0)).mul(t.mul(6.2).add(.5)),i=t.mul(t.mul(6.2).add(1.7)).add(.06);return n.div(i).pow(2.2)})).setLayout({name:"cineonToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),Vk=zE((([t])=>{const e=t.mul(t.add(.0245786)).sub(90537e-9),n=t.mul(t.add(.432951).mul(.983729)).add(.238081);return e.div(n)})),Hk=zE((([t,e])=>{const n=lC(.59719,.35458,.04823,.076,.90834,.01566,.0284,.13383,.83777),i=lC(1.60475,-.53108,-.07367,-.10208,1.10813,-.00605,-.00327,-.07276,1.07602);return t=t.mul(e).div(.6),t=n.mul(t),t=Vk(t),(t=i.mul(t)).clamp()})).setLayout({name:"acesFilmicToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),jk=lC(JE(1.6605,-.1246,-.0182),JE(-.5876,1.1329,-.1006),JE(-.0728,-.0083,1.1187)),Wk=lC(JE(.6274,.0691,.0164),JE(.3293,.9195,.088),JE(.0433,.0113,.8956)),Xk=zE((([t])=>{const e=JE(t).toVar(),n=JE(e.mul(e)).toVar(),i=JE(n.mul(n)).toVar();return jE(15.5).mul(i.mul(n)).sub(JC(40.14,i.mul(e))).add(JC(31.96,i).sub(JC(6.868,n.mul(e))).add(JC(.4298,n).add(JC(.1191,e).sub(.00232))))})),Yk=zE((([t,e])=>{const n=JE(t).toVar(),i=lC(JE(.856627153315983,.137318972929847,.11189821299995),JE(.0951212405381588,.761241990602591,.0767994186031903),JE(.0482516061458583,.101439036467562,.811302368396859)),r=lC(JE(1.1271005818144368,-.1413297634984383,-.14132976349843826),JE(-.11060664309660323,1.157823702216272,-.11060664309660294),JE(-.016493938717834573,-.016493938717834257,1.2519364065950405)),s=jE(-12.47393),a=jE(4.026069);return n.mulAssign(e),n.assign(Wk.mul(n)),n.assign(i.mul(n)),n.assign(nN(n,1e-10)),n.assign(RR(n)),n.assign(n.sub(s).div(a.sub(s))),n.assign(mN(n,0,1)),n.assign(Xk(n)),n.assign(r.mul(n)),n.assign(hN(nN(JE(0),n),JE(2.2))),n.assign(jk.mul(n)),n.assign(mN(n,0,1)),n})).setLayout({name:"agxToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),Qk=zE((([t,e])=>{const n=jE(.76),i=jE(.15);t=t.mul(e);const r=eN(t.r,eN(t.g,t.b)),s=bN(r.lessThan(.08),r.sub(JC(6.25,r.mul(r))),.04);t.subAssign(s);const a=nN(t.r,nN(t.g,t.b));VE(a.lessThan(n),(()=>t));const o=KC(1,n),l=KC(1,o.mul(o).div(a.add(o.sub(n))));t.mulAssign(l.div(a));const u=KC(1,tR(1,i.mul(a.sub(l)).add(1)));return fN(t,JE(l),u)})).setLayout({name:"neutralToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]});FE(class extends $T{constructor(t){super(),this.scope=t}generate(t){const{scope:e}=this,{renderer:n}=t;!0===n.backend.isWebGLBackend?t.addFlowCode(`\t// ${e}Barrier \n`):t.addLineFlowCode(`${e}Barrier()`,this)}});class $k extends JT{static get type(){return"AtomicFunctionNode"}constructor(t,e,n,i=null){super("uint"),this.method=t,this.pointerNode=e,this.valueNode=n,this.storeNode=i}getInputType(t){return this.pointerNode.getNodeType(t)}getNodeType(t){return this.getInputType(t)}generate(t){const e=this.method,n=this.getNodeType(t),i=this.getInputType(t),r=this.pointerNode,s=this.valueNode,a=[];a.push(`&${r.build(t,i)}`),a.push(s.build(t,i));const o=`${t.getMethod(e,n)}( ${a.join(", ")} )`;if(null!==this.storeNode){const e=this.storeNode.build(t,i);t.addLineFlowCode(`${e} = ${o}`,this)}else t.addLineFlowCode(o,this)}}$k.ATOMIC_LOAD="atomicLoad",$k.ATOMIC_STORE="atomicStore",$k.ATOMIC_ADD="atomicAdd",$k.ATOMIC_SUB="atomicSub",$k.ATOMIC_MAX="atomicMax",$k.ATOMIC_MIN="atomicMin",$k.ATOMIC_AND="atomicAnd",$k.ATOMIC_OR="atomicOr",$k.ATOMIC_XOR="atomicXor",FE($k);const Zk=zE((([t,e])=>{const n=t.x,i=t.y,r=t.z;let s=e.element(0).mul(.886227);return s=s.add(e.element(1).mul(1.023328).mul(i)),s=s.add(e.element(2).mul(1.023328).mul(r)),s=s.add(e.element(3).mul(1.023328).mul(n)),s=s.add(e.element(4).mul(.858086).mul(n).mul(i)),s=s.add(e.element(5).mul(.858086).mul(i).mul(r)),s=s.add(e.element(6).mul(r.mul(r).mul(.743125).sub(.247708))),s=s.add(e.element(7).mul(.858086).mul(n).mul(r)),s=s.add(e.element(8).mul(.429043).mul(JC(n,n).sub(JC(i,i)))),s}));class Kk extends Pk{static get type(){return"PointLightNode"}constructor(t=null){super(t),this.cutoffDistanceNode=gC(0).setGroup(pC),this.decayExponentNode=gC(0).setGroup(pC)}update(t){const{light:e}=this;super.update(t),this.cutoffDistanceNode.value=e.distance,this.decayExponentNode.value=e.decay}setup(t){const{colorNode:e,cutoffDistanceNode:n,decayExponentNode:i,light:r}=this,s=t.context.lightingModel,a=Uk(r).sub(EP),o=a.normalize(),l=a.length(),u=Dk({lightDistance:l,cutoffDistance:n,decayExponent:i}),h=e.mul(u),c=t.context.reflectedLight;s.direct({lightDirection:o,lightColor:h,reflectedLight:c},t.stack,t)}}class Jk extends Pk{static get type(){return"DirectionalLightNode"}constructor(t=null){super(t)}setup(t){super.setup(t);const e=t.context.lightingModel,n=this.colorNode,i=Ok(this.light),r=t.context.reflectedLight;e.direct({lightDirection:i,lightColor:n,reflectedLight:r},t.stack,t)}}const tz=new $S,ez=new $S;let nz=null;class iz extends Pk{static get type(){return"RectAreaLightNode"}constructor(t=null){super(t),this.halfHeight=gC(new _S).setGroup(pC),this.halfWidth=gC(new _S).setGroup(pC)}update(t){super.update(t);const{light:e}=this,n=t.camera.matrixWorldInverse;ez.identity(),tz.copy(e.matrixWorld),tz.premultiply(n),ez.extractRotation(tz),this.halfWidth.value.set(.5*e.width,0,0),this.halfHeight.value.set(0,.5*e.height,0),this.halfWidth.value.applyMatrix4(ez),this.halfHeight.value.applyMatrix4(ez)}setup(t){let e,n;super.setup(t),t.isAvailable("float32Filterable")?(e=uP(nz.LTC_FLOAT_1),n=uP(nz.LTC_FLOAT_2)):(e=uP(nz.LTC_HALF_1),n=uP(nz.LTC_HALF_2));const{colorNode:i,light:r}=this,s=t.context.lightingModel,a=Uk(r),o=t.context.reflectedLight;s.directRectArea({lightColor:i,lightPosition:a,halfWidth:this.halfWidth,halfHeight:this.halfHeight,reflectedLight:o,ltc_1:e,ltc_2:n},t.stack,t)}static setLTC(t){nz=t}}class rz extends Pk{static get type(){return"SpotLightNode"}constructor(t=null){super(t),this.coneCosNode=gC(0).setGroup(pC),this.penumbraCosNode=gC(0).setGroup(pC),this.cutoffDistanceNode=gC(0).setGroup(pC),this.decayExponentNode=gC(0).setGroup(pC)}update(t){super.update(t);const{light:e}=this;this.coneCosNode.value=Math.cos(e.angle),this.penumbraCosNode.value=Math.cos(e.angle*(1-e.penumbra)),this.cutoffDistanceNode.value=e.distance,this.decayExponentNode.value=e.decay}getSpotAttenuation(t){const{coneCosNode:e,penumbraCosNode:n}=this;return yN(e,n,t)}setup(t){super.setup(t);const e=t.context.lightingModel,{colorNode:n,cutoffDistanceNode:i,decayExponentNode:r,light:s}=this,a=Uk(s).sub(EP),o=a.normalize(),l=o.dot(Ok(s)),u=this.getSpotAttenuation(l),h=a.length(),c=Dk({lightDistance:h,cutoffDistance:i,decayExponent:r}),A=n.mul(u).mul(c),d=t.context.reflectedLight;e.direct({lightDirection:o,lightColor:A,reflectedLight:d},t.stack,t)}}class sz extends rz{static get type(){return"IESSpotLightNode"}getSpotAttenuation(t){const e=this.light.iesMap;let n=null;if(e&&!0===e.isTexture){const i=t.acos().mul(1/Math.PI);n=uP(e,QE(i,0),0).r}else n=super.getSpotAttenuation(t);return n}}class az extends Pk{static get type(){return"AmbientLightNode"}constructor(t=null){super(t)}setup({context:t}){t.irradiance.addAssign(this.colorNode)}}class oz extends Pk{static get type(){return"HemisphereLightNode"}constructor(t=null){super(t),this.lightPositionNode=Bk(t),this.lightDirectionNode=this.lightPositionNode.normalize(),this.groundColorNode=gC(new GM).setGroup(pC)}update(t){const{light:e}=this;super.update(t),this.lightPositionNode.object3d=e,this.groundColorNode.value.copy(e.groundColor).multiplyScalar(e.intensity)}setup(t){const{colorNode:e,groundColorNode:n,lightDirectionNode:i}=this,r=LP.dot(i).mul(.5).add(.5),s=fN(n,e,r);t.context.irradiance.addAssign(s)}}class lz extends Pk{static get type(){return"LightProbeNode"}constructor(t=null){super(t);const e=[];for(let t=0;t<9;t++)e.push(new _S);this.lightProbe=KP(e)}update(t){const{light:e}=this;super.update(t);for(let t=0;t<9;t++)this.lightProbe.array[t].copy(e.sh.coefficients[t]).multiplyScalar(e.intensity)}setup(t){const e=Zk(BP,this.lightProbe);t.context.irradiance.addAssign(e)}}class uz{parseFunction(){console.warn("Abstract function.")}}class hz{constructor(t,e,n="",i=""){this.type=t,this.inputs=e,this.name=n,this.precision=i}getCode(){console.warn("Abstract function.")}}hz.isNodeFunction=!0;const cz=/^\s*(highp|mediump|lowp)?\s*([a-z_0-9]+)\s*([a-z_0-9]+)?\s*\(([\s\S]*?)\)/i,Az=/[a-z_0-9]+/gi,dz="#pragma main";class pz extends hz{constructor(t){const{type:e,inputs:n,name:i,precision:r,inputsCode:s,blockCode:a,headerCode:o}=(t=>{const e=(t=t.trim()).indexOf(dz),n=-1!==e?t.slice(e+12):t,i=n.match(cz);if(null!==i&&5===i.length){const r=i[4],s=[];let a=null;for(;null!==(a=Az.exec(r));)s.push(a);const o=[];let l=0;for(;l<s.length;){const t="const"===s[l][0];!0===t&&l++;let e=s[l][0];"in"===e||"out"===e||"inout"===e?l++:e="";const n=s[l++][0];let i=Number.parseInt(s[l][0]);!1===Number.isNaN(i)?l++:i=null;const r=s[l++][0];o.push(new UO(n,r,i,e,t))}const u=n.substring(i[0].length),h=void 0!==i[3]?i[3]:"";return{type:i[2],inputs:o,name:h,precision:void 0!==i[1]?i[1]:"",inputsCode:r,blockCode:u,headerCode:-1!==e?t.slice(0,e):""}}throw new Error("FunctionNode: Function is not a GLSL code.")})(t);super(e,n,i,r),this.inputsCode=s,this.blockCode=a,this.headerCode=o}getCode(t=this.name){let e;const n=this.blockCode;if(""!==n){const{type:i,inputsCode:r,headerCode:s,precision:a}=this;let o=`${i} ${t} ( ${r.trim()} )`;""!==a&&(o=`${a} ${o}`),e=s+o+n}else e="";return e}}class fz extends uz{parseFunction(t){return new pz(t)}}function mz(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function gz(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}class yz{constructor(){this.renderItems=[],this.renderItemsIndex=0,this.opaque=[],this.transparent=[],this.bundles=[],this.lightsNode=new bI([]),this.lightsArray=[],this.occlusionQueryCount=0}begin(){return this.renderItemsIndex=0,this.opaque.length=0,this.transparent.length=0,this.bundles.length=0,this.lightsArray.length=0,this.occlusionQueryCount=0,this}getNextRenderItem(t,e,n,i,r,s){let a=this.renderItems[this.renderItemsIndex];return void 0===a?(a={id:t.id,object:t,geometry:e,material:n,groupOrder:i,renderOrder:t.renderOrder,z:r,group:s},this.renderItems[this.renderItemsIndex]=a):(a.id=t.id,a.object=t,a.geometry=e,a.material=n,a.groupOrder=i,a.renderOrder=t.renderOrder,a.z=r,a.group=s),this.renderItemsIndex++,a}push(t,e,n,i,r,s){const a=this.getNextRenderItem(t,e,n,i,r,s);!0===t.occlusionTest&&this.occlusionQueryCount++,(!0===n.transparent||n.transmission>0?this.transparent:this.opaque).push(a)}unshift(t,e,n,i,r,s){const a=this.getNextRenderItem(t,e,n,i,r,s);(!0===n.transparent?this.transparent:this.opaque).unshift(a)}pushBundle(t){this.bundles.push(t)}pushLight(t){this.lightsArray.push(t)}getLightsNode(){return this.lightsNode.fromLights(this.lightsArray)}sort(t,e){this.opaque.length>1&&this.opaque.sort(t||mz),this.transparent.length>1&&this.transparent.sort(e||gz)}finish(){this.lightsNode.setLights(this.lightsArray);for(let t=this.renderItemsIndex,e=this.renderItems.length;t<e;t++){const e=this.renderItems[t];if(null===e.id)break;e.id=null,e.object=null,e.geometry=null,e.material=null,e.groupOrder=null,e.renderOrder=null,e.z=null,e.group=null}}}class vz{constructor(){this.lists=new cU}get(t,e){const n=this.lists,i=[t,e];let r=n.get(i);return void 0===r&&(r=new yz,n.set(i,r)),r}dispose(){this.lists=new cU}}let _z=0;class xz{constructor(){this.id=_z++,this.color=!0,this.clearColor=!0,this.clearColorValue={r:0,g:0,b:0,a:1},this.depth=!0,this.clearDepth=!0,this.clearDepthValue=1,this.stencil=!1,this.clearStencil=!0,this.clearStencilValue=1,this.viewport=!1,this.viewportValue=new fS,this.scissor=!1,this.scissorValue=new fS,this.textures=null,this.depthTexture=null,this.activeCubeFace=0,this.sampleCount=1,this.width=0,this.height=0,this.isRenderContext=!0}getCacheKey(){return bz(this)}}function bz(t){const{textures:e,activeCubeFace:n}=t,i=[n];for(const t of e)i.push(t.id);return BT(i)}class Sz{constructor(){this.chainMaps={}}get(t,e,n=null){const i=[t,e];let r;if(null===n)r="default";else{const t=n.texture.format;r=`${n.textures.length}:${t}:${n.samples}:${n.depthBuffer}:${n.stencilBuffer}`}const s=this.getChainMap(r);let a=s.get(i);return void 0===a&&(a=new xz,s.set(i,a)),null!==n&&(a.sampleCount=0===n.samples?1:n.samples),a}getChainMap(t){return this.chainMaps[t]||(this.chainMaps[t]=new cU)}dispose(){this.chainMaps={}}}const Mz=new _S;class wz extends yU{constructor(t,e,n){super(),this.renderer=t,this.backend=e,this.info=n}updateRenderTarget(t,e=0){const n=this.get(t),i=0===t.samples?1:t.samples,r=n.depthTextureMips||(n.depthTextureMips={}),s=t.textures,a=this.getSize(s[0]),o=a.width>>e,l=a.height>>e;let u=t.depthTexture||r[e],h=!1;void 0===u&&(u=new tT,u.format=t.stencilBuffer?Hx:Vx,u.type=t.stencilBuffer?zx:Ox,u.image.width=o,u.image.height=l,r[e]=u),n.width===a.width&&a.height===n.height||(h=!0,u.needsUpdate=!0,u.image.width=o,u.image.height=l),n.width=a.width,n.height=a.height,n.textures=s,n.depthTexture=u,n.depth=t.depthBuffer,n.stencil=t.stencilBuffer,n.renderTarget=t,n.sampleCount!==i&&(h=!0,u.needsUpdate=!0,n.sampleCount=i);const c={sampleCount:i};for(let t=0;t<s.length;t++){const e=s[t];h&&(e.needsUpdate=!0),this.updateTexture(e,c)}if(this.updateTexture(u,c),!0!==n.initialized){n.initialized=!0;const e=()=>{t.removeEventListener("dispose",e);for(let t=0;t<s.length;t++)this._destroyTexture(s[t]);this._destroyTexture(u),this.delete(t)};t.addEventListener("dispose",e)}}updateTexture(t,e={}){const n=this.get(t);if(!0===n.initialized&&n.version===t.version)return;const i=t.isRenderTargetTexture||t.isDepthTexture||t.isFramebufferTexture,r=this.backend;if(i&&!0===n.initialized&&(r.destroySampler(t),r.destroyTexture(t)),t.isFramebufferTexture){const e=this.renderer.getRenderTarget();t.type=e?e.texture.type:Dx}const{width:s,height:a,depth:o}=this.getSize(t);if(e.width=s,e.height=a,e.depth=o,e.needsMipmaps=this.needsMipmaps(t),e.levels=e.needsMipmaps?this.getMipLevels(t,s,a):1,i||!0===t.isStorageTexture)r.createSampler(t),r.createTexture(t,e),n.generation=t.version;else{if(!0!==n.initialized&&r.createSampler(t),t.version>0){const i=t.image;if(void 0===i)console.warn("THREE.Renderer: Texture marked for update but image is undefined.");else if(!1===i.complete)console.warn("THREE.Renderer: Texture marked for update but image is incomplete.");else{if(t.images){const n=[];for(const e of t.images)n.push(e);e.images=n}else e.image=i;void 0!==n.isDefaultTexture&&!0!==n.isDefaultTexture||(r.createTexture(t,e),n.isDefaultTexture=!1,n.generation=t.version),!0===t.source.dataReady&&r.updateTexture(t,e),e.needsMipmaps&&0===t.mipmaps.length&&r.generateMipmaps(t)}}else r.createDefaultTexture(t),n.isDefaultTexture=!0,n.generation=t.version}if(!0!==n.initialized){n.initialized=!0,n.generation=t.version,this.info.memory.textures++;const e=()=>{t.removeEventListener("dispose",e),this._destroyTexture(t),this.info.memory.textures--};t.addEventListener("dispose",e)}n.version=t.version}getSize(t,e=Mz){let n=t.images?t.images[0]:t.image;return n?(void 0!==n.image&&(n=n.image),e.width=n.width,e.height=n.height,e.depth=t.isCubeTexture?6:n.depth||1):e.width=e.height=e.depth=1,e}getMipLevels(t,e,n){let i;return i=t.isCompressedTexture?t.mipmaps.length:Math.floor(Math.log2(Math.max(e,n)))+1,i}needsMipmaps(t){return!!this.isEnvironmentTexture(t)||(!0===t.isCompressedTexture||t.minFilter!==Tx&&t.minFilter!==Rx)}isEnvironmentTexture(t){const e=t.mapping;return e===xx||e===bx||e===vx||e===_x}_destroyTexture(t){this.backend.destroySampler(t),this.backend.destroyTexture(t),this.delete(t)}}class Tz extends GM{constructor(t,e,n,i=1){super(t,e,n),this.a=i}set(t,e,n,i=1){return this.a=i,super.set(t,e,n)}copy(t){return void 0!==t.a&&(this.a=t.a),super.copy(t)}clone(){return new this.constructor(this.r,this.g,this.b,this.a)}}const Ez=new Tz;class Cz extends yU{constructor(t,e){super(),this.renderer=t,this.nodes=e}update(t,e,n){const i=this.renderer,r=this.nodes.getBackgroundNode(t)||t.background;let s=!1;if(null===r)i._clearColor.getRGB(Ez,vb),Ez.a=i._clearColor.a;else if(!0===r.isColor)r.getRGB(Ez,vb),Ez.a=1,s=!0;else if(!0===r.isNode){const n=this.get(t),s=r;Ez.copy(i._clearColor);let a=n.backgroundMesh;if(void 0===a){const t=MN(iC(s).mul(jO),{getUV:()=>BP,getTextureLevel:()=>HO});let e=nI();e=e.setZ(e.w);const i=new QI;i.name="Background.material",i.side=1,i.depthTest=!1,i.depthWrite=!1,i.fog=!1,i.lights=!1,i.vertexNode=e,i.colorNode=t,n.backgroundMeshNode=t,n.backgroundMesh=a=new Sw(new eT(1,32,32),i),a.frustumCulled=!1,a.name="Background.mesh",a.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)}}const o=s.getCacheKey();n.backgroundCacheKey!==o&&(n.backgroundMeshNode.node=iC(s).mul(jO),n.backgroundMeshNode.needsUpdate=!0,a.material.needsUpdate=!0,n.backgroundCacheKey=o),e.unshift(a,a.geometry,a.material,0,0,null)}else console.error("THREE.Renderer: Unsupported background configuration.",r);if(!0===i.autoClear||!0===s){Ez.multiplyScalar(Ez.a);const t=n.clearColorValue;t.r=Ez.r,t.g=Ez.g,t.b=Ez.b,t.a=Ez.a,n.depthClearValue=i._clearDepth,n.stencilClearValue=i._clearStencil,n.clearColor=!0===i.autoClearColor,n.clearDepth=!0===i.autoClearDepth,n.clearStencil=!0===i.autoClearStencil}else n.clearColor=!1,n.clearDepth=!1,n.clearStencil=!1}}class Rz{constructor(t,e,n,i,r,s,a,o,l,u=[]){this.vertexShader=t,this.fragmentShader=e,this.computeShader=n,this.transforms=u,this.nodeAttributes=i,this.bindings=r,this.updateNodes=s,this.updateBeforeNodes=a,this.updateAfterNodes=o,this.monitor=l,this.usedTimes=0}createBindings(){const t=[];for(const e of this.bindings){if(!0!==e.bindings[0].groupNode.shared){const n=new RO(e.name,[],e.index,e);t.push(n);for(const t of e.bindings)n.bindings.push(t.clone())}else t.push(e)}return t}}const Nz=new WeakMap;class Pz extends yU{constructor(t,e){super(),this.renderer=t,this.backend=e,this.nodeFrame=new BO,this.nodeBuilderCache=new Map,this.callHashCache=new cU,this.groupsData=new cU}updateGroup(t){const e=t.groupNode,n=e.name;if(n===fC.name)return!0;if(n===pC.name){const e=this.get(t),n=this.nodeFrame.renderId;return e.renderId!==n&&(e.renderId=n,!0)}if(n===dC.name){const e=this.get(t),n=this.nodeFrame.frameId;return e.frameId!==n&&(e.frameId=n,!0)}const i=[e,t];let r=this.groupsData.get(i);return void 0===r&&this.groupsData.set(i,r={}),r.version!==e.version&&(r.version=e.version,!0)}getForRenderCacheKey(t){return t.initialCacheKey}getForRender(t){const e=this.get(t);let n=e.nodeBuilderState;if(void 0===n){const{nodeBuilderCache:i}=this,r=this.getForRenderCacheKey(t);if(n=i.get(r),void 0===n){const e=this.backend.createNodeBuilder(t.object,this.renderer);e.scene=t.scene,e.material=t.material,e.camera=t.camera,e.context.material=t.material,e.lightsNode=t.lightsNode,e.environmentNode=this.getEnvironmentNode(t.scene),e.fogNode=this.getFogNode(t.scene),e.clippingContext=t.clippingContext,e.build(),n=this._createNodeBuilderState(e),i.set(r,n)}n.usedTimes++,e.nodeBuilderState=n}return n}delete(t){if(t.isRenderObject){const e=this.get(t).nodeBuilderState;e.usedTimes--,0===e.usedTimes&&this.nodeBuilderCache.delete(this.getForRenderCacheKey(t))}return super.delete(t)}getForCompute(t){const e=this.get(t);let n=e.nodeBuilderState;if(void 0===n){const i=this.backend.createNodeBuilder(t,this.renderer);i.build(),n=this._createNodeBuilderState(i),e.nodeBuilderState=n}return n}_createNodeBuilderState(t){return new Rz(t.vertexShader,t.fragmentShader,t.computeShader,t.getAttributesArray(),t.getBindings(),t.updateNodes,t.updateBeforeNodes,t.updateAfterNodes,t.monitor,t.transforms)}getEnvironmentNode(t){return t.environmentNode||this.get(t).environmentNode||null}getBackgroundNode(t){return t.backgroundNode||this.get(t).backgroundNode||null}getFogNode(t){return t.fogNode||this.get(t).fogNode||null}getCacheKey(t,e){const n=[t,e],i=this.renderer.info.calls;let r=this.callHashCache.get(n);if(void 0===r||r.callId!==i){const s=this.getEnvironmentNode(t),a=this.getFogNode(t),o=[];e&&o.push(e.getCacheKey(!0)),s&&o.push(s.getCacheKey()),a&&o.push(a.getCacheKey()),o.push(this.renderer.shadowMap.enabled?1:0),r={callId:i,cacheKey:BT(o)},this.callHashCache.set(n,r)}return r.cacheKey}updateScene(t){this.updateEnvironment(t),this.updateFog(t),this.updateBackground(t)}get isToneMappingState(){return!this.renderer.getRenderTarget()}updateBackground(t){const e=this.get(t),n=t.background;if(n){const i=0===t.backgroundBlurriness&&e.backgroundBlurriness>0||t.backgroundBlurriness>0&&0===e.backgroundBlurriness;if(e.background!==n||i){let i=null;if(!0===n.isCubeTexture||n.mapping===xx||n.mapping===bx||306===n.mapping)if(t.backgroundBlurriness>0||306===n.mapping)i=FB(n,BP);else{let t;t=!0===n.isCubeTexture?XP(n):uP(n),i=uL(t)}else!0===n.isTexture?i=uP(n,DI.flipY()).setUpdateMatrix(!0):!0!==n.isColor&&console.error("WebGPUNodes: Unsupported background configuration.",n);e.backgroundNode=i,e.background=n,e.backgroundBlurriness=t.backgroundBlurriness}}else e.backgroundNode&&(delete e.backgroundNode,delete e.background)}updateFog(t){const e=this.get(t),n=t.fog;if(n){if(e.fog!==n){let t=null;if(n.isFogExp2){const e=eD("color","color",n).setGroup(pC),i=eD("density","float",n).setGroup(pC);t=xk(e,i)}else if(n.isFog){const e=eD("color","color",n).setGroup(pC),i=eD("near","float",n).setGroup(pC),r=eD("far","float",n).setGroup(pC);t=vk(e,i,r)}else console.error("WebGPUNodes: Unsupported fog configuration.",n);e.fogNode=t,e.fog=n}}else delete e.fogNode,delete e.fog}updateEnvironment(t){const e=this.get(t),n=t.environment;if(n){if(e.environment!==n){let t=null;!0===n.isCubeTexture?t=XP(n):!0===n.isTexture?t=uP(n):console.error("Nodes: Unsupported environment configuration.",n),e.environmentNode=t,e.environment=n}}else e.environmentNode&&(delete e.environmentNode,delete e.environment)}getNodeFrame(t=this.renderer,e=null,n=null,i=null,r=null){const s=this.nodeFrame;return s.renderer=t,s.scene=e,s.object=n,s.camera=i,s.material=r,s}getNodeFrameForRender(t){return this.getNodeFrame(t.renderer,t.scene,t.object,t.camera,t.material)}getOutputCacheKey(){const t=this.renderer;return t.toneMapping+","+t.currentColorSpace}hasOutputChange(t){return Nz.get(t)!==this.getOutputCacheKey()}getOutputNode(t){const e=this.renderer,n=this.getOutputCacheKey(),i=uP(t,DI).renderOutput(e.toneMapping,e.currentColorSpace);return Nz.set(t,n),i}updateBefore(t){const e=t.getNodeBuilderState();for(const n of e.updateBeforeNodes)this.getNodeFrameForRender(t).updateBeforeNode(n)}updateAfter(t){const e=t.getNodeBuilderState();for(const n of e.updateAfterNodes)this.getNodeFrameForRender(t).updateAfterNode(n)}updateForCompute(t){const e=this.getNodeFrame(),n=this.getForCompute(t);for(const t of n.updateNodes)e.updateNode(t)}updateForRender(t){const e=this.getNodeFrameForRender(t),n=t.getNodeBuilderState();for(const t of n.updateNodes)e.updateNode(t)}needsRefresh(t){const e=this.getNodeFrameForRender(t);return t.getMonitor().needsRefresh(t,e)}dispose(){super.dispose(),this.nodeFrame=new BO,this.nodeBuilderCache=new Map}}class Dz{constructor(t,e){this.scene=t,this.camera=e}clone(){return Object.assign(new this.constructor,this)}}class Iz{constructor(){this.lists=new cU}get(t,e){const n=this.lists,i=[t,e];let r=n.get(i);return void 0===r&&(r=new Dz(t,e),n.set(i,r)),r}dispose(){this.lists=new cU}}class Lz{constructor(){this.lightNodes=new WeakMap,this.materialNodes=new Map,this.toneMappingNodes=new Map,this.colorSpaceNodes=new Map}fromMaterial(t){if(t.isNodeMaterial)return t;let e=null;const n=this.getMaterialNodeClass(t.type);if(null!==n){e=new n;for(const n in t)e[n]=t[n]}return e}addColorSpace(t,e){this.addType(t,e,this.colorSpaceNodes)}getColorSpaceFunction(t){return this.colorSpaceNodes.get(t)||null}addToneMapping(t,e){this.addType(t,e,this.toneMappingNodes)}getToneMappingFunction(t){return this.toneMappingNodes.get(t)||null}getMaterialNodeClass(t){return this.materialNodes.get(t)||null}addMaterial(t,e){this.addType(t,e.name,this.materialNodes)}getLightNodeClass(t){return this.lightNodes.get(t)||null}addLight(t,e){this.addClass(t,e,this.lightNodes)}addType(t,e,n){if(n.has(e))console.warn(`Redefinition of node ${e}`);else{if("function"!=typeof t)throw new Error(`Node class ${t.name} is not a class.`);if("function"==typeof e||"object"==typeof e)throw new Error(`Base class ${e} is not a class.`);n.set(e,t)}}addClass(t,e,n){if(n.has(e))console.warn(`Redefinition of node ${e.name}`);else{if("function"!=typeof t)throw new Error(`Node class ${t.name} is not a class.`);if("function"!=typeof e)throw new Error(`Base class ${e.name} is not a class.`);n.set(e,t)}}}const Bz=new Ow,Uz=new $b,Oz=new fS,Fz=new $w,kz=new $S,zz=new fS;class qz{constructor(t,e={}){this.isRenderer=!0;const{logarithmicDepthBuffer:n=!1,alpha:i=!0,depth:r=!0,stencil:s=!1,antialias:a=!1,samples:o=0,getFallback:l=null}=e;this.domElement=t.getDomElement(),this.backend=t,this.samples=o||!0===a?4:0,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.alpha=i,this.logarithmicDepthBuffer=n,this.outputColorSpace=yb,this.toneMapping=0,this.toneMappingExposure=1,this.sortObjects=!0,this.depth=r,this.stencil=s,this.clippingPlanes=[],this.info=new EU,this.nodes={library:new Lz,modelViewMatrix:null,modelNormalViewMatrix:null},this._getFallback=l,this._pixelRatio=1,this._width=this.domElement.width,this._height=this.domElement.height,this._viewport=new fS(0,0,this._width,this._height),this._scissor=new fS(0,0,this._width,this._height),this._scissorTest=!1,this._attributes=null,this._geometries=null,this._nodes=null,this._animation=null,this._bindings=null,this._objects=null,this._pipelines=null,this._bundles=null,this._renderLists=null,this._renderContexts=null,this._textures=null,this._background=null,this._quad=new GO(new QI),this._quad.material.type="Renderer_output",this._currentRenderContext=null,this._opaqueSort=null,this._transparentSort=null,this._frameBufferTarget=null;const u=!0===this.alpha?0:1;this._clearColor=new Tz(0,0,0,u),this._clearDepth=1,this._clearStencil=0,this._renderTarget=null,this._activeCubeFace=0,this._activeMipmapLevel=0,this._mrt=null,this._renderObjectFunction=null,this._currentRenderObjectFunction=null,this._currentRenderBundle=null,this._handleObjectFunction=this._renderObjectDirect,this._initialized=!1,this._initPromise=null,this._compilationPromises=null,this.transparent=!0,this.opaque=!0,this.shadowMap={enabled:!1,type:1},this.xr={enabled:!1},this.debug={checkShaderErrors:!0,onShaderError:null,getShaderAsync:async(t,e,n)=>{await this.compileAsync(t,e);const i=this._renderLists.get(t,e),r=this._renderContexts.get(t,e,this._renderTarget),s=t.overrideMaterial||n.material,a=this._objects.get(n,s,t,e,i.lightsNode,r),{fragmentShader:o,vertexShader:l}=a.getNodeBuilderState();return{fragmentShader:o,vertexShader:l}}}}async init(){if(this._initialized)throw new Error("Renderer: Backend has already been initialized.");return null!==this._initPromise||(this._initPromise=new Promise((async(t,e)=>{let n=this.backend;try{await n.init(this)}catch(t){if(null===this._getFallback)return void e(t);try{this.backend=n=this._getFallback(t),await n.init(this)}catch(t){return void e(t)}}this._nodes=new Pz(this,n),this._animation=new hU(this._nodes,this.info),this._attributes=new SU(n),this._background=new Cz(this,this._nodes),this._geometries=new TU(this._attributes,this.info),this._textures=new wz(this,n,this.info),this._pipelines=new IU(n,this._nodes),this._bindings=new LU(n,this._nodes,this._textures,this._attributes,this._pipelines,this.info),this._objects=new gU(this,this._nodes,this._geometries,this._pipelines,this._bindings,this.info),this._renderLists=new vz,this._bundles=new Iz,this._renderContexts=new Sz,this._initialized=!0,t()}))),this._initPromise}get coordinateSystem(){return this.backend.coordinateSystem}async compileAsync(t,e,n=null){!1===this._initialized&&await this.init();const i=this._nodes.nodeFrame,r=i.renderId,s=this._currentRenderContext,a=this._currentRenderObjectFunction,o=this._compilationPromises,l=!0===t.isScene?t:Bz;null===n&&(n=t);const u=this._renderTarget,h=this._renderContexts.get(n,e,u),c=this._activeMipmapLevel,A=[];this._currentRenderContext=h,this._currentRenderObjectFunction=this.renderObject,this._handleObjectFunction=this._createObjectPipeline,this._compilationPromises=A,i.renderId++,i.update(),h.depth=this.depth,h.stencil=this.stencil,h.clippingContext||(h.clippingContext=new dU),h.clippingContext.updateGlobal(this,e),l.onBeforeRender(this,t,e,u);const d=this._renderLists.get(t,e);if(d.begin(),this._projectObject(t,e,0,d),n!==t&&n.traverseVisible((function(t){t.isLight&&t.layers.test(e.layers)&&d.pushLight(t)})),d.finish(),null!==u){this._textures.updateRenderTarget(u,c);const t=this._textures.get(u);h.textures=t.textures,h.depthTexture=t.depthTexture}else h.textures=null,h.depthTexture=null;this._nodes.updateScene(l),this._background.update(l,d,h);const p=d.opaque,f=d.transparent,m=d.lightsNode;!0===this.opaque&&p.length>0&&this._renderObjects(p,e,l,m),!0===this.transparent&&f.length>0&&this._renderObjects(f,e,l,m),i.renderId=r,this._currentRenderContext=s,this._currentRenderObjectFunction=a,this._compilationPromises=o,this._handleObjectFunction=this._renderObjectDirect,await Promise.all(A)}async renderAsync(t,e){!1===this._initialized&&await this.init();const n=this._renderScene(t,e);await this.backend.resolveTimestampAsync(n,"render")}setMRT(t){return this._mrt=t,this}getMRT(){return this._mrt}_renderBundle(t,e,n){const{bundleGroup:i,camera:r,renderList:s}=t,a=this._currentRenderContext,o=this._bundles.get(i,r),l=this.backend.get(o);void 0===l.renderContexts&&(l.renderContexts=new Set);const u=i.version!==l.version,h=!1===l.renderContexts.has(a)||u;if(l.renderContexts.add(a),h){this.backend.beginBundle(a),(void 0===l.renderObjects||u)&&(l.renderObjects=[]),this._currentRenderBundle=o;const t=s.opaque;t.length>0&&this._renderObjects(t,r,e,n),this._currentRenderBundle=null,this.backend.finishBundle(a,o),l.version=i.version}else{const{renderObjects:t}=l;for(let e=0,n=t.length;e<n;e++){const n=t[e];this._nodes.needsRefresh(n)&&(this._nodes.updateBefore(n),this._nodes.updateForRender(n),this._bindings.updateForRender(n),this._nodes.updateAfter(n))}}this.backend.addBundle(a,o)}render(t,e){if(!1===this._initialized)return console.warn("THREE.Renderer: .render() called before the backend is initialized. Try using .renderAsync() instead."),this.renderAsync(t,e);this._renderScene(t,e)}_getFrameBufferTarget(){const{currentToneMapping:t,currentColorSpace:e}=this;if(!1===(0!==t)&&!1===(e!==vb))return null;const{width:n,height:i}=this.getDrawingBufferSize(Uz),{depth:r,stencil:s}=this;let a=this._frameBufferTarget;return null===a&&(a=new mS(n,i,{depthBuffer:r,stencilBuffer:s,type:kx,format:Gx,colorSpace:vb,generateMipmaps:!1,minFilter:Rx,magFilter:Rx,samples:this.samples}),a.isPostProcessingRenderTarget=!0,this._frameBufferTarget=a),a.depthBuffer=r,a.stencilBuffer=s,a.setSize(n,i),a.viewport.copy(this._viewport),a.scissor.copy(this._scissor),a.viewport.multiplyScalar(this._pixelRatio),a.scissor.multiplyScalar(this._pixelRatio),a.scissorTest=this._scissorTest,a}_renderScene(t,e,n=!0){const i=n?this._getFrameBufferTarget():null,r=this._nodes.nodeFrame,s=r.renderId,a=this._currentRenderContext,o=this._currentRenderObjectFunction,l=!0===t.isScene?t:Bz,u=this._renderTarget,h=this._activeCubeFace,c=this._activeMipmapLevel;let A;null!==i?(A=i,this.setRenderTarget(A)):A=u;const d=this._renderContexts.get(t,e,A);this._currentRenderContext=d,this._currentRenderObjectFunction=this._renderObjectFunction||this.renderObject,this.info.calls++,this.info.render.calls++,this.info.render.frameCalls++,r.renderId=this.info.calls;const p=this.coordinateSystem;e.coordinateSystem!==p&&(e.coordinateSystem=p,e.updateProjectionMatrix()),!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),null===e.parent&&!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld();let f=this._viewport,m=this._scissor,g=this._pixelRatio;null!==A&&(f=A.viewport,m=A.scissor,g=1),this.getDrawingBufferSize(Uz),Oz.set(0,0,Uz.width,Uz.height);const y=void 0===f.minDepth?0:f.minDepth,v=void 0===f.maxDepth?1:f.maxDepth;d.viewportValue.copy(f).multiplyScalar(g).floor(),d.viewportValue.width>>=c,d.viewportValue.height>>=c,d.viewportValue.minDepth=y,d.viewportValue.maxDepth=v,d.viewport=!1===d.viewportValue.equals(Oz),d.scissorValue.copy(m).multiplyScalar(g).floor(),d.scissor=this._scissorTest&&!1===d.scissorValue.equals(Oz),d.scissorValue.width>>=c,d.scissorValue.height>>=c,d.clippingContext||(d.clippingContext=new dU),d.clippingContext.updateGlobal(this,e),l.onBeforeRender(this,t,e,A),kz.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),Fz.setFromProjectionMatrix(kz,p);const _=this._renderLists.get(t,e);if(_.begin(),this._projectObject(t,e,0,_),_.finish(),!0===this.sortObjects&&_.sort(this._opaqueSort,this._transparentSort),null!==A){this._textures.updateRenderTarget(A,c);const t=this._textures.get(A);d.textures=t.textures,d.depthTexture=t.depthTexture,d.width=t.width,d.height=t.height,d.renderTarget=A,d.depth=A.depthBuffer,d.stencil=A.stencilBuffer}else d.textures=null,d.depthTexture=null,d.width=this.domElement.width,d.height=this.domElement.height,d.depth=this.depth,d.stencil=this.stencil;d.width>>=c,d.height>>=c,d.activeCubeFace=h,d.activeMipmapLevel=c,d.occlusionQueryCount=_.occlusionQueryCount,this._nodes.updateScene(l),this._background.update(l,_,d),this.backend.beginRender(d);const{bundles:x,lightsNode:b,transparent:S,opaque:M}=_;if(x.length>0&&this._renderBundles(x,l,b),!0===this.opaque&&M.length>0&&this._renderObjects(M,e,l,b),!0===this.transparent&&S.length>0&&this._renderObjects(S,e,l,b),this.backend.finishRender(d),r.renderId=s,this._currentRenderContext=a,this._currentRenderObjectFunction=o,null!==i){this.setRenderTarget(u,h,c);const t=this._quad;this._nodes.hasOutputChange(A.texture)&&(t.material.fragmentNode=this._nodes.getOutputNode(A.texture),t.material.needsUpdate=!0),this._renderScene(t,t.camera,!1)}return l.onAfterRender(this,t,e,A),d}getMaxAnisotropy(){return this.backend.getMaxAnisotropy()}getActiveCubeFace(){return this._activeCubeFace}getActiveMipmapLevel(){return this._activeMipmapLevel}async setAnimationLoop(t){!1===this._initialized&&await this.init(),this._animation.setAnimationLoop(t)}async getArrayBufferAsync(t){return await this.backend.getArrayBufferAsync(t)}getContext(){return this.backend.getContext()}getPixelRatio(){return this._pixelRatio}getDrawingBufferSize(t){return t.set(this._width*this._pixelRatio,this._height*this._pixelRatio).floor()}getSize(t){return t.set(this._width,this._height)}setPixelRatio(t=1){this._pixelRatio=t,this.setSize(this._width,this._height,!1)}setDrawingBufferSize(t,e,n){this._width=t,this._height=e,this._pixelRatio=n,this.domElement.width=Math.floor(t*n),this.domElement.height=Math.floor(e*n),this.setViewport(0,0,t,e),this._initialized&&this.backend.updateSize()}setSize(t,e,n=!0){this._width=t,this._height=e,this.domElement.width=Math.floor(t*this._pixelRatio),this.domElement.height=Math.floor(e*this._pixelRatio),!0===n&&(this.domElement.style.width=t+"px",this.domElement.style.height=e+"px"),this.setViewport(0,0,t,e),this._initialized&&this.backend.updateSize()}setOpaqueSort(t){this._opaqueSort=t}setTransparentSort(t){this._transparentSort=t}getScissor(t){const e=this._scissor;return t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t}setScissor(t,e,n,i){const r=this._scissor;t.isVector4?r.copy(t):r.set(t,e,n,i)}getScissorTest(){return this._scissorTest}setScissorTest(t){this._scissorTest=t,this.backend.setScissorTest(t)}getViewport(t){return t.copy(this._viewport)}setViewport(t,e,n,i,r=0,s=1){const a=this._viewport;t.isVector4?a.copy(t):a.set(t,e,n,i),a.minDepth=r,a.maxDepth=s}getClearColor(t){return t.copy(this._clearColor)}setClearColor(t,e=1){this._clearColor.set(t),this._clearColor.a=e}getClearAlpha(){return this._clearColor.a}setClearAlpha(t){this._clearColor.a=t}getClearDepth(){return this._clearDepth}setClearDepth(t){this._clearDepth=t}getClearStencil(){return this._clearStencil}setClearStencil(t){this._clearStencil=t}isOccluded(t){const e=this._currentRenderContext;return e&&this.backend.isOccluded(e,t)}clear(t=!0,e=!0,n=!0){if(!1===this._initialized)return console.warn("THREE.Renderer: .clear() called before the backend is initialized. Try using .clearAsync() instead."),this.clearAsync(t,e,n);const i=this._renderTarget||this._getFrameBufferTarget();let r=null;if(null!==i&&(this._textures.updateRenderTarget(i),r=this._textures.get(i)),this.backend.clear(t,e,n,r),null!==i&&null===this._renderTarget){const t=this._quad;this._nodes.hasOutputChange(i.texture)&&(t.material.fragmentNode=this._nodes.getOutputNode(i.texture),t.material.needsUpdate=!0),this._renderScene(t,t.camera,!1)}}clearColor(){return this.clear(!0,!1,!1)}clearDepth(){return this.clear(!1,!0,!1)}clearStencil(){return this.clear(!1,!1,!0)}async clearAsync(t=!0,e=!0,n=!0){!1===this._initialized&&await this.init(),this.clear(t,e,n)}clearColorAsync(){return this.clearAsync(!0,!1,!1)}clearDepthAsync(){return this.clearAsync(!1,!0,!1)}clearStencilAsync(){return this.clearAsync(!1,!1,!0)}get currentToneMapping(){return null!==this._renderTarget?0:this.toneMapping}get currentColorSpace(){return null!==this._renderTarget?vb:this.outputColorSpace}dispose(){this.info.dispose(),this._animation.dispose(),this._objects.dispose(),this._pipelines.dispose(),this._nodes.dispose(),this._bindings.dispose(),this._renderLists.dispose(),this._renderContexts.dispose(),this._textures.dispose(),this.setRenderTarget(null),this.setAnimationLoop(null)}setRenderTarget(t,e=0,n=0){this._renderTarget=t,this._activeCubeFace=e,this._activeMipmapLevel=n}getRenderTarget(){return this._renderTarget}setRenderObjectFunction(t){this._renderObjectFunction=t}getRenderObjectFunction(){return this._renderObjectFunction}async computeAsync(t){!1===this._initialized&&await this.init();const e=this._nodes.nodeFrame,n=e.renderId;this.info.calls++,this.info.compute.calls++,this.info.compute.frameCalls++,e.renderId=this.info.calls;const i=this.backend,r=this._pipelines,s=this._bindings,a=this._nodes,o=Array.isArray(t)?t:[t];if(void 0===o[0]||!0!==o[0].isComputeNode)throw new Error("THREE.Renderer: .compute() expects a ComputeNode.");i.beginCompute(t);for(const e of o){if(!1===r.has(e)){const t=()=>{e.removeEventListener("dispose",t),r.delete(e),s.delete(e),a.delete(e)};e.addEventListener("dispose",t),e.onInit({renderer:this})}a.updateForCompute(e),s.updateForCompute(e);const n=s.getForCompute(e),o=r.getForCompute(e,n);i.compute(t,e,n,o)}i.finishCompute(t),await this.backend.resolveTimestampAsync(t,"compute"),e.renderId=n}async hasFeatureAsync(t){return!1===this._initialized&&await this.init(),this.backend.hasFeature(t)}hasFeature(t){return!1===this._initialized?(console.warn("THREE.Renderer: .hasFeature() called before the backend is initialized. Try using .hasFeatureAsync() instead."),!1):this.backend.hasFeature(t)}copyFramebufferToTexture(t,e=null){const n=this._currentRenderContext;this._textures.updateTexture(t),e=null===e?zz.set(0,0,t.image.width,t.image.height):e,this.backend.copyFramebufferToTexture(t,n,e)}copyTextureToTexture(t,e,n=null,i=null,r=0){this._textures.updateTexture(t),this._textures.updateTexture(e),this.backend.copyTextureToTexture(t,e,n,i,r)}readRenderTargetPixelsAsync(t,e,n,i,r,s=0,a=0){return this.backend.copyTextureToBuffer(t.textures[s],e,n,i,r,a)}_projectObject(t,e,n,i){if(!1===t.visible)return;if(t.layers.test(e.layers))if(t.isGroup)n=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)i.pushLight(t);else if(t.isSprite){if(!t.frustumCulled||Fz.intersectsSprite(t)){!0===this.sortObjects&&zz.setFromMatrixPosition(t.matrixWorld).applyMatrix4(kz);const{geometry:e,material:r}=t;r.visible&&i.push(t,e,r,n,zz.z,null)}}else if(t.isLineLoop)console.error("THREE.Renderer: Objects of type THREE.LineLoop are not supported. Please use THREE.Line or THREE.LineSegments.");else if((t.isMesh||t.isLine||t.isPoints)&&(!t.frustumCulled||Fz.intersectsObject(t))){const{geometry:e,material:r}=t;if(!0===this.sortObjects&&(null===e.boundingSphere&&e.computeBoundingSphere(),zz.copy(e.boundingSphere.center).applyMatrix4(t.matrixWorld).applyMatrix4(kz)),Array.isArray(r)){const s=e.groups;for(let a=0,o=s.length;a<o;a++){const o=s[a],l=r[o.materialIndex];l&&l.visible&&i.push(t,e,l,n,zz.z,o)}}else r.visible&&i.push(t,e,r,n,zz.z,null)}if(!0===t.isBundleGroup&&void 0!==this.backend.beginBundle){const n=i;(i=this._renderLists.get(t,e)).begin(),n.pushBundle({bundleGroup:t,camera:e,renderList:i}),i.finish()}const r=t.children;for(let t=0,s=r.length;t<s;t++)this._projectObject(r[t],e,n,i)}_renderBundles(t,e,n){for(const i of t)this._renderBundle(i,e,n)}_renderObjects(t,e,n,i){for(let r=0,s=t.length;r<s;r++){const s=t[r],{object:a,geometry:o,material:l,group:u}=s;if(e.isArrayCamera){const t=e.cameras;for(let e=0,r=t.length;e<r;e++){const r=t[e];if(a.layers.test(r.layers)){const t=r.viewport,e=void 0===t.minDepth?0:t.minDepth,s=void 0===t.maxDepth?1:t.maxDepth,h=this._currentRenderContext.viewportValue;h.copy(t).multiplyScalar(this._pixelRatio).floor(),h.minDepth=e,h.maxDepth=s,this.backend.updateViewport(this._currentRenderContext),this._currentRenderObjectFunction(a,n,r,o,l,u,i)}}}else this._currentRenderObjectFunction(a,n,e,o,l,u,i)}}renderObject(t,e,n,i,r,s,a){let o,l,u;if(t.onBeforeRender(this,e,n,i,r,s),null!==e.overrideMaterial){const t=e.overrideMaterial;r.positionNode&&r.positionNode.isNode&&(o=t.positionNode,t.positionNode=r.positionNode),t.isShadowNodeMaterial&&(t.side=null===r.shadowSide?r.side:r.shadowSide,r.depthNode&&r.depthNode.isNode&&(u=t.depthNode,t.depthNode=r.depthNode),r.shadowNode&&r.shadowNode.isNode&&(l=t.fragmentNode,t.fragmentNode=r.shadowNode),this.localClippingEnabled&&(r.clipShadows?(t.clippingPlanes!==r.clippingPlanes&&(t.clippingPlanes=r.clippingPlanes,t.needsUpdate=!0),t.clipIntersection!==r.clipIntersection&&(t.clipIntersection=r.clipIntersection)):Array.isArray(t.clippingPlanes)&&(t.clippingPlanes=null,t.needsUpdate=!0))),r=t}!0===r.transparent&&2===r.side&&!1===r.forceSinglePass?(r.side=1,this._handleObjectFunction(t,r,e,n,a,s,"backSide"),r.side=0,this._handleObjectFunction(t,r,e,n,a,s),r.side=2):this._handleObjectFunction(t,r,e,n,a,s),void 0!==o&&(e.overrideMaterial.positionNode=o),void 0!==u&&(e.overrideMaterial.depthNode=u),void 0!==l&&(e.overrideMaterial.fragmentNode=l),t.onAfterRender(this,e,n,i,r,s)}_renderObjectDirect(t,e,n,i,r,s,a){const o=this._objects.get(t,e,n,i,r,this._currentRenderContext,a);o.drawRange=t.geometry.drawRange,o.group=s;const l=this._nodes.needsRefresh(o);if(l&&(this._nodes.updateBefore(o),this._geometries.updateForRender(o),this._nodes.updateForRender(o),this._bindings.updateForRender(o)),this._pipelines.updateForRender(o),null!==this._currentRenderBundle){this.backend.get(this._currentRenderBundle).renderObjects.push(o),o.bundle=this._currentRenderBundle.scene}this.backend.draw(o,this.info),l&&this._nodes.updateAfter(o)}_createObjectPipeline(t,e,n,i,r,s){const a=this._objects.get(t,e,n,i,r,this._currentRenderContext,s);this._nodes.updateBefore(a),this._geometries.updateForRender(a),this._nodes.updateForRender(a),this._bindings.updateForRender(a),this._pipelines.getForRender(a,this._compilationPromises),this._nodes.updateAfter(a)}get compute(){return this.computeAsync}get compile(){return this.compileAsync}}class Gz{constructor(t=""){this.name=t,this.visibility=0}setVisibility(t){this.visibility|=t}clone(){return Object.assign(new this.constructor,this)}}let Vz=class extends Gz{constructor(t,e=null){super(t),this.isBuffer=!0,this.bytesPerElement=Float32Array.BYTES_PER_ELEMENT,this._buffer=e}get byteLength(){return(t=this._buffer.byteLength)+(bU-t%bU)%bU;var t}get buffer(){return this._buffer}update(){return!0}};class Hz extends Vz{constructor(t,e=null){super(t,e),this.isUniformBuffer=!0}}let jz=0;class Wz extends Hz{constructor(t,e){super("UniformBuffer_"+jz++,t?t.value:null),this.nodeUniform=t,this.groupNode=e}get buffer(){return this.nodeUniform.value}}class Xz extends Hz{constructor(t){super(t),this.isUniformsGroup=!0,this._values=null,this.uniforms=[]}addUniform(t){return this.uniforms.push(t),this}removeUniform(t){const e=this.uniforms.indexOf(t);return-1!==e&&this.uniforms.splice(e,1),this}get values(){return null===this._values&&(this._values=Array.from(this.buffer)),this._values}get buffer(){let t=this._buffer;if(null===t){const e=this.byteLength;t=new Float32Array(new ArrayBuffer(e)),this._buffer=t}return t}get byteLength(){let t=0;for(let e=0,n=this.uniforms.length;e<n;e++){const n=this.uniforms[e],{boundary:i,itemSize:r}=n,s=t%bU;0!==s&&bU-s-i<0?t+=bU-s:s%i!=0&&(t+=s%i),n.offset=t/this.bytesPerElement,t+=r*this.bytesPerElement}return Math.ceil(t/bU)*bU}update(){let t=!1;for(const e of this.uniforms)!0===this.updateByType(e)&&(t=!0);return t}updateByType(t){return t.isNumberUniform?this.updateNumber(t):t.isVector2Uniform?this.updateVector2(t):t.isVector3Uniform?this.updateVector3(t):t.isVector4Uniform?this.updateVector4(t):t.isColorUniform?this.updateColor(t):t.isMatrix3Uniform?this.updateMatrix3(t):t.isMatrix4Uniform?this.updateMatrix4(t):void console.error("THREE.WebGPUUniformsGroup: Unsupported uniform type.",t)}updateNumber(t){let e=!1;const n=this.values,i=t.getValue(),r=t.offset;if(n[r]!==i){this.buffer[r]=n[r]=i,e=!0}return e}updateVector2(t){let e=!1;const n=this.values,i=t.getValue(),r=t.offset;if(n[r+0]!==i.x||n[r+1]!==i.y){const t=this.buffer;t[r+0]=n[r+0]=i.x,t[r+1]=n[r+1]=i.y,e=!0}return e}updateVector3(t){let e=!1;const n=this.values,i=t.getValue(),r=t.offset;if(n[r+0]!==i.x||n[r+1]!==i.y||n[r+2]!==i.z){const t=this.buffer;t[r+0]=n[r+0]=i.x,t[r+1]=n[r+1]=i.y,t[r+2]=n[r+2]=i.z,e=!0}return e}updateVector4(t){let e=!1;const n=this.values,i=t.getValue(),r=t.offset;if(n[r+0]!==i.x||n[r+1]!==i.y||n[r+2]!==i.z||n[r+4]!==i.w){const t=this.buffer;t[r+0]=n[r+0]=i.x,t[r+1]=n[r+1]=i.y,t[r+2]=n[r+2]=i.z,t[r+3]=n[r+3]=i.w,e=!0}return e}updateColor(t){let e=!1;const n=this.values,i=t.getValue(),r=t.offset;if(n[r+0]!==i.r||n[r+1]!==i.g||n[r+2]!==i.b){const t=this.buffer;t[r+0]=n[r+0]=i.r,t[r+1]=n[r+1]=i.g,t[r+2]=n[r+2]=i.b,e=!0}return e}updateMatrix3(t){let e=!1;const n=this.values,i=t.getValue().elements,r=t.offset;if(n[r+0]!==i[0]||n[r+1]!==i[1]||n[r+2]!==i[2]||n[r+4]!==i[3]||n[r+5]!==i[4]||n[r+6]!==i[5]||n[r+8]!==i[6]||n[r+9]!==i[7]||n[r+10]!==i[8]){const t=this.buffer;t[r+0]=n[r+0]=i[0],t[r+1]=n[r+1]=i[1],t[r+2]=n[r+2]=i[2],t[r+4]=n[r+4]=i[3],t[r+5]=n[r+5]=i[4],t[r+6]=n[r+6]=i[5],t[r+8]=n[r+8]=i[6],t[r+9]=n[r+9]=i[7],t[r+10]=n[r+10]=i[8],e=!0}return e}updateMatrix4(t){let e=!1;const n=this.values,i=t.getValue().elements,r=t.offset;if(!1===function(t,e,n){for(let i=0,r=e.length;i<r;i++)if(t[n+i]!==e[i])return!1;return!0}(n,i,r)){this.buffer.set(i,r),function(t,e,n){for(let i=0,r=e.length;i<r;i++)t[n+i]=e[i]}(n,i,r),e=!0}return e}}let Yz=0;class Qz extends Xz{constructor(t,e){super(t),this.id=Yz++,this.groupNode=e,this.isNodeUniformsGroup=!0}getNodes(){const t=[];for(const e of this.uniforms){const n=e.nodeUniform.node;if(!n)throw new Error("NodeUniformsGroup: Uniform has no node.");t.push(n)}return t}}let $z=0;class Zz extends Gz{constructor(t,e){super(t),this.id=$z++,this.texture=e,this.version=e?e.version:0,this.store=!1,this.generation=null,this.isSampledTexture=!0}needsBindingsUpdate(t){const{texture:e}=this;return t!==this.generation?(this.generation=t,!0):e.isVideoTexture}update(){const{texture:t,version:e}=this;return e!==t.version&&(this.version=t.version,!0)}}class Kz extends Zz{constructor(t,e,n,i=null){super(t,e?e.value:null),this.textureNode=e,this.groupNode=n,this.access=i}needsBindingsUpdate(t){return this.textureNode.value!==this.texture||super.needsBindingsUpdate(t)}update(){const{textureNode:t}=this;return this.texture!==t.value?(this.texture=t.value,!0):super.update()}}class Jz extends Kz{constructor(t,e,n,i){super(t,e,n,i),this.isSampledCubeTexture=!0}}class tq extends Kz{constructor(t,e,n,i){super(t,e,n,i),this.isSampledTexture3D=!0}}const eq={atan2:"atan",textureDimensions:"textureSize",equals:"equal"},nq={low:"lowp",medium:"mediump",high:"highp"},iq={swizzleAssign:!0,storageBuffer:!1},rq="\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\nprecision highp sampler3D;\nprecision highp samplerCube;\nprecision highp sampler2DArray;\n\nprecision highp usampler2D;\nprecision highp usampler3D;\nprecision highp usamplerCube;\nprecision highp usampler2DArray;\n\nprecision highp isampler2D;\nprecision highp isampler3D;\nprecision highp isamplerCube;\nprecision highp isampler2DArray;\n\nprecision lowp sampler2DShadow;\n";class sq extends LO{constructor(t,e){super(t,e,new fz),this.uniformGroups={},this.transforms=[],this.extensions={},this.useComparisonMethod=!0}needsColorSpaceToLinearSRGB(t){return!0===t.isVideoTexture&&t.colorSpace!==gb}getMethod(t){return eq[t]||t}getOutputStructName(){return""}buildFunctionCode(t){const e=t.layout,n=this.flowShaderNode(t),i=[];for(const t of e.inputs)i.push(this.getType(t.type)+" "+t.name);return`${this.getType(e.type)} ${e.name}( ${i.join(", ")} ) {\n\n\t${n.vars}\n\n${n.code}\n\treturn ${n.result};\n\n}`}setupPBO(t){const e=t.value;if(void 0===e.pbo){const t=e.array,n=e.count*e.itemSize,{itemSize:i}=e,r=e.array.constructor.name.toLowerCase().includes("int");let s=r?Wx:jx;2===i?s=r?Yx:Xx:3===i?s=r?1032:qx:4===i&&(s=r?Qx:Gx);const a={Float32Array:Fx,Uint8Array:Dx,Uint16Array:Bx,Uint32Array:Ox,Int8Array:Ix,Int16Array:Lx,Int32Array:Ux,Uint8ClampedArray:Dx},o=Math.pow(2,Math.ceil(Math.log2(Math.sqrt(n/i))));let l=Math.ceil(n/i/o);o*l*i<n&&l++;const u=o*l*i,h=new t.constructor(u);h.set(t,0),e.array=h;const c=new Gw(e.array,o,l,s,a[e.array.constructor.name]||Fx);c.needsUpdate=!0,c.isPBOTexture=!0;const A=new lP(c,null,null);A.setPrecision("high"),e.pboNode=A,e.pbo=A.value,this.getUniformFromNode(e.pboNode,"texture",this.shaderStage,this.context.label)}}getPropertyName(t,e=this.shaderStage){return t.isNodeUniform&&!0!==t.node.isTextureNode&&!0!==t.node.isBufferNode?e.charAt(0)+"_"+t.name:super.getPropertyName(t,e)}generatePBO(t){const{node:e,indexNode:n}=t,i=e.value;if(this.renderer.backend.has(i)){this.renderer.backend.get(i).pbo=i.pbo}const r=this.getUniformFromNode(i.pboNode,"texture",this.shaderStage,this.context.label),s=this.getPropertyName(r);this.increaseUsage(n);const a=n.build(this,"uint"),o=this.getDataFromNode(t);let l=o.propertyName;if(void 0===l){const n=this.getVarFromNode(t);l=this.getPropertyName(n);const r=this.getDataFromNode(e);let u=r.propertySizeName;void 0===u&&(u=l+"Size",this.getVarFromNode(e,u,"uint"),this.addLineFlowCode(`${u} = uint( textureSize( ${s}, 0 ).x )`,t),r.propertySizeName=u);const{itemSize:h}=i,c="."+YT.join("").slice(0,h),A=`ivec2(${a} % ${u}, ${a} / ${u})`,d=this.generateTextureLoad(null,s,A,null,"0");let p="vec4";i.pbo.type===Ox?p="uvec4":i.pbo.type===Ux&&(p="ivec4"),this.addLineFlowCode(`${l} = ${p}(${d})${c}`,t),o.propertyName=l}return l}generateTextureLoad(t,e,n,i,r="0"){return i?`texelFetch( ${e}, ivec3( ${n}, ${i} ), ${r} )`:`texelFetch( ${e}, ${n}, ${r} )`}generateTexture(t,e,n,i){return t.isDepthTexture?`texture( ${e}, ${n} ).x`:(i&&(n=`vec3( ${n}, ${i} )`),`texture( ${e}, ${n} )`)}generateTextureLevel(t,e,n,i){return`textureLod( ${e}, ${n}, ${i} )`}generateTextureBias(t,e,n,i){return`texture( ${e}, ${n}, ${i} )`}generateTextureGrad(t,e,n,i){return`textureGrad( ${e}, ${n}, ${i[0]}, ${i[1]} )`}generateTextureCompare(t,e,n,i,r,s=this.shaderStage){if("fragment"===s)return`texture( ${e}, vec3( ${n}, ${i} ) )`;console.error(`WebGPURenderer: THREE.DepthTexture.compareFunction() does not support ${s} shader.`)}getVars(t){const e=[],n=this.vars[t];if(void 0!==n)for(const t of n)e.push(`${this.getVar(t.type,t.name)};`);return e.join("\n\t")}getUniforms(t){const e=this.uniforms[t],n=[],i={};for(const r of e){let e=null,s=!1;if("texture"===r.type){const t=r.node.value;let n="";!0===t.isDataTexture&&(t.type===Ox?n="u":t.type===Ux&&(n="i")),e=t.compareFunction?`sampler2DShadow ${r.name};`:!0===t.isDataArrayTexture||!0===t.isCompressedArrayTexture?`${n}sampler2DArray ${r.name};`:`${n}sampler2D ${r.name};`}else if("cubeTexture"===r.type)e=`samplerCube ${r.name};`;else if("texture3D"===r.type)e=`sampler3D ${r.name};`;else if("buffer"===r.type){const t=r.node,n=this.getType(t.bufferType),i=t.bufferCount,s=i>0?i:"";e=`${t.name} {\n\t${n} ${r.name}[${s}];\n};\n`}else{e=`${this.getVectorType(r.type)} ${this.getPropertyName(r,t)};`,s=!0}const a=r.node.precision;if(null!==a&&(e=nq[a]+" "+e),s){e="\t"+e;const t=r.groupNode.name;(i[t]||(i[t]=[])).push(e)}else e="uniform "+e,n.push(e)}let r="";for(const e in i){const n=i[e];r+=this._getGLSLUniformStruct(t+"_"+e,n.join("\n"))+"\n"}return r+=n.join("\n"),r}getTypeFromAttribute(t){let e=super.getTypeFromAttribute(t);if(/^[iu]/.test(e)&&t.gpuType!==Ux){let n=t;t.isInterleavedBufferAttribute&&(n=t.data);const i=n.array;!1==(i instanceof Uint32Array||i instanceof Int32Array)&&(e=e.slice(1))}return e}getAttributes(t){let e="";if("vertex"===t||"compute"===t){const t=this.getAttributesArray();let n=0;for(const i of t)e+=`layout( location = ${n++} ) in ${i.type} ${i.name};\n`}return e}getStructMembers(t){const e=[],n=t.getMemberTypes();for(let t=0;t<n.length;t++){const i=n[t];e.push(`layout( location = ${t} ) out ${i} m${t};`)}return e.join("\n")}getStructs(t){const e=[],n=this.structs[t];if(0===n.length)return"layout( location = 0 ) out vec4 fragColor;\n";for(let t=0,i=n.length;t<i;t++){const i=n[t];let r="\n";r+=this.getStructMembers(i),r+="\n",e.push(r)}return e.join("\n\n")}getVaryings(t){let e="";const n=this.varyings;if("vertex"===t||"compute"===t)for(const i of n){"compute"===t&&(i.needsInterpolation=!0);const n=i.type;e+=`${n.includes("int")||n.includes("uv")||n.includes("iv")?"flat ":""}${i.needsInterpolation?"out":"/*out*/"} ${n} ${i.name};\n`}else if("fragment"===t)for(const t of n)if(t.needsInterpolation){const n=t.type;e+=`${n.includes("int")||n.includes("uv")||n.includes("iv")?"flat ":""}in ${n} ${t.name};\n`}return e}getVertexIndex(){return"uint( gl_VertexID )"}getInstanceIndex(){return"uint( gl_InstanceID )"}getInvocationLocalIndex(){return`uint( gl_InstanceID ) % ${this.object.workgroupSize.reduce(((t,e)=>t*e),1)}u`}getDrawIndex(){return this.renderer.backend.extensions.has("WEBGL_multi_draw")?"uint( gl_DrawID )":null}getFrontFacing(){return"gl_FrontFacing"}getFragCoord(){return"gl_FragCoord.xy"}getFragDepth(){return"gl_FragDepth"}enableExtension(t,e,n=this.shaderStage){const i=this.extensions[n]||(this.extensions[n]=new Map);!1===i.has(t)&&i.set(t,{name:t,behavior:e})}getExtensions(t){const e=[];if("vertex"===t){const e=this.renderer.backend.extensions;this.object.isBatchedMesh&&e.has("WEBGL_multi_draw")&&this.enableExtension("GL_ANGLE_multi_draw","require",t)}const n=this.extensions[t];if(void 0!==n)for(const{name:t,behavior:i}of n.values())e.push(`#extension ${t} : ${i}`);return e.join("\n")}isAvailable(t){let e=iq[t];if(void 0===e){if("float32Filterable"===t){const t=this.renderer.backend.extensions;t.has("OES_texture_float_linear")?(t.get("OES_texture_float_linear"),e=!0):e=!1}iq[t]=e}return e}isFlipY(){return!0}registerTransform(t,e){this.transforms.push({varyingName:t,attributeNode:e})}getTransforms(){const t=this.transforms;let e="";for(let n=0;n<t.length;n++){const i=t[n],r=this.getPropertyName(i.attributeNode);e+=`${i.varyingName} = ${r};\n\t`}return e}_getGLSLUniformStruct(t,e){return`\nlayout( std140 ) uniform ${t} {\n${e}\n};`}_getGLSLVertexCode(t){return`#version 300 es\n\n${this.getSignature()}\n\n// extensions \n${t.extensions}\n\n// precision\n${rq}\n\n// uniforms\n${t.uniforms}\n\n// varyings\n${t.varyings}\n\n// attributes\n${t.attributes}\n\n// codes\n${t.codes}\n\nvoid main() {\n\n\t// vars\n\t${t.vars}\n\n\t// transforms\n\t${t.transforms}\n\n\t// flow\n\t${t.flow}\n\n\tgl_PointSize = 1.0;\n\n}\n`}_getGLSLFragmentCode(t){return`#version 300 es\n\n${this.getSignature()}\n\n// precision\n${rq}\n\n// uniforms\n${t.uniforms}\n\n// varyings\n${t.varyings}\n\n// codes\n${t.codes}\n\n${t.structs}\n\nvoid main() {\n\n\t// vars\n\t${t.vars}\n\n\t// flow\n\t${t.flow}\n\n}\n`}buildCode(){const t=null!==this.material?{fragment:{},vertex:{}}:{compute:{}};this.sortBindingGroups();for(const e in t){let n="// code\n\n";n+=this.flowCode[e];const i=this.flowNodes[e],r=i[i.length-1];for(const t of i){const i=this.getFlowData(t),s=t.name;s&&(n.length>0&&(n+="\n"),n+=`\t// flow -> ${s}\n\t`),n+=`${i.code}\n\t`,t===r&&"compute"!==e&&(n+="// result\n\t","vertex"===e?(n+="gl_Position = ",n+=`${i.result};`):"fragment"===e&&(t.outputNode.isOutputStructNode||(n+="fragColor = ",n+=`${i.result};`)))}const s=t[e];s.extensions=this.getExtensions(e),s.uniforms=this.getUniforms(e),s.attributes=this.getAttributes(e),s.varyings=this.getVaryings(e),s.vars=this.getVars(e),s.structs=this.getStructs(e),s.codes=this.getCodes(e),s.transforms=this.getTransforms(e),s.flow=n}null!==this.material?(this.vertexShader=this._getGLSLVertexCode(t.vertex),this.fragmentShader=this._getGLSLFragmentCode(t.fragment)):this.computeShader=this._getGLSLVertexCode(t.compute)}getUniformFromNode(t,e,n,i=null){const r=super.getUniformFromNode(t,e,n,i),s=this.getDataFromNode(t,n,this.globalCache);let a=s.uniformGPU;if(void 0===a){const i=t.groupNode,o=i.name,l=this.getBindGroupArray(o,n);if("texture"===e)a=new Kz(r.name,r.node,i),l.push(a);else if("cubeTexture"===e)a=new Jz(r.name,r.node,i),l.push(a);else if("texture3D"===e)a=new tq(r.name,r.node,i),l.push(a);else if("buffer"===e){t.name=`NodeBuffer_${t.id}`,r.name=`buffer${t.id}`;const e=new Wz(t,i);e.name=t.name,l.push(e),a=e}else{const t=this.uniformGroups[n]||(this.uniformGroups[n]={});let s=t[o];void 0===s&&(s=new Qz(n+"_"+o,i),t[o]=s,l.push(s)),a=this.getNodeUniform(r,e),s.addUniform(a)}s.uniformGPU=a}return r}}let aq=null,oq=null,lq=null;class uq{constructor(t={}){this.parameters=Object.assign({},t),this.data=new WeakMap,this.renderer=null,this.domElement=null}async init(t){this.renderer=t}begin(){}finish(){}draw(){}createProgram(){}destroyProgram(){}createBindings(){}updateBindings(){}createRenderPipeline(){}createComputePipeline(){}destroyPipeline(){}needsRenderUpdate(){}getRenderCacheKey(){}createNodeBuilder(){}createSampler(){}createDefaultTexture(){}createTexture(){}copyTextureToBuffer(){}createAttribute(){}createIndexAttribute(){}updateAttribute(){}destroyAttribute(){}getContext(){}updateSize(){}resolveTimestampAsync(){}hasFeatureAsync(){}hasFeature(){}getInstanceCount(t){const{object:e,geometry:n}=t;return n.isInstancedBufferGeometry?n.instanceCount:e.count>1?e.count:1}getDrawingBufferSize(){return aq=aq||new $b,this.renderer.getDrawingBufferSize(aq)}getScissor(){return oq=oq||new fS,this.renderer.getScissor(oq)}setScissorTest(){}getClearColor(){const t=this.renderer;return lq=lq||new Tz,t.getClearColor(lq),lq.getRGB(lq,this.renderer.currentColorSpace),lq}getDomElement(){let t=this.domElement;return null===t&&(t=void 0!==this.parameters.canvas?this.parameters.canvas:function(){const t=Jb("canvas");return t.style.display="block",t}(),"setAttribute"in t&&t.setAttribute("data-engine",`three.js r${rx} webgpu`),this.domElement=t),t}set(t,e){this.data.set(t,e)}get(t){let e=this.data.get(t);return void 0===e&&(e={},this.data.set(t,e)),e}has(t){return this.data.has(t)}delete(t){this.data.delete(t)}}let hq=0;class cq{constructor(t,e){this.buffers=[t.bufferGPU,e],this.type=t.type,this.bufferType=t.bufferType,this.pbo=t.pbo,this.byteLength=t.byteLength,this.bytesPerElement=t.BYTES_PER_ELEMENT,this.version=t.version,this.isInteger=t.isInteger,this.activeBufferIndex=0,this.baseId=t.id}get id(){return`${this.baseId}|${this.activeBufferIndex}`}get bufferGPU(){return this.buffers[this.activeBufferIndex]}get transformBuffer(){return this.buffers[1^this.activeBufferIndex]}switchBuffers(){this.activeBufferIndex^=1}}class Aq{constructor(t){this.backend=t}createAttribute(t,e){const n=this.backend,{gl:i}=n,r=t.array,s=t.usage||i.STATIC_DRAW,a=t.isInterleavedBufferAttribute?t.data:t,o=n.get(a);let l,u=o.bufferGPU;if(void 0===u&&(u=this._createBuffer(i,e,r,s),o.bufferGPU=u,o.bufferType=e,o.version=a.version),r instanceof Float32Array)l=i.FLOAT;else if(r instanceof Uint16Array)l=t.isFloat16BufferAttribute?i.HALF_FLOAT:i.UNSIGNED_SHORT;else if(r instanceof Int16Array)l=i.SHORT;else if(r instanceof Uint32Array)l=i.UNSIGNED_INT;else if(r instanceof Int32Array)l=i.INT;else if(r instanceof Int8Array)l=i.BYTE;else if(r instanceof Uint8Array)l=i.UNSIGNED_BYTE;else{if(!(r instanceof Uint8ClampedArray))throw new Error("THREE.WebGLBackend: Unsupported buffer data format: "+r);l=i.UNSIGNED_BYTE}let h={bufferGPU:u,bufferType:e,type:l,byteLength:r.byteLength,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version,pbo:t.pbo,isInteger:l===i.INT||l===i.UNSIGNED_INT||t.gpuType===Ux,id:hq++};if(t.isStorageBufferAttribute||t.isStorageInstancedBufferAttribute){const t=this._createBuffer(i,e,r,s);h=new cq(h,t)}n.set(t,h)}updateAttribute(t){const e=this.backend,{gl:n}=e,i=t.array,r=t.isInterleavedBufferAttribute?t.data:t,s=e.get(r),a=s.bufferType,o=t.isInterleavedBufferAttribute?t.data.updateRanges:t.updateRanges;if(n.bindBuffer(a,s.bufferGPU),0===o.length)n.bufferSubData(a,0,i);else{for(let t=0,e=o.length;t<e;t++){const e=o[t];n.bufferSubData(a,e.start*i.BYTES_PER_ELEMENT,i,e.start,e.count)}r.clearUpdateRanges()}n.bindBuffer(a,null),s.version=r.version}destroyAttribute(t){const e=this.backend,{gl:n}=e;t.isInterleavedBufferAttribute&&e.delete(t.data);const i=e.get(t);n.deleteBuffer(i.bufferGPU),e.delete(t)}async getArrayBufferAsync(t){const e=this.backend,{gl:n}=e,i=t.isInterleavedBufferAttribute?t.data:t,{bufferGPU:r}=e.get(i),s=t.array,a=s.byteLength;n.bindBuffer(n.COPY_READ_BUFFER,r);const o=n.createBuffer();n.bindBuffer(n.COPY_WRITE_BUFFER,o),n.bufferData(n.COPY_WRITE_BUFFER,a,n.STREAM_READ),n.copyBufferSubData(n.COPY_READ_BUFFER,n.COPY_WRITE_BUFFER,0,0,a),await e.utils._clientWaitAsync();const l=new t.array.constructor(s.length);return n.bindBuffer(n.COPY_WRITE_BUFFER,o),n.getBufferSubData(n.COPY_WRITE_BUFFER,0,l),n.deleteBuffer(o),n.bindBuffer(n.COPY_READ_BUFFER,null),n.bindBuffer(n.COPY_WRITE_BUFFER,null),l.buffer}_createBuffer(t,e,n,i){const r=t.createBuffer();return t.bindBuffer(e,r),t.bufferData(e,n,i),t.bindBuffer(e,null),r}}let dq,pq,fq=!1;class mq{constructor(t){this.backend=t,this.gl=this.backend.gl,this.enabled={},this.currentFlipSided=null,this.currentCullFace=null,this.currentProgram=null,this.currentBlendingEnabled=!1,this.currentBlending=null,this.currentBlendSrc=null,this.currentBlendDst=null,this.currentBlendSrcAlpha=null,this.currentBlendDstAlpha=null,this.currentPremultipledAlpha=null,this.currentPolygonOffsetFactor=null,this.currentPolygonOffsetUnits=null,this.currentColorMask=null,this.currentDepthFunc=null,this.currentDepthMask=null,this.currentStencilFunc=null,this.currentStencilRef=null,this.currentStencilFuncMask=null,this.currentStencilFail=null,this.currentStencilZFail=null,this.currentStencilZPass=null,this.currentStencilMask=null,this.currentLineWidth=null,this.currentBoundFramebuffers={},this.currentDrawbuffers=new WeakMap,this.maxTextures=this.gl.getParameter(this.gl.MAX_TEXTURE_IMAGE_UNITS),this.currentTextureSlot=null,this.currentBoundTextures={},this.currentBoundBufferBases={},!1===fq&&(this._init(this.gl),fq=!0)}_init(t){dq={[sx]:t.FUNC_ADD,[ax]:t.FUNC_SUBTRACT,[ox]:t.FUNC_REVERSE_SUBTRACT},pq={[lx]:t.ZERO,[ux]:t.ONE,[hx]:t.SRC_COLOR,[Ax]:t.SRC_ALPHA,[yx]:t.SRC_ALPHA_SATURATE,[mx]:t.DST_COLOR,[px]:t.DST_ALPHA,[cx]:t.ONE_MINUS_SRC_COLOR,[dx]:t.ONE_MINUS_SRC_ALPHA,[gx]:t.ONE_MINUS_DST_COLOR,[fx]:t.ONE_MINUS_DST_ALPHA}}enable(t){const{enabled:e}=this;!0!==e[t]&&(this.gl.enable(t),e[t]=!0)}disable(t){const{enabled:e}=this;!1!==e[t]&&(this.gl.disable(t),e[t]=!1)}setFlipSided(t){if(this.currentFlipSided!==t){const{gl:e}=this;t?e.frontFace(e.CW):e.frontFace(e.CCW),this.currentFlipSided=t}}setCullFace(t){const{gl:e}=this;0!==t?(this.enable(e.CULL_FACE),t!==this.currentCullFace&&(1===t?e.cullFace(e.BACK):2===t?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):this.disable(e.CULL_FACE),this.currentCullFace=t}setLineWidth(t){const{currentLineWidth:e,gl:n}=this;t!==e&&(n.lineWidth(t),this.currentLineWidth=t)}setBlending(t,e,n,i,r,s,a,o){const{gl:l}=this;if(0!==t){if(!1===this.currentBlendingEnabled&&(this.enable(l.BLEND),this.currentBlendingEnabled=!0),5===t)r=r||e,s=s||n,a=a||i,e===this.currentBlendEquation&&r===this.currentBlendEquationAlpha||(l.blendEquationSeparate(dq[e],dq[r]),this.currentBlendEquation=e,this.currentBlendEquationAlpha=r),n===this.currentBlendSrc&&i===this.currentBlendDst&&s===this.currentBlendSrcAlpha&&a===this.currentBlendDstAlpha||(l.blendFuncSeparate(pq[n],pq[i],pq[s],pq[a]),this.currentBlendSrc=n,this.currentBlendDst=i,this.currentBlendSrcAlpha=s,this.currentBlendDstAlpha=a),this.currentBlending=t,this.currentPremultipledAlpha=!1;else if(t!==this.currentBlending||o!==this.currentPremultipledAlpha){if(this.currentBlendEquation===sx&&this.currentBlendEquationAlpha===sx||(l.blendEquation(l.FUNC_ADD),this.currentBlendEquation=sx,this.currentBlendEquationAlpha=sx),o)switch(t){case 1:l.blendFuncSeparate(l.ONE,l.ONE_MINUS_SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA);break;case 2:l.blendFunc(l.ONE,l.ONE);break;case 3:l.blendFuncSeparate(l.ZERO,l.ONE_MINUS_SRC_COLOR,l.ZERO,l.ONE);break;case 4:l.blendFuncSeparate(l.ZERO,l.SRC_COLOR,l.ZERO,l.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case 1:l.blendFuncSeparate(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA);break;case 2:l.blendFunc(l.SRC_ALPHA,l.ONE);break;case 3:l.blendFuncSeparate(l.ZERO,l.ONE_MINUS_SRC_COLOR,l.ZERO,l.ONE);break;case 4:l.blendFunc(l.ZERO,l.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}this.currentBlendSrc=null,this.currentBlendDst=null,this.currentBlendSrcAlpha=null,this.currentBlendDstAlpha=null,this.currentBlending=t,this.currentPremultipledAlpha=o}}else!0===this.currentBlendingEnabled&&(this.disable(l.BLEND),this.currentBlendingEnabled=!1)}setColorMask(t){this.currentColorMask!==t&&(this.gl.colorMask(t,t,t,t),this.currentColorMask=t)}setDepthTest(t){const{gl:e}=this;t?this.enable(e.DEPTH_TEST):this.disable(e.DEPTH_TEST)}setDepthMask(t){this.currentDepthMask!==t&&(this.gl.depthMask(t),this.currentDepthMask=t)}setDepthFunc(t){if(this.currentDepthFunc!==t){const{gl:e}=this;switch(t){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:default:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL)}this.currentDepthFunc=t}}setStencilTest(t){const{gl:e}=this;t?this.enable(e.STENCIL_TEST):this.disable(e.STENCIL_TEST)}setStencilMask(t){this.currentStencilMask!==t&&(this.gl.stencilMask(t),this.currentStencilMask=t)}setStencilFunc(t,e,n){this.currentStencilFunc===t&&this.currentStencilRef===e&&this.currentStencilFuncMask===n||(this.gl.stencilFunc(t,e,n),this.currentStencilFunc=t,this.currentStencilRef=e,this.currentStencilFuncMask=n)}setStencilOp(t,e,n){this.currentStencilFail===t&&this.currentStencilZFail===e&&this.currentStencilZPass===n||(this.gl.stencilOp(t,e,n),this.currentStencilFail=t,this.currentStencilZFail=e,this.currentStencilZPass=n)}setMaterial(t,e){const{gl:n}=this;2===t.side?this.disable(n.CULL_FACE):this.enable(n.CULL_FACE);let i=1===t.side;e&&(i=!i),this.setFlipSided(i),1===t.blending&&!1===t.transparent?this.setBlending(0):this.setBlending(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),this.setDepthFunc(t.depthFunc),this.setDepthTest(t.depthTest),this.setDepthMask(t.depthWrite),this.setColorMask(t.colorWrite);const r=t.stencilWrite;this.setStencilTest(r),r&&(this.setStencilMask(t.stencilWriteMask),this.setStencilFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),this.setStencilOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),this.setPolygonOffset(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),!0===t.alphaToCoverage&&this.backend.renderer.samples>1?this.enable(n.SAMPLE_ALPHA_TO_COVERAGE):this.disable(n.SAMPLE_ALPHA_TO_COVERAGE)}setPolygonOffset(t,e,n){const{gl:i}=this;t?(this.enable(i.POLYGON_OFFSET_FILL),this.currentPolygonOffsetFactor===e&&this.currentPolygonOffsetUnits===n||(i.polygonOffset(e,n),this.currentPolygonOffsetFactor=e,this.currentPolygonOffsetUnits=n)):this.disable(i.POLYGON_OFFSET_FILL)}useProgram(t){return this.currentProgram!==t&&(this.gl.useProgram(t),this.currentProgram=t,!0)}bindFramebuffer(t,e){const{gl:n,currentBoundFramebuffers:i}=this;return i[t]!==e&&(n.bindFramebuffer(t,e),i[t]=e,t===n.DRAW_FRAMEBUFFER&&(i[n.FRAMEBUFFER]=e),t===n.FRAMEBUFFER&&(i[n.DRAW_FRAMEBUFFER]=e),!0)}drawBuffers(t,e){const{gl:n}=this;let i=[],r=!1;if(null!==t.textures){i=this.currentDrawbuffers.get(e),void 0===i&&(i=[],this.currentDrawbuffers.set(e,i));const s=t.textures;if(i.length!==s.length||i[0]!==n.COLOR_ATTACHMENT0){for(let t=0,e=s.length;t<e;t++)i[t]=n.COLOR_ATTACHMENT0+t;i.length=s.length,r=!0}}else i[0]!==n.BACK&&(i[0]=n.BACK,r=!0);r&&n.drawBuffers(i)}activeTexture(t){const{gl:e,currentTextureSlot:n,maxTextures:i}=this;void 0===t&&(t=e.TEXTURE0+i-1),n!==t&&(e.activeTexture(t),this.currentTextureSlot=t)}bindTexture(t,e,n){const{gl:i,currentTextureSlot:r,currentBoundTextures:s,maxTextures:a}=this;void 0===n&&(n=null===r?i.TEXTURE0+a-1:r);let o=s[n];void 0===o&&(o={type:void 0,texture:void 0},s[n]=o),o.type===t&&o.texture===e||(r!==n&&(i.activeTexture(n),this.currentTextureSlot=n),i.bindTexture(t,e),o.type=t,o.texture=e)}bindBufferBase(t,e,n){const{gl:i}=this,r=`${t}-${e}`;return this.currentBoundBufferBases[r]!==n&&(i.bindBufferBase(t,e,n),this.currentBoundBufferBases[r]=n,!0)}unbindTexture(){const{gl:t,currentTextureSlot:e,currentBoundTextures:n}=this,i=n[e];void 0!==i&&void 0!==i.type&&(t.bindTexture(i.type,null),i.type=void 0,i.texture=void 0)}}class gq{constructor(t){this.backend=t,this.gl=this.backend.gl,this.extensions=t.extensions}convert(t,e=""){const{gl:n,extensions:i}=this;let r;if(t===Dx)return n.UNSIGNED_BYTE;if(1017===t)return n.UNSIGNED_SHORT_4_4_4_4;if(1018===t)return n.UNSIGNED_SHORT_5_5_5_1;if(35902===t)return n.UNSIGNED_INT_5_9_9_9_REV;if(t===Ix)return n.BYTE;if(t===Lx)return n.SHORT;if(t===Bx)return n.UNSIGNED_SHORT;if(t===Ux)return n.INT;if(t===Ox)return n.UNSIGNED_INT;if(t===Fx)return n.FLOAT;if(t===kx)return n.HALF_FLOAT;if(1021===t)return n.ALPHA;if(t===qx)return n.RGB;if(t===Gx)return n.RGBA;if(1024===t)return n.LUMINANCE;if(1025===t)return n.LUMINANCE_ALPHA;if(t===Vx)return n.DEPTH_COMPONENT;if(t===Hx)return n.DEPTH_STENCIL;if(t===jx)return n.RED;if(t===Wx)return n.RED_INTEGER;if(t===Xx)return n.RG;if(t===Yx)return n.RG_INTEGER;if(t===Qx)return n.RGBA_INTEGER;if(t===$x||t===Zx||t===Kx||t===Jx)if(e===yb){if(r=i.get("WEBGL_compressed_texture_s3tc_srgb"),null===r)return null;if(t===$x)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(t===Zx)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(t===Kx)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(t===Jx)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(r=i.get("WEBGL_compressed_texture_s3tc"),null===r)return null;if(t===$x)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===Zx)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===Kx)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===Jx)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===t||35841===t||35842===t||35843===t){if(r=i.get("WEBGL_compressed_texture_pvrtc"),null===r)return null;if(35840===t)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===t)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===t)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===t)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===t||t===tb||t===eb){if(r=i.get("WEBGL_compressed_texture_etc"),null===r)return null;if(36196===t||t===tb)return e===yb?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(t===eb)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}if(t===nb||t===ib||t===rb||t===sb||t===ab||t===ob||t===lb||t===ub||t===hb||t===cb||t===Ab||t===db||t===pb||t===fb){if(r=i.get("WEBGL_compressed_texture_astc"),null===r)return null;if(t===nb)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(t===ib)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(t===rb)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(t===sb)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(t===ab)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(t===ob)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(t===lb)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(t===ub)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(t===hb)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(t===cb)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(t===Ab)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(t===db)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(t===pb)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(t===fb)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}if(t===mb){if(r=i.get("EXT_texture_compression_bptc"),null===r)return null;if(t===mb)return e===yb?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT}if(36283===t||36284===t||36285===t||36286===t){if(r=i.get("EXT_texture_compression_rgtc"),null===r)return null;if(t===mb)return r.COMPRESSED_RED_RGTC1_EXT;if(36284===t)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(36285===t)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(36286===t)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return t===zx?n.UNSIGNED_INT_24_8:void 0!==n[t]?n[t]:null}_clientWaitAsync(){const{gl:t}=this,e=t.fenceSync(t.SYNC_GPU_COMMANDS_COMPLETE,0);return t.flush(),new Promise(((n,i)=>{!function r(){const s=t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0);if(s===t.WAIT_FAILED)return t.deleteSync(e),void i();s!==t.TIMEOUT_EXPIRED?(t.deleteSync(e),n()):requestAnimationFrame(r)}()}))}}let yq,vq,_q,xq=!1;class bq{constructor(t){this.backend=t,this.gl=t.gl,this.extensions=t.extensions,this.defaultTextures={},!1===xq&&(this._init(this.gl),xq=!0)}_init(t){yq={[Sx]:t.REPEAT,[Mx]:t.CLAMP_TO_EDGE,[wx]:t.MIRRORED_REPEAT},vq={[Tx]:t.NEAREST,[Ex]:t.NEAREST_MIPMAP_NEAREST,[Cx]:t.NEAREST_MIPMAP_LINEAR,[Rx]:t.LINEAR,[Nx]:t.LINEAR_MIPMAP_NEAREST,[Px]:t.LINEAR_MIPMAP_LINEAR},_q={[Tb]:t.NEVER,[Ib]:t.ALWAYS,[Eb]:t.LESS,[Rb]:t.LEQUAL,[Cb]:t.EQUAL,[Db]:t.GEQUAL,[Nb]:t.GREATER,[Pb]:t.NOTEQUAL}}filterFallback(t){const{gl:e}=this;return t===Tx||t===Ex||t===Cx?e.NEAREST:e.LINEAR}getGLTextureType(t){const{gl:e}=this;let n;return n=!0===t.isCubeTexture?e.TEXTURE_CUBE_MAP:!0===t.isDataArrayTexture||!0===t.isCompressedArrayTexture?e.TEXTURE_2D_ARRAY:!0===t.isData3DTexture?e.TEXTURE_3D:e.TEXTURE_2D,n}getInternalFormat(t,e,n,i,r=!1){const{gl:s,extensions:a}=this;if(null!==t){if(void 0!==s[t])return s[t];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+t+"'")}let o=e;return e===s.RED&&(n===s.FLOAT&&(o=s.R32F),n===s.HALF_FLOAT&&(o=s.R16F),n===s.UNSIGNED_BYTE&&(o=s.R8),n===s.UNSIGNED_SHORT&&(o=s.R16),n===s.UNSIGNED_INT&&(o=s.R32UI),n===s.BYTE&&(o=s.R8I),n===s.SHORT&&(o=s.R16I),n===s.INT&&(o=s.R32I)),e===s.RED_INTEGER&&(n===s.UNSIGNED_BYTE&&(o=s.R8UI),n===s.UNSIGNED_SHORT&&(o=s.R16UI),n===s.UNSIGNED_INT&&(o=s.R32UI),n===s.BYTE&&(o=s.R8I),n===s.SHORT&&(o=s.R16I),n===s.INT&&(o=s.R32I)),e===s.RG&&(n===s.FLOAT&&(o=s.RG32F),n===s.HALF_FLOAT&&(o=s.RG16F),n===s.UNSIGNED_BYTE&&(o=s.RG8),n===s.UNSIGNED_SHORT&&(o=s.RG16),n===s.UNSIGNED_INT&&(o=s.RG32UI),n===s.BYTE&&(o=s.RG8I),n===s.SHORT&&(o=s.RG16I),n===s.INT&&(o=s.RG32I)),e===s.RG_INTEGER&&(n===s.UNSIGNED_BYTE&&(o=s.RG8UI),n===s.UNSIGNED_SHORT&&(o=s.RG16UI),n===s.UNSIGNED_INT&&(o=s.RG32UI),n===s.BYTE&&(o=s.RG8I),n===s.SHORT&&(o=s.RG16I),n===s.INT&&(o=s.RG32I)),e===s.RGB&&(n===s.FLOAT&&(o=s.RGB32F),n===s.HALF_FLOAT&&(o=s.RGB16F),n===s.UNSIGNED_BYTE&&(o=s.RGB8),n===s.UNSIGNED_SHORT&&(o=s.RGB16),n===s.UNSIGNED_INT&&(o=s.RGB32UI),n===s.BYTE&&(o=s.RGB8I),n===s.SHORT&&(o=s.RGB16I),n===s.INT&&(o=s.RGB32I),n===s.UNSIGNED_BYTE&&(o=i===yb&&!1===r?s.SRGB8:s.RGB8),n===s.UNSIGNED_SHORT_5_6_5&&(o=s.RGB565),n===s.UNSIGNED_SHORT_5_5_5_1&&(o=s.RGB5_A1),n===s.UNSIGNED_SHORT_4_4_4_4&&(o=s.RGB4),n===s.UNSIGNED_INT_5_9_9_9_REV&&(o=s.RGB9_E5)),e===s.RGB_INTEGER&&(n===s.UNSIGNED_BYTE&&(o=s.RGB8UI),n===s.UNSIGNED_SHORT&&(o=s.RGB16UI),n===s.UNSIGNED_INT&&(o=s.RGB32UI),n===s.BYTE&&(o=s.RGB8I),n===s.SHORT&&(o=s.RGB16I),n===s.INT&&(o=s.RGB32I)),e===s.RGBA&&(n===s.FLOAT&&(o=s.RGBA32F),n===s.HALF_FLOAT&&(o=s.RGBA16F),n===s.UNSIGNED_BYTE&&(o=s.RGBA8),n===s.UNSIGNED_SHORT&&(o=s.RGBA16),n===s.UNSIGNED_INT&&(o=s.RGBA32UI),n===s.BYTE&&(o=s.RGBA8I),n===s.SHORT&&(o=s.RGBA16I),n===s.INT&&(o=s.RGBA32I),n===s.UNSIGNED_BYTE&&(o=i===yb&&!1===r?s.SRGB8_ALPHA8:s.RGBA8),n===s.UNSIGNED_SHORT_4_4_4_4&&(o=s.RGBA4),n===s.UNSIGNED_SHORT_5_5_5_1&&(o=s.RGB5_A1)),e===s.RGBA_INTEGER&&(n===s.UNSIGNED_BYTE&&(o=s.RGBA8UI),n===s.UNSIGNED_SHORT&&(o=s.RGBA16UI),n===s.UNSIGNED_INT&&(o=s.RGBA32UI),n===s.BYTE&&(o=s.RGBA8I),n===s.SHORT&&(o=s.RGBA16I),n===s.INT&&(o=s.RGBA32I)),e===s.DEPTH_COMPONENT&&(n===s.UNSIGNED_INT&&(o=s.DEPTH24_STENCIL8),n===s.FLOAT&&(o=s.DEPTH_COMPONENT32F)),e===s.DEPTH_STENCIL&&n===s.UNSIGNED_INT_24_8&&(o=s.DEPTH24_STENCIL8),o!==s.R16F&&o!==s.R32F&&o!==s.RG16F&&o!==s.RG32F&&o!==s.RGBA16F&&o!==s.RGBA32F||a.get("EXT_color_buffer_float"),o}setTextureParameters(t,e){const{gl:n,extensions:i,backend:r}=this;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,e.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,e.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE),n.texParameteri(t,n.TEXTURE_WRAP_S,yq[e.wrapS]),n.texParameteri(t,n.TEXTURE_WRAP_T,yq[e.wrapT]),t!==n.TEXTURE_3D&&t!==n.TEXTURE_2D_ARRAY||n.texParameteri(t,n.TEXTURE_WRAP_R,yq[e.wrapR]),n.texParameteri(t,n.TEXTURE_MAG_FILTER,vq[e.magFilter]);const s=void 0!==e.mipmaps&&e.mipmaps.length>0,a=e.minFilter===Rx&&s?Px:e.minFilter;if(n.texParameteri(t,n.TEXTURE_MIN_FILTER,vq[a]),e.compareFunction&&(n.texParameteri(t,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(t,n.TEXTURE_COMPARE_FUNC,_q[e.compareFunction])),!0===i.has("EXT_texture_filter_anisotropic")){if(e.magFilter===Tx)return;if(e.minFilter!==Cx&&e.minFilter!==Px)return;if(e.type===Fx&&!1===i.has("OES_texture_float_linear"))return;if(e.anisotropy>1){const s=i.get("EXT_texture_filter_anisotropic");n.texParameterf(t,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(e.anisotropy,r.getMaxAnisotropy()))}}}createDefaultTexture(t){const{gl:e,backend:n,defaultTextures:i}=this,r=this.getGLTextureType(t);let s=i[r];void 0===s&&(s=e.createTexture(),n.state.bindTexture(r,s),e.texParameteri(r,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(r,e.TEXTURE_MAG_FILTER,e.NEAREST),i[r]=s),n.set(t,{textureGPU:s,glTextureType:r,isDefault:!0})}createTexture(t,e){const{gl:n,backend:i}=this,{levels:r,width:s,height:a,depth:o}=e,l=i.utils.convert(t.format,t.colorSpace),u=i.utils.convert(t.type),h=this.getInternalFormat(t.internalFormat,l,u,t.colorSpace,t.isVideoTexture),c=n.createTexture(),A=this.getGLTextureType(t);i.state.bindTexture(A,c),this.setTextureParameters(A,t),t.isDataArrayTexture||t.isCompressedArrayTexture?n.texStorage3D(n.TEXTURE_2D_ARRAY,r,h,s,a,o):t.isData3DTexture?n.texStorage3D(n.TEXTURE_3D,r,h,s,a,o):t.isVideoTexture||n.texStorage2D(A,r,h,s,a),i.set(t,{textureGPU:c,glTextureType:A,glFormat:l,glType:u,glInternalFormat:h})}copyBufferToTexture(t,e){const{gl:n,backend:i}=this,{textureGPU:r,glTextureType:s,glFormat:a,glType:o}=i.get(e),{width:l,height:u}=e.source.data;n.bindBuffer(n.PIXEL_UNPACK_BUFFER,t),i.state.bindTexture(s,r),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),n.texSubImage2D(s,0,0,0,l,u,a,o,0),n.bindBuffer(n.PIXEL_UNPACK_BUFFER,null),i.state.unbindTexture()}updateTexture(t,e){const{gl:n}=this,{width:i,height:r}=e,{textureGPU:s,glTextureType:a,glFormat:o,glType:l,glInternalFormat:u}=this.backend.get(t);if(t.isRenderTargetTexture||void 0===s)return;const h=t=>t.isDataTexture?t.image.data:t instanceof ImageBitmap||t instanceof OffscreenCanvas||t instanceof HTMLImageElement||t instanceof HTMLCanvasElement?t:t.data;if(this.backend.state.bindTexture(a,s),this.setTextureParameters(a,t),t.isCompressedTexture){const i=t.mipmaps,r=e.image;for(let e=0;e<i.length;e++){const s=i[e];t.isCompressedArrayTexture?t.format!==n.RGBA?null!==o?n.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,e,0,0,0,s.width,s.height,r.depth,o,s.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texSubImage3D(n.TEXTURE_2D_ARRAY,e,0,0,0,s.width,s.height,r.depth,o,l,s.data):null!==o?n.compressedTexSubImage2D(n.TEXTURE_2D,e,0,0,s.width,s.height,o,s.data):console.warn("Unsupported compressed texture format")}}else if(t.isCubeTexture){const t=e.images;for(let e=0;e<6;e++){const s=h(t[e]);n.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,i,r,o,l,s)}}else if(t.isDataArrayTexture){const t=e.image;n.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,t.width,t.height,t.depth,o,l,t.data)}else if(t.isData3DTexture){const t=e.image;n.texSubImage3D(n.TEXTURE_3D,0,0,0,0,t.width,t.height,t.depth,o,l,t.data)}else if(t.isVideoTexture)t.update(),n.texImage2D(a,0,u,o,l,e.image);else{const t=h(e.image);n.texSubImage2D(a,0,0,0,i,r,o,l,t)}}generateMipmaps(t){const{gl:e,backend:n}=this,{textureGPU:i,glTextureType:r}=n.get(t);n.state.bindTexture(r,i),e.generateMipmap(r)}deallocateRenderBuffers(t){const{gl:e,backend:n}=this;if(t){const i=n.get(t);if(i.renderBufferStorageSetup=void 0,i.framebuffers){for(const t in i.framebuffers)e.deleteFramebuffer(i.framebuffers[t]);delete i.framebuffers}if(i.depthRenderbuffer&&(e.deleteRenderbuffer(i.depthRenderbuffer),delete i.depthRenderbuffer),i.stencilRenderbuffer&&(e.deleteRenderbuffer(i.stencilRenderbuffer),delete i.stencilRenderbuffer),i.msaaFrameBuffer&&(e.deleteFramebuffer(i.msaaFrameBuffer),delete i.msaaFrameBuffer),i.msaaRenderbuffers){for(let t=0;t<i.msaaRenderbuffers.length;t++)e.deleteRenderbuffer(i.msaaRenderbuffers[t]);delete i.msaaRenderbuffers}}}destroyTexture(t){const{gl:e,backend:n}=this,{textureGPU:i,renderTarget:r}=n.get(t);this.deallocateRenderBuffers(r),e.deleteTexture(i),n.delete(t)}copyTextureToTexture(t,e,n=null,i=null,r=0){const{gl:s,backend:a}=this,{state:o}=this.backend,{textureGPU:l,glTextureType:u,glType:h,glFormat:c}=a.get(e);let A,d,p,f,m,g;null!==n?(A=n.max.x-n.min.x,d=n.max.y-n.min.y,p=n.min.x,f=n.min.y):(A=t.image.width,d=t.image.height,p=0,f=0),null!==i?(m=i.x,g=i.y):(m=0,g=0),o.bindTexture(u,l),s.pixelStorei(s.UNPACK_ALIGNMENT,e.unpackAlignment),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,e.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,e.unpackAlignment);const y=s.getParameter(s.UNPACK_ROW_LENGTH),v=s.getParameter(s.UNPACK_IMAGE_HEIGHT),_=s.getParameter(s.UNPACK_SKIP_PIXELS),x=s.getParameter(s.UNPACK_SKIP_ROWS),b=s.getParameter(s.UNPACK_SKIP_IMAGES),S=t.isCompressedTexture?t.mipmaps[r]:t.image;s.pixelStorei(s.UNPACK_ROW_LENGTH,S.width),s.pixelStorei(s.UNPACK_IMAGE_HEIGHT,S.height),s.pixelStorei(s.UNPACK_SKIP_PIXELS,p),s.pixelStorei(s.UNPACK_SKIP_ROWS,f),t.isDataTexture?s.texSubImage2D(s.TEXTURE_2D,r,m,g,A,d,c,h,S.data):t.isCompressedTexture?s.compressedTexSubImage2D(s.TEXTURE_2D,r,m,g,S.width,S.height,c,S.data):s.texSubImage2D(s.TEXTURE_2D,r,m,g,A,d,c,h,S),s.pixelStorei(s.UNPACK_ROW_LENGTH,y),s.pixelStorei(s.UNPACK_IMAGE_HEIGHT,v),s.pixelStorei(s.UNPACK_SKIP_PIXELS,_),s.pixelStorei(s.UNPACK_SKIP_ROWS,x),s.pixelStorei(s.UNPACK_SKIP_IMAGES,b),0===r&&e.generateMipmaps&&s.generateMipmap(s.TEXTURE_2D),o.unbindTexture()}copyFramebufferToTexture(t,e,n){const{gl:i}=this,{state:r}=this.backend,{textureGPU:s}=this.backend.get(t),{x:a,y:o,z:l,w:u}=n,h=!0===t.isDepthTexture||e.renderTarget&&e.renderTarget.samples>0,c=e.renderTarget?e.renderTarget.height:this.backend.gerDrawingBufferSize().y;if(h){const n=0!==a||0!==o;let h,A;if(!0===t.isDepthTexture?(h=i.DEPTH_BUFFER_BIT,A=i.DEPTH_ATTACHMENT,e.stencil&&(h|=i.STENCIL_BUFFER_BIT)):(h=i.COLOR_BUFFER_BIT,A=i.COLOR_ATTACHMENT0),n){const t=this.backend.get(e.renderTarget),n=t.framebuffers[e.getCacheKey()],A=t.msaaFrameBuffer;r.bindFramebuffer(i.DRAW_FRAMEBUFFER,n),r.bindFramebuffer(i.READ_FRAMEBUFFER,A);const d=c-o-u;i.blitFramebuffer(a,d,a+l,d+u,a,d,a+l,d+u,h,i.NEAREST),r.bindFramebuffer(i.READ_FRAMEBUFFER,n),r.bindTexture(i.TEXTURE_2D,s),i.copyTexSubImage2D(i.TEXTURE_2D,0,0,0,a,d,l,u),r.unbindTexture()}else{const t=i.createFramebuffer();r.bindFramebuffer(i.DRAW_FRAMEBUFFER,t),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,A,i.TEXTURE_2D,s,0),i.blitFramebuffer(0,0,l,u,0,0,l,u,h,i.NEAREST),i.deleteFramebuffer(t)}}else r.bindTexture(i.TEXTURE_2D,s),i.copyTexSubImage2D(i.TEXTURE_2D,0,0,0,a,c-u-o,l,u),r.unbindTexture();t.generateMipmaps&&this.generateMipmaps(t),this.backend._setFramebuffer(e)}setupRenderBufferStorage(t,e){const{gl:n}=this,i=e.renderTarget,{samples:r,depthTexture:s,depthBuffer:a,stencilBuffer:o,width:l,height:u}=i;if(n.bindRenderbuffer(n.RENDERBUFFER,t),a&&!o){let e=n.DEPTH_COMPONENT24;r>0?(s&&s.isDepthTexture&&s.type===n.FLOAT&&(e=n.DEPTH_COMPONENT32F),n.renderbufferStorageMultisample(n.RENDERBUFFER,r,e,l,u)):n.renderbufferStorage(n.RENDERBUFFER,e,l,u),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,t)}else a&&o&&(r>0?n.renderbufferStorageMultisample(n.RENDERBUFFER,r,n.DEPTH24_STENCIL8,l,u):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,l,u),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,t))}async copyTextureToBuffer(t,e,n,i,r,s){const{backend:a,gl:o}=this,{textureGPU:l,glFormat:u,glType:h}=this.backend.get(t),c=o.createFramebuffer();o.bindFramebuffer(o.READ_FRAMEBUFFER,c);const A=t.isCubeTexture?o.TEXTURE_CUBE_MAP_POSITIVE_X+s:o.TEXTURE_2D;o.framebufferTexture2D(o.READ_FRAMEBUFFER,o.COLOR_ATTACHMENT0,A,l,0);const d=this._getTypedArrayType(h),p=i*r*this._getBytesPerTexel(h,u),f=o.createBuffer();o.bindBuffer(o.PIXEL_PACK_BUFFER,f),o.bufferData(o.PIXEL_PACK_BUFFER,p,o.STREAM_READ),o.readPixels(e,n,i,r,u,h,0),o.bindBuffer(o.PIXEL_PACK_BUFFER,null),await a.utils._clientWaitAsync();const m=new d(p/d.BYTES_PER_ELEMENT);return o.bindBuffer(o.PIXEL_PACK_BUFFER,f),o.getBufferSubData(o.PIXEL_PACK_BUFFER,0,m),o.bindBuffer(o.PIXEL_PACK_BUFFER,null),o.deleteFramebuffer(c),m}_getTypedArrayType(t){const{gl:e}=this;if(t===e.UNSIGNED_BYTE)return Uint8Array;if(t===e.UNSIGNED_SHORT_4_4_4_4)return Uint16Array;if(t===e.UNSIGNED_SHORT_5_5_5_1)return Uint16Array;if(t===e.UNSIGNED_SHORT_5_6_5)return Uint16Array;if(t===e.UNSIGNED_SHORT)return Uint16Array;if(t===e.UNSIGNED_INT)return Uint32Array;if(t===e.HALF_FLOAT)return Uint16Array;if(t===e.FLOAT)return Float32Array;throw new Error(`Unsupported WebGL type: ${t}`)}_getBytesPerTexel(t,e){const{gl:n}=this;let i=0;return t===n.UNSIGNED_BYTE&&(i=1),t!==n.UNSIGNED_SHORT_4_4_4_4&&t!==n.UNSIGNED_SHORT_5_5_5_1&&t!==n.UNSIGNED_SHORT_5_6_5&&t!==n.UNSIGNED_SHORT&&t!==n.HALF_FLOAT||(i=2),t!==n.UNSIGNED_INT&&t!==n.FLOAT||(i=4),e===n.RGBA?4*i:e===n.RGB?3*i:e===n.ALPHA?i:void 0}}class Sq{constructor(t){this.backend=t,this.gl=this.backend.gl,this.availableExtensions=this.gl.getSupportedExtensions(),this.extensions={}}get(t){let e=this.extensions[t];return void 0===e&&(e=this.gl.getExtension(t),this.extensions[t]=e),e}has(t){return this.availableExtensions.includes(t)}}class Mq{constructor(t){this.backend=t,this.maxAnisotropy=null}getMaxAnisotropy(){if(null!==this.maxAnisotropy)return this.maxAnisotropy;const t=this.backend.gl,e=this.backend.extensions;if(!0===e.has("EXT_texture_filter_anisotropic")){const n=e.get("EXT_texture_filter_anisotropic");this.maxAnisotropy=t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else this.maxAnisotropy=0;return this.maxAnisotropy}}const wq={WEBGL_multi_draw:"WEBGL_multi_draw",WEBGL_compressed_texture_astc:"texture-compression-astc",WEBGL_compressed_texture_etc:"texture-compression-etc2",WEBGL_compressed_texture_etc1:"texture-compression-etc1",WEBGL_compressed_texture_pvrtc:"texture-compression-pvrtc",WEBKIT_WEBGL_compressed_texture_pvrtc:"texture-compression-pvrtc",WEBGL_compressed_texture_s3tc:"texture-compression-bc",EXT_texture_compression_bptc:"texture-compression-bptc",EXT_disjoint_timer_query_webgl2:"timestamp-query"};class Tq{constructor(t){this.gl=t.gl,this.extensions=t.extensions,this.info=t.renderer.info,this.mode=null,this.index=0,this.type=null,this.object=null}render(t,e){const{gl:n,mode:i,object:r,type:s,info:a,index:o}=this;0!==o?n.drawElements(i,e,s,t):n.drawArrays(i,t,e),a.update(r,e,i,1)}renderInstances(t,e,n){const{gl:i,mode:r,type:s,index:a,object:o,info:l}=this;0!==n&&(0!==a?i.drawElementsInstanced(r,e,s,t,n):i.drawArraysInstanced(r,t,e,n),l.update(o,e,r,n))}renderMultiDraw(t,e,n){const{extensions:i,mode:r,object:s,info:a}=this;if(0===n)return;const o=i.get("WEBGL_multi_draw");if(null===o)for(let i=0;i<n;i++)this.render(t[i],e[i]);else{0!==this.index?o.multiDrawElementsWEBGL(r,e,0,this.type,t,0,n):o.multiDrawArraysWEBGL(r,t,0,e,0,n);let i=0;for(let t=0;t<n;t++)i+=e[t];a.update(s,i,r,1)}}renderMultiDrawInstances(t,e,n,i){const{extensions:r,mode:s,object:a,info:o}=this;if(0===n)return;const l=r.get("WEBGL_multi_draw");if(null===l)for(let r=0;r<n;r++)this.renderInstances(t[r],e[r],i[r]);else{0!==this.index?l.multiDrawElementsInstancedWEBGL(s,e,0,this.type,t,0,i,0,n):l.multiDrawArraysInstancedWEBGL(s,t,0,e,0,i,0,n);let r=0;for(let t=0;t<n;t++)r+=e[t];for(let t=0;t<i.length;t++)o.update(a,r,s,i[t])}}}class Eq extends uq{constructor(t={}){super(t),this.isWebGLBackend=!0}init(t){super.init(t);const e=this.parameters,n=void 0!==e.context?e.context:t.domElement.getContext("webgl2");this.gl=n,this.extensions=new Sq(this),this.capabilities=new Mq(this),this.attributeUtils=new Aq(this),this.textureUtils=new bq(this),this.bufferRenderer=new Tq(this),this.state=new mq(this),this.utils=new gq(this),this.vaoCache={},this.transformFeedbackCache={},this.discard=!1,this.trackTimestamp=!0===e.trackTimestamp,this.extensions.get("EXT_color_buffer_float"),this.extensions.get("WEBGL_clip_cull_distance"),this.extensions.get("OES_texture_float_linear"),this.extensions.get("EXT_color_buffer_half_float"),this.extensions.get("WEBGL_multisampled_render_to_texture"),this.extensions.get("WEBGL_render_shared_exponent"),this.extensions.get("WEBGL_multi_draw"),this.disjoint=this.extensions.get("EXT_disjoint_timer_query_webgl2"),this.parallel=this.extensions.get("KHR_parallel_shader_compile"),this._currentContext=null}get coordinateSystem(){return Ub}async getArrayBufferAsync(t){return await this.attributeUtils.getArrayBufferAsync(t)}initTimestampQuery(t){if(!this.disjoint||!this.trackTimestamp)return;const e=this.get(t);if(this.queryRunning)return e.queryQueue||(e.queryQueue=[]),void e.queryQueue.push(t);e.activeQuery&&(this.gl.endQuery(this.disjoint.TIME_ELAPSED_EXT),e.activeQuery=null),e.activeQuery=this.gl.createQuery(),null!==e.activeQuery&&(this.gl.beginQuery(this.disjoint.TIME_ELAPSED_EXT,e.activeQuery),this.queryRunning=!0)}prepareTimestampBuffer(t){if(!this.disjoint||!this.trackTimestamp)return;const e=this.get(t);if(e.activeQuery&&(this.gl.endQuery(this.disjoint.TIME_ELAPSED_EXT),e.gpuQueries||(e.gpuQueries=[]),e.gpuQueries.push({query:e.activeQuery}),e.activeQuery=null,this.queryRunning=!1,e.queryQueue&&e.queryQueue.length>0)){const t=e.queryQueue.shift();this.initTimestampQuery(t)}}async resolveTimestampAsync(t,e="render"){if(!this.disjoint||!this.trackTimestamp)return;const n=this.get(t);n.gpuQueries||(n.gpuQueries=[]);for(let t=0;t<n.gpuQueries.length;t++){const i=n.gpuQueries[t],r=this.gl.getQueryParameter(i.query,this.gl.QUERY_RESULT_AVAILABLE),s=this.gl.getParameter(this.disjoint.GPU_DISJOINT_EXT);if(r&&!s){const r=this.gl.getQueryParameter(i.query,this.gl.QUERY_RESULT),s=Number(r)/1e6;this.gl.deleteQuery(i.query),n.gpuQueries.splice(t,1),t--,this.renderer.info.updateTimestamp(e,s)}}}getContext(){return this.gl}beginRender(t){const{gl:e}=this,n=this.get(t);if(this.initTimestampQuery(t),n.previousContext=this._currentContext,this._currentContext=t,this._setFramebuffer(t),this.clear(t.clearColor,t.clearDepth,t.clearStencil,t,!1),t.viewport?this.updateViewport(t):e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),t.scissor){const{x:n,y:i,width:r,height:s}=t.scissorValue;e.scissor(n,t.height-s-i,r,s)}const i=t.occlusionQueryCount;i>0&&(n.currentOcclusionQueries=n.occlusionQueries,n.currentOcclusionQueryObjects=n.occlusionQueryObjects,n.lastOcclusionObject=null,n.occlusionQueries=new Array(i),n.occlusionQueryObjects=new Array(i),n.occlusionQueryIndex=0)}finishRender(t){const{gl:e,state:n}=this,i=this.get(t),r=i.previousContext,s=t.occlusionQueryCount;s>0&&(s>i.occlusionQueryIndex&&e.endQuery(e.ANY_SAMPLES_PASSED),this.resolveOccludedAsync(t));const a=t.textures;if(null!==a)for(let t=0;t<a.length;t++){const e=a[t];e.generateMipmaps&&this.generateMipmaps(e)}if(this._currentContext=r,null!==t.textures&&t.renderTarget){const i=this.get(t.renderTarget),{samples:r}=t.renderTarget;if(r>0){const r=i.framebuffers[t.getCacheKey()],s=e.COLOR_BUFFER_BIT,a=i.msaaFrameBuffer,o=t.textures;n.bindFramebuffer(e.READ_FRAMEBUFFER,a),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,r);for(let n=0;n<o.length;n++)if(t.scissor){const{x:n,y:r,width:a,height:o}=t.scissorValue,l=t.height-o-r;e.blitFramebuffer(n,l,n+a,l+o,n,l,n+a,l+o,s,e.NEAREST),e.invalidateSubFramebuffer(e.READ_FRAMEBUFFER,i.invalidationArray,n,l,a,o)}else e.blitFramebuffer(0,0,t.width,t.height,0,0,t.width,t.height,s,e.NEAREST),e.invalidateFramebuffer(e.READ_FRAMEBUFFER,i.invalidationArray)}}null!==r&&(this._setFramebuffer(r),r.viewport?this.updateViewport(r):e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight)),this.prepareTimestampBuffer(t)}resolveOccludedAsync(t){const e=this.get(t),{currentOcclusionQueries:n,currentOcclusionQueryObjects:i}=e;if(n&&i){const t=new WeakSet,{gl:r}=this;e.currentOcclusionQueryObjects=null,e.currentOcclusionQueries=null;const s=()=>{let a=0;for(let e=0;e<n.length;e++){const s=n[e];null!==s&&(r.getQueryParameter(s,r.QUERY_RESULT_AVAILABLE)&&(r.getQueryParameter(s,r.QUERY_RESULT)>0&&t.add(i[e]),n[e]=null,r.deleteQuery(s),a++))}a<n.length?requestAnimationFrame(s):e.occluded=t};s()}}isOccluded(t,e){const n=this.get(t);return n.occluded&&n.occluded.has(e)}updateViewport(t){const e=this.gl,{x:n,y:i,width:r,height:s}=t.viewportValue;e.viewport(n,t.height-s-i,r,s)}setScissorTest(t){const e=this.gl;t?e.enable(e.SCISSOR_TEST):e.disable(e.SCISSOR_TEST)}clear(t,e,n,i=null,r=!0){const{gl:s}=this;null===i&&(i={textures:null,clearColorValue:this.getClearColor()});let a=0;if(t&&(a|=s.COLOR_BUFFER_BIT),e&&(a|=s.DEPTH_BUFFER_BIT),n&&(a|=s.STENCIL_BUFFER_BIT),0!==a){const o=i.clearColorValue||this.getClearColor();if(o.r*=o.a,o.g*=o.a,o.b*=o.a,e&&this.state.setDepthMask(!0),null===i.textures)s.clearColor(o.r,o.g,o.b,o.a),s.clear(a);else{if(r&&this._setFramebuffer(i),t)for(let t=0;t<i.textures.length;t++)s.clearBufferfv(s.COLOR,t,[o.r,o.g,o.b,o.a]);e&&n?s.clearBufferfi(s.DEPTH_STENCIL,0,1,0):e?s.clearBufferfv(s.DEPTH,0,[1]):n&&s.clearBufferiv(s.STENCIL,0,[0])}}}beginCompute(t){const{state:e,gl:n}=this;e.bindFramebuffer(n.FRAMEBUFFER,null),this.initTimestampQuery(t)}compute(t,e,n,i){const{state:r,gl:s}=this;this.discard||(s.enable(s.RASTERIZER_DISCARD),this.discard=!0);const{programGPU:a,transformBuffers:o,attributes:l}=this.get(i),u=this._getVaoKey(null,l),h=this.vaoCache[u];void 0===h?this._createVao(null,l):s.bindVertexArray(h),r.useProgram(a),this._bindUniforms(n);const c=this._getTransformFeedback(o);s.bindTransformFeedback(s.TRANSFORM_FEEDBACK,c),s.beginTransformFeedback(s.POINTS),l[0].isStorageInstancedBufferAttribute?s.drawArraysInstanced(s.POINTS,0,1,e.count):s.drawArrays(s.POINTS,0,e.count),s.endTransformFeedback(),s.bindTransformFeedback(s.TRANSFORM_FEEDBACK,null);for(let t=0;t<o.length;t++){const e=o[t];e.pbo&&this.textureUtils.copyBufferToTexture(e.transformBuffer,e.pbo),e.switchBuffers()}}finishCompute(t){const e=this.gl;this.discard=!1,e.disable(e.RASTERIZER_DISCARD),this.prepareTimestampBuffer(t)}draw(t){const{object:e,pipeline:n,material:i,context:r}=t,{programGPU:s}=this.get(n),{gl:a,state:o}=this,l=this.get(r),u=t.getDrawParameters();if(null===u)return;this._bindUniforms(t.getBindings());const h=e.isMesh&&e.matrixWorld.determinant()<0;o.setMaterial(i,h),o.useProgram(s);let c=t.staticVao;if(void 0===c){const e=this._getVaoKey(t.getIndex(),t.getAttributes());if(c=this.vaoCache[e],void 0===c){let e;({vaoGPU:c,staticVao:e}=this._createVao(t.getIndex(),t.getAttributes())),e&&(t.staticVao=c)}}a.bindVertexArray(c);const A=t.getIndex(),d=l.lastOcclusionObject;if(d!==e&&void 0!==d){if(null!==d&&!0===d.occlusionTest&&(a.endQuery(a.ANY_SAMPLES_PASSED),l.occlusionQueryIndex++),!0===e.occlusionTest){const t=a.createQuery();a.beginQuery(a.ANY_SAMPLES_PASSED,t),l.occlusionQueries[l.occlusionQueryIndex]=t,l.occlusionQueryObjects[l.occlusionQueryIndex]=e}l.lastOcclusionObject=e}const p=this.bufferRenderer;e.isPoints?p.mode=a.POINTS:e.isLineSegments?p.mode=a.LINES:e.isLine?p.mode=a.LINE_STRIP:e.isLineLoop?p.mode=a.LINE_LOOP:!0===i.wireframe?(o.setLineWidth(i.wireframeLinewidth*this.renderer.getPixelRatio()),p.mode=a.LINES):p.mode=a.TRIANGLES;const{vertexCount:f,instanceCount:m}=u;let{firstVertex:g}=u;if(p.object=e,null!==A){g*=A.array.BYTES_PER_ELEMENT;const t=this.get(A);p.index=A.count,p.type=t.type}else p.index=0;var y;e.isBatchedMesh?null!==e._multiDrawInstances?p.renderMultiDrawInstances(e._multiDrawStarts,e._multiDrawCounts,e._multiDrawCount,e._multiDrawInstances):this.hasFeature("WEBGL_multi_draw")?p.renderMultiDraw(e._multiDrawStarts,e._multiDrawCounts,e._multiDrawCount):(y="THREE.WebGLRenderer: WEBGL_multi_draw not supported.")in tS||(tS[y]=!0,console.warn(y)):m>1?p.renderInstances(g,f,m):p.render(g,f),a.bindVertexArray(null)}needsRenderUpdate(){return!1}getRenderCacheKey(){return""}createDefaultTexture(t){this.textureUtils.createDefaultTexture(t)}createTexture(t,e){this.textureUtils.createTexture(t,e)}updateTexture(t,e){this.textureUtils.updateTexture(t,e)}generateMipmaps(t){this.textureUtils.generateMipmaps(t)}destroyTexture(t){this.textureUtils.destroyTexture(t)}copyTextureToBuffer(t,e,n,i,r,s){return this.textureUtils.copyTextureToBuffer(t,e,n,i,r,s)}createSampler(){}destroySampler(){}createNodeBuilder(t,e){return new sq(t,e)}createProgram(t){const e=this.gl,{stage:n,code:i}=t,r="fragment"===n?e.createShader(e.FRAGMENT_SHADER):e.createShader(e.VERTEX_SHADER);e.shaderSource(r,i),e.compileShader(r),this.set(t,{shaderGPU:r})}destroyProgram(){console.warn("Abstract class.")}createRenderPipeline(t,e){const n=this.gl,i=t.pipeline,{fragmentProgram:r,vertexProgram:s}=i,a=n.createProgram(),o=this.get(r).shaderGPU,l=this.get(s).shaderGPU;if(n.attachShader(a,o),n.attachShader(a,l),n.linkProgram(a),this.set(i,{programGPU:a,fragmentShader:o,vertexShader:l}),null!==e&&this.parallel){const r=new Promise((e=>{const r=this.parallel,s=()=>{n.getProgramParameter(a,r.COMPLETION_STATUS_KHR)?(this._completeCompile(t,i),e()):requestAnimationFrame(s)};s()}));e.push(r)}else this._completeCompile(t,i)}_handleSource(t,e){const n=t.split("\n"),i=[],r=Math.max(e-6,0),s=Math.min(e+6,n.length);for(let t=r;t<s;t++){const r=t+1;i.push(`${r===e?">":" "} ${r}: ${n[t]}`)}return i.join("\n")}_getShaderErrors(t,e,n){const i=t.getShaderParameter(e,t.COMPILE_STATUS),r=t.getShaderInfoLog(e).trim();if(i&&""===r)return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const i=parseInt(s[1]);return n.toUpperCase()+"\n\n"+r+"\n\n"+this._handleSource(t.getShaderSource(e),i)}return r}_logProgramError(t,e,n){if(this.renderer.debug.checkShaderErrors){const i=this.gl,r=i.getProgramInfoLog(t).trim();if(!1===i.getProgramParameter(t,i.LINK_STATUS))if("function"==typeof this.renderer.debug.onShaderError)this.renderer.debug.onShaderError(i,t,n,e);else{const s=this._getShaderErrors(i,n,"vertex"),a=this._getShaderErrors(i,e,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(t,i.VALIDATE_STATUS)+"\n\nProgram Info Log: "+r+"\n"+s+"\n"+a)}else""!==r&&console.warn("THREE.WebGLProgram: Program Info Log:",r)}}_completeCompile(t,e){const{state:n,gl:i}=this,r=this.get(e),{programGPU:s,fragmentShader:a,vertexShader:o}=r;!1===i.getProgramParameter(s,i.LINK_STATUS)&&this._logProgramError(s,a,o),n.useProgram(s);const l=t.getBindings();this._setupBindings(l,s),this.set(e,{programGPU:s})}createComputePipeline(t,e){const{state:n,gl:i}=this,r={stage:"fragment",code:"#version 300 es\nprecision highp float;\nvoid main() {}"};this.createProgram(r);const{computeProgram:s}=t,a=i.createProgram(),o=this.get(r).shaderGPU,l=this.get(s).shaderGPU,u=s.transforms,h=[],c=[];for(let t=0;t<u.length;t++){const e=u[t];h.push(e.varyingName),c.push(e.attributeNode)}i.attachShader(a,o),i.attachShader(a,l),i.transformFeedbackVaryings(a,h,i.SEPARATE_ATTRIBS),i.linkProgram(a),!1===i.getProgramParameter(a,i.LINK_STATUS)&&this._logProgramError(a,o,l),n.useProgram(a),this.createBindings(null,e),this._setupBindings(e,a);const A=s.attributes,d=[],p=[];for(let t=0;t<A.length;t++){const e=A[t].node.attribute;d.push(e),this.has(e)||this.attributeUtils.createAttribute(e,i.ARRAY_BUFFER)}for(let t=0;t<c.length;t++){const e=c[t].attribute;this.has(e)||this.attributeUtils.createAttribute(e,i.ARRAY_BUFFER);const n=this.get(e);p.push(n)}this.set(t,{programGPU:a,transformBuffers:p,attributes:d})}createBindings(t,e){this.updateBindings(t,e)}updateBindings(t,e){if(!t)return;const{gl:n}=this,i=this.get(e),r=this.get(t);void 0===i.textureIndex&&(i.textureIndex=0),void 0===r.textureIndex?r.textureIndex=i.textureIndex:i.textureIndex=r.textureIndex;let s=0;for(const e of t.bindings)if(e.isUniformsGroup||e.isUniformBuffer){const i=e.buffer,r=n.createBuffer();n.bindBuffer(n.UNIFORM_BUFFER,r),n.bufferData(n.UNIFORM_BUFFER,i,n.DYNAMIC_DRAW),this.set(e,{index:2*t.index+s++,bufferGPU:r})}else if(e.isSampledTexture){const{textureGPU:t,glTextureType:n}=this.get(e.texture);this.set(e,{index:i.textureIndex++,textureGPU:t,glTextureType:n})}}updateBinding(t){const e=this.gl;if(t.isUniformsGroup||t.isUniformBuffer){const n=this.get(t).bufferGPU,i=t.buffer;e.bindBuffer(e.UNIFORM_BUFFER,n),e.bufferData(e.UNIFORM_BUFFER,i,e.DYNAMIC_DRAW)}}createIndexAttribute(t){const e=this.gl;this.attributeUtils.createAttribute(t,e.ELEMENT_ARRAY_BUFFER)}createAttribute(t){if(this.has(t))return;const e=this.gl;this.attributeUtils.createAttribute(t,e.ARRAY_BUFFER)}createStorageAttribute(t){if(this.has(t))return;const e=this.gl;this.attributeUtils.createAttribute(t,e.ARRAY_BUFFER)}updateAttribute(t){this.attributeUtils.updateAttribute(t)}destroyAttribute(t){this.attributeUtils.destroyAttribute(t)}updateSize(){}hasFeature(t){const e=Object.keys(wq).filter((e=>wq[e]===t)),n=this.extensions;for(let t=0;t<e.length;t++)if(n.has(e[t]))return!0;return!1}getMaxAnisotropy(){return this.capabilities.getMaxAnisotropy()}copyTextureToTexture(t,e,n,i){this.textureUtils.copyTextureToTexture(t,e,n,i)}copyFramebufferToTexture(t,e,n){this.textureUtils.copyFramebufferToTexture(t,e,n)}_setFramebuffer(t){const{gl:e,state:n}=this;let i=null;if(null!==t.textures){const r=t.renderTarget,s=this.get(r),{samples:a,depthBuffer:o,stencilBuffer:l}=r,u=!0===r.isWebGLCubeRenderTarget;let h=s.msaaFrameBuffer,c=s.depthRenderbuffer;const A=bz(t);let d;if(u?(s.cubeFramebuffers||(s.cubeFramebuffers={}),d=s.cubeFramebuffers[A]):(s.framebuffers||(s.framebuffers={}),d=s.framebuffers[A]),void 0===d){d=e.createFramebuffer(),n.bindFramebuffer(e.FRAMEBUFFER,d);const i=t.textures;if(u){s.cubeFramebuffers[A]=d;const{textureGPU:t}=this.get(i[0]),n=this.renderer._activeCubeFace;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,t,0)}else{s.framebuffers[A]=d;for(let n=0;n<i.length;n++){const r=i[n],s=this.get(r);s.renderTarget=t.renderTarget;const a=e.COLOR_ATTACHMENT0+n;e.framebufferTexture2D(e.FRAMEBUFFER,a,e.TEXTURE_2D,s.textureGPU,0)}n.drawBuffers(t,d)}if(null!==t.depthTexture){const n=this.get(t.depthTexture),i=l?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;e.framebufferTexture2D(e.FRAMEBUFFER,i,e.TEXTURE_2D,n.textureGPU,0)}}if(a>0){if(void 0===h){const i=[];h=e.createFramebuffer(),n.bindFramebuffer(e.FRAMEBUFFER,h);const r=[],u=t.textures;for(let n=0;n<u.length;n++){if(r[n]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,r[n]),i.push(e.COLOR_ATTACHMENT0+n),o){const t=l?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;i.push(t)}const s=t.textures[n],u=this.get(s);e.renderbufferStorageMultisample(e.RENDERBUFFER,a,u.glInternalFormat,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+n,e.RENDERBUFFER,r[n])}if(s.msaaFrameBuffer=h,s.msaaRenderbuffers=r,void 0===c){c=e.createRenderbuffer(),this.textureUtils.setupRenderBufferStorage(c,t),s.depthRenderbuffer=c;const n=l?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;i.push(n)}s.invalidationArray=i}i=s.msaaFrameBuffer}else i=d}n.bindFramebuffer(e.FRAMEBUFFER,i)}_getVaoKey(t,e){let n=[];if(null!==t){n+=":"+this.get(t).id}for(let t=0;t<e.length;t++){n+=":"+this.get(e[t]).id}return n}_createVao(t,e){const{gl:n}=this,i=n.createVertexArray();let r="",s=!0;if(n.bindVertexArray(i),null!==t){const e=this.get(t);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.bufferGPU),r+=":"+e.id}for(let t=0;t<e.length;t++){const i=e[t],a=this.get(i);let o,l;r+=":"+a.id,n.bindBuffer(n.ARRAY_BUFFER,a.bufferGPU),n.enableVertexAttribArray(t),(i.isStorageBufferAttribute||i.isStorageInstancedBufferAttribute)&&(s=!1),!0===i.isInterleavedBufferAttribute?(o=i.data.stride*a.bytesPerElement,l=i.offset*a.bytesPerElement):(o=0,l=0),a.isInteger?n.vertexAttribIPointer(t,i.itemSize,a.type,o,l):n.vertexAttribPointer(t,i.itemSize,a.type,i.normalized,o,l),i.isInstancedBufferAttribute&&!i.isInterleavedBufferAttribute?n.vertexAttribDivisor(t,i.meshPerAttribute):i.isInterleavedBufferAttribute&&i.data.isInstancedInterleavedBuffer&&n.vertexAttribDivisor(t,i.data.meshPerAttribute)}return n.bindBuffer(n.ARRAY_BUFFER,null),this.vaoCache[r]=i,{vaoGPU:i,staticVao:s}}_getTransformFeedback(t){let e="";for(let n=0;n<t.length;n++)e+=":"+t[n].id;let n=this.transformFeedbackCache[e];if(void 0!==n)return n;const{gl:i}=this;n=i.createTransformFeedback(),i.bindTransformFeedback(i.TRANSFORM_FEEDBACK,n);for(let e=0;e<t.length;e++){const n=t[e];i.bindBufferBase(i.TRANSFORM_FEEDBACK_BUFFER,e,n.transformBuffer)}return i.bindTransformFeedback(i.TRANSFORM_FEEDBACK,null),this.transformFeedbackCache[e]=n,n}_setupBindings(t,e){const n=this.gl;for(const i of t)for(const t of i.bindings){const i=this.get(t).index;if(t.isUniformsGroup||t.isUniformBuffer){const r=n.getUniformBlockIndex(e,t.name);n.uniformBlockBinding(e,r,i)}else if(t.isSampledTexture){const r=n.getUniformLocation(e,t.name);n.uniform1i(r,i)}}}_bindUniforms(t){const{gl:e,state:n}=this;for(const i of t)for(const t of i.bindings){const i=this.get(t),r=i.index;t.isUniformsGroup||t.isUniformBuffer?n.bindBufferBase(e.UNIFORM_BUFFER,r,i.bufferGPU):t.isSampledTexture&&n.bindTexture(i.glTextureType,i.textureGPU,e.TEXTURE0+r)}}}class Cq extends Gz{constructor(t,e){super(t),this.texture=e,this.version=e?e.version:0,this.isSampler=!0}}class Rq extends Cq{constructor(t,e,n){super(t,e?e.value:null),this.textureNode=e,this.groupNode=n}update(){this.texture=this.textureNode.value}}class Nq extends Vz{constructor(t,e){super(t,e?e.array:null),this.attribute=e,this.isStorageBuffer=!0}}let Pq=0;class Dq extends Nq{constructor(t,e){super("StorageBuffer_"+Pq++,t?t.value:null),this.nodeUniform=t,this.access=t?t.access:YF,this.groupNode=e}get buffer(){return this.nodeUniform.value}}class Iq extends yU{constructor(t){super(),this.device=t;this.mipmapSampler=t.createSampler({minFilter:yF}),this.flipYSampler=t.createSampler({minFilter:vF}),this.transferPipelines={},this.flipYPipelines={},this.mipmapVertexShaderModule=t.createShaderModule({label:"mipmapVertex",code:"\nstruct VarysStruct {\n\t@builtin( position ) Position: vec4<f32>,\n\t@location( 0 ) vTex : vec2<f32>\n};\n\n@vertex\nfn main( @builtin( vertex_index ) vertexIndex : u32 ) -> VarysStruct {\n\n\tvar Varys : VarysStruct;\n\n\tvar pos = array< vec2<f32>, 4 >(\n\t\tvec2<f32>( -1.0, 1.0 ),\n\t\tvec2<f32>( 1.0, 1.0 ),\n\t\tvec2<f32>( -1.0, -1.0 ),\n\t\tvec2<f32>( 1.0, -1.0 )\n\t);\n\n\tvar tex = array< vec2<f32>, 4 >(\n\t\tvec2<f32>( 0.0, 0.0 ),\n\t\tvec2<f32>( 1.0, 0.0 ),\n\t\tvec2<f32>( 0.0, 1.0 ),\n\t\tvec2<f32>( 1.0, 1.0 )\n\t);\n\n\tVarys.vTex = tex[ vertexIndex ];\n\tVarys.Position = vec4<f32>( pos[ vertexIndex ], 0.0, 1.0 );\n\n\treturn Varys;\n\n}\n"}),this.mipmapFragmentShaderModule=t.createShaderModule({label:"mipmapFragment",code:"\n@group( 0 ) @binding( 0 )\nvar imgSampler : sampler;\n\n@group( 0 ) @binding( 1 )\nvar img : texture_2d<f32>;\n\n@fragment\nfn main( @location( 0 ) vTex : vec2<f32> ) -> @location( 0 ) vec4<f32> {\n\n\treturn textureSample( img, imgSampler, vTex );\n\n}\n"}),this.flipYFragmentShaderModule=t.createShaderModule({label:"flipYFragment",code:"\n@group( 0 ) @binding( 0 )\nvar imgSampler : sampler;\n\n@group( 0 ) @binding( 1 )\nvar img : texture_2d<f32>;\n\n@fragment\nfn main( @location( 0 ) vTex : vec2<f32> ) -> @location( 0 ) vec4<f32> {\n\n\treturn textureSample( img, imgSampler, vec2( vTex.x, 1.0 - vTex.y ) );\n\n}\n"})}getTransferPipeline(t){let e=this.transferPipelines[t];return void 0===e&&(e=this.device.createRenderPipeline({label:`mipmap-${t}`,vertex:{module:this.mipmapVertexShaderModule,entryPoint:"main"},fragment:{module:this.mipmapFragmentShaderModule,entryPoint:"main",targets:[{format:t}]},primitive:{topology:$O,stripIndexFormat:dF},layout:"auto"}),this.transferPipelines[t]=e),e}getFlipYPipeline(t){let e=this.flipYPipelines[t];return void 0===e&&(e=this.device.createRenderPipeline({label:`flipY-${t}`,vertex:{module:this.mipmapVertexShaderModule,entryPoint:"main"},fragment:{module:this.flipYFragmentShaderModule,entryPoint:"main",targets:[{format:t}]},primitive:{topology:$O,stripIndexFormat:dF},layout:"auto"}),this.flipYPipelines[t]=e),e}flipY(t,e,n=0){const i=e.format,{width:r,height:s}=e.size,a=this.getTransferPipeline(i),o=this.getFlipYPipeline(i),l=this.device.createTexture({size:{width:r,height:s,depthOrArrayLayers:1},format:i,usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING}),u=t.createView({baseMipLevel:0,mipLevelCount:1,dimension:sk,baseArrayLayer:n}),h=l.createView({baseMipLevel:0,mipLevelCount:1,dimension:sk,baseArrayLayer:0}),c=this.device.createCommandEncoder({}),A=(t,e,n)=>{const i=t.getBindGroupLayout(0),r=this.device.createBindGroup({layout:i,entries:[{binding:0,resource:this.flipYSampler},{binding:1,resource:e}]}),s=c.beginRenderPass({colorAttachments:[{view:n,loadOp:oF,storeOp:sF,clearValue:[0,0,0,0]}]});s.setPipeline(t),s.setBindGroup(0,r),s.draw(4,1,0,0),s.end()};A(a,u,h),A(o,h,u),this.device.queue.submit([c.finish()]),l.destroy()}generateMipmaps(t,e,n=0){const i=this.get(t);void 0===i.useCount&&(i.useCount=0,i.layers=[]);const r=i.layers[n]||this._mipmapCreateBundles(t,e,n),s=this.device.createCommandEncoder({});this._mipmapRunBundles(s,r),this.device.queue.submit([s.finish()]),0!==i.useCount&&(i.layers[n]=r),i.useCount++}_mipmapCreateBundles(t,e,n){const i=this.getTransferPipeline(e.format),r=i.getBindGroupLayout(0);let s=t.createView({baseMipLevel:0,mipLevelCount:1,dimension:sk,baseArrayLayer:n});const a=[];for(let o=1;o<e.mipLevelCount;o++){const l=this.device.createBindGroup({layout:r,entries:[{binding:0,resource:this.mipmapSampler},{binding:1,resource:s}]}),u=t.createView({baseMipLevel:o,mipLevelCount:1,dimension:sk,baseArrayLayer:n}),h={colorAttachments:[{view:u,loadOp:oF,storeOp:sF,clearValue:[0,0,0,0]}]},c=this.device.createRenderBundleEncoder({colorFormats:[e.format]});c.setPipeline(i),c.setBindGroup(0,l),c.draw(4,1,0,0),a.push({renderBundles:[c.finish()],passDescriptor:h}),s=u}return a}_mipmapRunBundles(t,e){const n=e.length;for(let i=0;i<n;i++){const n=e[i],r=t.beginRenderPass(n.passDescriptor);r.executeBundles(n.renderBundles),r.end()}}}const Lq={[Tb]:"never",[Eb]:"less",[Cb]:"equal",[Rb]:"less-equal",[Nb]:"greater",[Db]:"greater-equal",[Ib]:"always",[Pb]:"not-equal"},Bq=[0,1,3,2,4,5];class Uq{constructor(t){this.backend=t,this._passUtils=null,this.defaultTexture={},this.defaultCubeTexture={},this.defaultVideoFrame=null,this.colorBuffer=null,this.depthTexture=new tT,this.depthTexture.name="depthBuffer"}createSampler(t){const e=this.backend,n=e.device,i=e.get(t),r={addressModeU:this._convertAddressMode(t.wrapS),addressModeV:this._convertAddressMode(t.wrapT),addressModeW:this._convertAddressMode(t.wrapR),magFilter:this._convertFilterMode(t.magFilter),minFilter:this._convertFilterMode(t.minFilter),mipmapFilter:this._convertFilterMode(t.minFilter),maxAnisotropy:t.anisotropy};t.isDepthTexture&&null!==t.compareFunction&&(r.compare=Lq[t.compareFunction]),i.sampler=n.createSampler(r)}createDefaultTexture(t){let e;const n=Oq(t);t.isCubeTexture?e=this._getDefaultCubeTextureGPU(n):t.isVideoTexture?this.backend.get(t).externalTexture=this._getDefaultVideoFrame():e=this._getDefaultTextureGPU(n),this.backend.get(t).texture=e}createTexture(t,e={}){const n=this.backend,i=n.get(t);if(i.initialized)throw new Error("WebGPUTextureUtils: Texture already initialized.");void 0===e.needsMipmaps&&(e.needsMipmaps=!1),void 0===e.levels&&(e.levels=1),void 0===e.depth&&(e.depth=1);const{width:r,height:s,depth:a,levels:o}=e,l=this._getDimension(t),u=t.internalFormat||e.format||Oq(t,n.device);i.format=u;let h=void 0!==e.sampleCount?e.sampleCount:1;h=n.utils.getSampleCount(h);const c=t.isRenderTargetTexture&&!t.isMultisampleRenderTargetTexture?1:h;let A=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC;!0===t.isStorageTexture&&(A|=GPUTextureUsage.STORAGE_BINDING),!0!==t.isCompressedTexture&&!0!==t.isCompressedArrayTexture&&(A|=GPUTextureUsage.RENDER_ATTACHMENT);const d={label:t.name,size:{width:r,height:s,depthOrArrayLayers:a},mipLevelCount:o,sampleCount:c,dimension:l,format:u,usage:A};if(t.isVideoTexture){const e=t.source.data,n=new VideoFrame(e);d.size.width=n.displayWidth,d.size.height=n.displayHeight,n.close(),i.externalTexture=e}else{if(void 0===u)return console.warn("WebGPURenderer: Texture format not supported."),this.createDefaultTexture(t);i.texture=n.device.createTexture(d)}if(t.isRenderTargetTexture&&h>1&&!t.isMultisampleRenderTargetTexture){const t=Object.assign({},d);t.label=t.label+"-msaa",t.sampleCount=h,i.msaaTexture=n.device.createTexture(t)}i.initialized=!0,i.textureDescriptorGPU=d}destroyTexture(t){const e=this.backend,n=e.get(t);n.texture.destroy(),void 0!==n.msaaTexture&&n.msaaTexture.destroy(),e.delete(t)}destroySampler(t){delete this.backend.get(t).sampler}generateMipmaps(t){const e=this.backend.get(t);if(t.isCubeTexture)for(let t=0;t<6;t++)this._generateMipmaps(e.texture,e.textureDescriptorGPU,t);else{const n=t.image.depth||1;for(let t=0;t<n;t++)this._generateMipmaps(e.texture,e.textureDescriptorGPU,t)}}getColorBuffer(){this.colorBuffer&&this.colorBuffer.destroy();const t=this.backend,{width:e,height:n}=t.getDrawingBufferSize();return this.colorBuffer=t.device.createTexture({label:"colorBuffer",size:{width:e,height:n,depthOrArrayLayers:1},sampleCount:t.utils.getSampleCount(t.renderer.samples),format:t.utils.getPreferredCanvasFormat(),usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC}),this.colorBuffer}getDepthBuffer(t=!0,e=!1){const n=this.backend,{width:i,height:r}=n.getDrawingBufferSize(),s=this.depthTexture,a=n.get(s).texture;let o,l;if(e?(o=Hx,l=zx):t&&(o=Vx,l=Ox),void 0!==a){if(s.image.width===i&&s.image.height===r&&s.format===o&&s.type===l)return a;this.destroyTexture(s)}return s.name="depthBuffer",s.format=o,s.type=l,s.image.width=i,s.image.height=r,this.createTexture(s,{sampleCount:n.utils.getSampleCount(n.renderer.samples),width:i,height:r}),n.get(s).texture}updateTexture(t,e){const n=this.backend.get(t),{textureDescriptorGPU:i}=n;if(!t.isRenderTargetTexture&&void 0!==i){if(t.isDataTexture)this._copyBufferToTexture(e.image,n.texture,i,0,t.flipY);else if(t.isDataArrayTexture||t.isData3DTexture)for(let r=0;r<e.image.depth;r++)this._copyBufferToTexture(e.image,n.texture,i,r,t.flipY,r);else if(t.isCompressedTexture||t.isCompressedArrayTexture)this._copyCompressedBufferToTexture(t.mipmaps,n.texture,i);else if(t.isCubeTexture)this._copyCubeMapToTexture(e.images,n.texture,i,t.flipY);else if(t.isVideoTexture){const e=t.source.data;n.externalTexture=e}else this._copyImageToTexture(e.image,n.texture,i,0,t.flipY);n.version=t.version,t.onUpdate&&t.onUpdate(t)}}async copyTextureToBuffer(t,e,n,i,r,s){const a=this.backend.device,o=this.backend.get(t),l=o.texture,u=o.textureDescriptorGPU.format,h=this._getBytesPerTexel(u);let c=i*h;c=256*Math.ceil(c/256);const A=a.createBuffer({size:i*r*h,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),d=a.createCommandEncoder();d.copyTextureToBuffer({texture:l,origin:{x:e,y:n,z:s}},{buffer:A,bytesPerRow:c},{width:i,height:r});const p=this._getTypedArrayType(u);a.queue.submit([d.finish()]),await A.mapAsync(GPUMapMode.READ);return new p(A.getMappedRange())}_isEnvironmentTexture(t){const e=t.mapping;return e===xx||e===bx||e===vx||e===_x}_getDefaultTextureGPU(t){let e=this.defaultTexture[t];if(void 0===e){const n=new pS;n.minFilter=Tx,n.magFilter=Tx,this.createTexture(n,{width:1,height:1,format:t}),this.defaultTexture[t]=e=n}return this.backend.get(e).texture}_getDefaultCubeTextureGPU(t){let e=this.defaultTexture[t];if(void 0===e){const n=new Bw;n.minFilter=Tx,n.magFilter=Tx,this.createTexture(n,{width:1,height:1,depth:6}),this.defaultCubeTexture[t]=e=n}return this.backend.get(e).texture}_getDefaultVideoFrame(){let t=this.defaultVideoFrame;if(null===t){const e={timestamp:0,codedWidth:1,codedHeight:1,format:"RGBA"};this.defaultVideoFrame=t=new VideoFrame(new Uint8Array([0,0,0,255]),e)}return t}_copyCubeMapToTexture(t,e,n,i){for(let r=0;r<6;r++){const s=t[r],a=!0===i?Bq[r]:r;s.isDataTexture?this._copyBufferToTexture(s.image,e,n,a,i):this._copyImageToTexture(s,e,n,a,i)}}_copyImageToTexture(t,e,n,i,r){this.backend.device.queue.copyExternalImageToTexture({source:t},{texture:e,mipLevel:0,origin:{x:0,y:0,z:i}},{width:t.width,height:t.height,depthOrArrayLayers:1}),!0===r&&this._flipY(e,n,i)}_getPassUtils(){let t=this._passUtils;return null===t&&(this._passUtils=t=new Iq(this.backend.device)),t}_generateMipmaps(t,e,n=0){this._getPassUtils().generateMipmaps(t,e,n)}_flipY(t,e,n=0){this._getPassUtils().flipY(t,e,n)}_copyBufferToTexture(t,e,n,i,r,s=0){const a=this.backend.device,o=t.data,l=this._getBytesPerTexel(n.format),u=t.width*l;a.queue.writeTexture({texture:e,mipLevel:0,origin:{x:0,y:0,z:i}},o,{offset:t.width*t.height*l*s,bytesPerRow:u},{width:t.width,height:t.height,depthOrArrayLayers:1}),!0===r&&this._flipY(e,n,i)}_copyCompressedBufferToTexture(t,e,n){const i=this.backend.device,r=this._getBlockData(n.format),s=n.size.depthOrArrayLayers>1;for(let a=0;a<t.length;a++){const o=t[a],l=o.width,u=o.height,h=s?n.size.depthOrArrayLayers:1,c=Math.ceil(l/r.width)*r.byteLength,A=c*Math.ceil(u/r.height);for(let t=0;t<h;t++)i.queue.writeTexture({texture:e,mipLevel:a,origin:{x:0,y:0,z:t}},o.data,{offset:t*A,bytesPerRow:c,rowsPerImage:Math.ceil(u/r.height)},{width:Math.ceil(l/r.width)*r.width,height:Math.ceil(u/r.height)*r.height,depthOrArrayLayers:1})}}_getBlockData(t){return t===pF.BC1RGBAUnorm||t===pF.BC1RGBAUnormSRGB?{byteLength:8,width:4,height:4}:t===pF.BC2RGBAUnorm||t===pF.BC2RGBAUnormSRGB||t===pF.BC3RGBAUnorm||t===pF.BC3RGBAUnormSRGB?{byteLength:16,width:4,height:4}:t===pF.BC4RUnorm||t===pF.BC4RSNorm?{byteLength:8,width:4,height:4}:t===pF.BC5RGUnorm||t===pF.BC5RGSnorm||t===pF.BC6HRGBUFloat||t===pF.BC6HRGBFloat||t===pF.BC7RGBAUnorm||t===pF.BC7RGBAUnormSRGB?{byteLength:16,width:4,height:4}:t===pF.ETC2RGB8Unorm||t===pF.ETC2RGB8UnormSRGB||t===pF.ETC2RGB8A1Unorm||t===pF.ETC2RGB8A1UnormSRGB?{byteLength:8,width:4,height:4}:t===pF.ETC2RGBA8Unorm||t===pF.ETC2RGBA8UnormSRGB?{byteLength:16,width:4,height:4}:t===pF.EACR11Unorm||t===pF.EACR11Snorm?{byteLength:8,width:4,height:4}:t===pF.EACRG11Unorm||t===pF.EACRG11Snorm||t===pF.ASTC4x4Unorm||t===pF.ASTC4x4UnormSRGB?{byteLength:16,width:4,height:4}:t===pF.ASTC5x4Unorm||t===pF.ASTC5x4UnormSRGB?{byteLength:16,width:5,height:4}:t===pF.ASTC5x5Unorm||t===pF.ASTC5x5UnormSRGB?{byteLength:16,width:5,height:5}:t===pF.ASTC6x5Unorm||t===pF.ASTC6x5UnormSRGB?{byteLength:16,width:6,height:5}:t===pF.ASTC6x6Unorm||t===pF.ASTC6x6UnormSRGB?{byteLength:16,width:6,height:6}:t===pF.ASTC8x5Unorm||t===pF.ASTC8x5UnormSRGB?{byteLength:16,width:8,height:5}:t===pF.ASTC8x6Unorm||t===pF.ASTC8x6UnormSRGB?{byteLength:16,width:8,height:6}:t===pF.ASTC8x8Unorm||t===pF.ASTC8x8UnormSRGB?{byteLength:16,width:8,height:8}:t===pF.ASTC10x5Unorm||t===pF.ASTC10x5UnormSRGB?{byteLength:16,width:10,height:5}:t===pF.ASTC10x6Unorm||t===pF.ASTC10x6UnormSRGB?{byteLength:16,width:10,height:6}:t===pF.ASTC10x8Unorm||t===pF.ASTC10x8UnormSRGB?{byteLength:16,width:10,height:8}:t===pF.ASTC10x10Unorm||t===pF.ASTC10x10UnormSRGB?{byteLength:16,width:10,height:10}:t===pF.ASTC12x10Unorm||t===pF.ASTC12x10UnormSRGB?{byteLength:16,width:12,height:10}:t===pF.ASTC12x12Unorm||t===pF.ASTC12x12UnormSRGB?{byteLength:16,width:12,height:12}:void 0}_convertAddressMode(t){let e=fF;return t===Sx?e=mF:t===wx&&(e=gF),e}_convertFilterMode(t){let e=yF;return t!==Tx&&t!==Ex&&t!==Cx||(e=vF),e}_getBytesPerTexel(t){return t===pF.R8Unorm||t===pF.R8Snorm||t===pF.R8Uint||t===pF.R8Sint?1:t===pF.R16Uint||t===pF.R16Sint||t===pF.R16Float||t===pF.RG8Unorm||t===pF.RG8Snorm||t===pF.RG8Uint||t===pF.RG8Sint?2:t===pF.R32Uint||t===pF.R32Sint||t===pF.R32Float||t===pF.RG16Uint||t===pF.RG16Sint||t===pF.RG16Float||t===pF.RGBA8Unorm||t===pF.RGBA8UnormSRGB||t===pF.RGBA8Snorm||t===pF.RGBA8Uint||t===pF.RGBA8Sint||t===pF.BGRA8Unorm||t===pF.BGRA8UnormSRGB||t===pF.RGB9E5UFloat||t===pF.RGB10A2Unorm||t===pF.RG11B10UFloat||t===pF.Depth32Float||t===pF.Depth24Plus||t===pF.Depth24PlusStencil8||t===pF.Depth32FloatStencil8?4:t===pF.RG32Uint||t===pF.RG32Sint||t===pF.RG32Float||t===pF.RGBA16Uint||t===pF.RGBA16Sint||t===pF.RGBA16Float?8:t===pF.RGBA32Uint||t===pF.RGBA32Sint||t===pF.RGBA32Float?16:void 0}_getTypedArrayType(t){return t===pF.R8Uint?Uint8Array:t===pF.R8Sint?Int8Array:t===pF.R8Unorm?Uint8Array:t===pF.R8Snorm?Int8Array:t===pF.RG8Uint?Uint8Array:t===pF.RG8Sint?Int8Array:t===pF.RG8Unorm?Uint8Array:t===pF.RG8Snorm?Int8Array:t===pF.RGBA8Uint?Uint8Array:t===pF.RGBA8Sint?Int8Array:t===pF.RGBA8Unorm?Uint8Array:t===pF.RGBA8Snorm?Int8Array:t===pF.R16Uint?Uint16Array:t===pF.R16Sint?Int16Array:t===pF.RG16Uint?Uint16Array:t===pF.RG16Sint?Int16Array:t===pF.RGBA16Uint?Uint16Array:t===pF.RGBA16Sint?Int16Array:t===pF.R16Float||t===pF.RG16Float||t===pF.RGBA16Float?Uint16Array:t===pF.R32Uint?Uint32Array:t===pF.R32Sint?Int32Array:t===pF.R32Float?Float32Array:t===pF.RG32Uint?Uint32Array:t===pF.RG32Sint?Int32Array:t===pF.RG32Float?Float32Array:t===pF.RGBA32Uint?Uint32Array:t===pF.RGBA32Sint?Int32Array:t===pF.RGBA32Float?Float32Array:t===pF.BGRA8Unorm||t===pF.BGRA8UnormSRGB?Uint8Array:t===pF.RGB10A2Unorm||t===pF.RGB9E5UFloat||t===pF.RG11B10UFloat?Uint32Array:t===pF.Depth32Float?Float32Array:t===pF.Depth24Plus||t===pF.Depth24PlusStencil8?Uint32Array:t===pF.Depth32FloatStencil8?Float32Array:void 0}_getDimension(t){let e;return e=t.isData3DTexture?rk:ik,e}}function Oq(t,e=null){const n=t.format,i=t.type,r=t.colorSpace;let s;if(!0===t.isFramebufferTexture&&t.type===Dx)s=pF.BGRA8Unorm;else if(!0===t.isCompressedTexture||!0===t.isCompressedArrayTexture)switch(n){case Zx:s=r===yb?pF.BC1RGBAUnormSRGB:pF.BC1RGBAUnorm;break;case Kx:s=r===yb?pF.BC2RGBAUnormSRGB:pF.BC2RGBAUnorm;break;case Jx:s=r===yb?pF.BC3RGBAUnormSRGB:pF.BC3RGBAUnorm;break;case tb:s=r===yb?pF.ETC2RGB8UnormSRGB:pF.ETC2RGB8Unorm;break;case eb:s=r===yb?pF.ETC2RGBA8UnormSRGB:pF.ETC2RGBA8Unorm;break;case nb:s=r===yb?pF.ASTC4x4UnormSRGB:pF.ASTC4x4Unorm;break;case ib:s=r===yb?pF.ASTC5x4UnormSRGB:pF.ASTC5x4Unorm;break;case rb:s=r===yb?pF.ASTC5x5UnormSRGB:pF.ASTC5x5Unorm;break;case sb:s=r===yb?pF.ASTC6x5UnormSRGB:pF.ASTC6x5Unorm;break;case ab:s=r===yb?pF.ASTC6x6UnormSRGB:pF.ASTC6x6Unorm;break;case ob:s=r===yb?pF.ASTC8x5UnormSRGB:pF.ASTC8x5Unorm;break;case lb:s=r===yb?pF.ASTC8x6UnormSRGB:pF.ASTC8x6Unorm;break;case ub:s=r===yb?pF.ASTC8x8UnormSRGB:pF.ASTC8x8Unorm;break;case hb:s=r===yb?pF.ASTC10x5UnormSRGB:pF.ASTC10x5Unorm;break;case cb:s=r===yb?pF.ASTC10x6UnormSRGB:pF.ASTC10x6Unorm;break;case Ab:s=r===yb?pF.ASTC10x8UnormSRGB:pF.ASTC10x8Unorm;break;case db:s=r===yb?pF.ASTC10x10UnormSRGB:pF.ASTC10x10Unorm;break;case pb:s=r===yb?pF.ASTC12x10UnormSRGB:pF.ASTC12x10Unorm;break;case fb:s=r===yb?pF.ASTC12x12UnormSRGB:pF.ASTC12x12Unorm;break;default:console.error("WebGPURenderer: Unsupported texture format.",n)}else switch(n){case Gx:switch(i){case Ix:s=pF.RGBA8Snorm;break;case Lx:s=pF.RGBA16Sint;break;case Bx:s=pF.RGBA16Uint;break;case Ox:s=pF.RGBA32Uint;break;case Ux:s=pF.RGBA32Sint;break;case Dx:s=r===yb?pF.RGBA8UnormSRGB:pF.RGBA8Unorm;break;case kx:s=pF.RGBA16Float;break;case Fx:s=pF.RGBA32Float;break;default:console.error("WebGPURenderer: Unsupported texture type with RGBAFormat.",i)}break;case qx:if(35902===i)s=pF.RGB9E5UFloat;else console.error("WebGPURenderer: Unsupported texture type with RGBFormat.",i);break;case jx:switch(i){case Ix:s=pF.R8Snorm;break;case Lx:s=pF.R16Sint;break;case Bx:s=pF.R16Uint;break;case Ox:s=pF.R32Uint;break;case Ux:s=pF.R32Sint;break;case Dx:s=pF.R8Unorm;break;case kx:s=pF.R16Float;break;case Fx:s=pF.R32Float;break;default:console.error("WebGPURenderer: Unsupported texture type with RedFormat.",i)}break;case Xx:switch(i){case Ix:s=pF.RG8Snorm;break;case Lx:s=pF.RG16Sint;break;case Bx:s=pF.RG16Uint;break;case Ox:s=pF.RG32Uint;break;case Ux:s=pF.RG32Sint;break;case Dx:s=pF.RG8Unorm;break;case kx:s=pF.RG16Float;break;case Fx:s=pF.RG32Float;break;default:console.error("WebGPURenderer: Unsupported texture type with RGFormat.",i)}break;case Vx:switch(i){case Bx:s=pF.Depth16Unorm;break;case Ox:s=pF.Depth24Plus;break;case Fx:s=pF.Depth32Float;break;default:console.error("WebGPURenderer: Unsupported texture type with DepthFormat.",i)}break;case Hx:switch(i){case zx:s=pF.Depth24PlusStencil8;break;case Fx:e&&!1===e.features.has(Ak.Depth32FloatStencil8)&&console.error('WebGPURenderer: Depth textures with DepthStencilFormat + FloatType can only be used with the "depth32float-stencil8" GPU feature.'),s=pF.Depth32FloatStencil8;break;default:console.error("WebGPURenderer: Unsupported texture type with DepthStencilFormat.",i)}break;case Wx:switch(i){case Ux:s=pF.R32Sint;break;case Ox:s=pF.R32Uint;break;default:console.error("WebGPURenderer: Unsupported texture type with RedIntegerFormat.",i)}break;case Yx:switch(i){case Ux:s=pF.RG32Sint;break;case Ox:s=pF.RG32Uint;break;default:console.error("WebGPURenderer: Unsupported texture type with RGIntegerFormat.",i)}break;case Qx:switch(i){case Ux:s=pF.RGBA32Sint;break;case Ox:s=pF.RGBA32Uint;break;default:console.error("WebGPURenderer: Unsupported texture type with RGBAIntegerFormat.",i)}break;default:console.error("WebGPURenderer: Unsupported texture format.",n)}return s}const Fq=/^[fn]*\s*([a-z_0-9]+)?\s*\(([\s\S]*?)\)\s*[\-\>]*\s*([a-z_0-9]+(?:<[\s\S]+?>)?)/i,kq=/([a-z_0-9]+)\s*:\s*([a-z_0-9]+(?:<[\s\S]+?>)?)/gi,zq={f32:"float",i32:"int",u32:"uint",bool:"bool","vec2<f32>":"vec2","vec2<i32>":"ivec2","vec2<u32>":"uvec2","vec2<bool>":"bvec2",vec2f:"vec2",vec2i:"ivec2",vec2u:"uvec2",vec2b:"bvec2","vec3<f32>":"vec3","vec3<i32>":"ivec3","vec3<u32>":"uvec3","vec3<bool>":"bvec3",vec3f:"vec3",vec3i:"ivec3",vec3u:"uvec3",vec3b:"bvec3","vec4<f32>":"vec4","vec4<i32>":"ivec4","vec4<u32>":"uvec4","vec4<bool>":"bvec4",vec4f:"vec4",vec4i:"ivec4",vec4u:"uvec4",vec4b:"bvec4","mat2x2<f32>":"mat2",mat2x2f:"mat2","mat3x3<f32>":"mat3",mat3x3f:"mat3","mat4x4<f32>":"mat4",mat4x4f:"mat4",sampler:"sampler",texture_1d:"texture",texture_2d:"texture",texture_2d_array:"texture",texture_multisampled_2d:"cubeTexture",texture_depth_2d:"depthTexture",texture_3d:"texture3D",texture_cube:"cubeTexture",texture_cube_array:"cubeTexture",texture_storage_1d:"storageTexture",texture_storage_2d:"storageTexture",texture_storage_2d_array:"storageTexture",texture_storage_3d:"storageTexture"};class qq extends hz{constructor(t){const{type:e,inputs:n,name:i,inputsCode:r,blockCode:s,outputType:a}=(t=>{const e=(t=t.trim()).match(Fq);if(null!==e&&4===e.length){const n=e[2],i=[];let r=null;for(;null!==(r=kq.exec(n));)i.push({name:r[1],type:r[2]});const s=[];for(let t=0;t<i.length;t++){const{name:e,type:n}=i[t];let r=n;r.startsWith("texture")&&(r=n.split("<")[0]),r=zq[r]||r,s.push(new UO(r,e))}const a=t.substring(e[0].length),o=e[3]||"void",l=void 0!==e[1]?e[1]:"";return{type:zq[o]||o,inputs:s,name:l,inputsCode:n,blockCode:a,outputType:o}}throw new Error("FunctionNode: Function is not a WGSL code.")})(t);super(e,n,i),this.inputsCode=r,this.blockCode=s,this.outputType=a}getCode(t=this.name){const e="void"!==this.outputType?"-> "+this.outputType:"";return`fn ${t} ( ${this.inputsCode.trim()} ) ${e}`+this.blockCode}}class Gq extends uz{parseFunction(t){return new qq(t)}}const Vq=self.GPUShaderStage,Hq={vertex:Vq?Vq.VERTEX:1,fragment:Vq?Vq.FRAGMENT:2,compute:Vq?Vq.COMPUTE:4},jq={instance:!0,swizzleAssign:!1,storageBuffer:!0},Wq={"^^":"tsl_xor"},Xq={float:"f32",int:"i32",uint:"u32",bool:"bool",color:"vec3<f32>",vec2:"vec2<f32>",ivec2:"vec2<i32>",uvec2:"vec2<u32>",bvec2:"vec2<bool>",vec3:"vec3<f32>",ivec3:"vec3<i32>",uvec3:"vec3<u32>",bvec3:"vec3<bool>",vec4:"vec4<f32>",ivec4:"vec4<i32>",uvec4:"vec4<u32>",bvec4:"vec4<bool>",mat2:"mat2x2<f32>",imat2:"mat2x2<i32>",umat2:"mat2x2<u32>",bmat2:"mat2x2<bool>",mat3:"mat3x3<f32>",imat3:"mat3x3<i32>",umat3:"mat3x3<u32>",bmat3:"mat3x3<bool>",mat4:"mat4x4<f32>",imat4:"mat4x4<i32>",umat4:"mat4x4<u32>",bmat4:"mat4x4<bool>"},Yq={tsl_xor:new VU("fn tsl_xor( a : bool, b : bool ) -> bool { return ( a || b ) && !( a && b ); }"),mod_float:new VU("fn tsl_mod_float( x : f32, y : f32 ) -> f32 { return x - y * floor( x / y ); }"),mod_vec2:new VU("fn tsl_mod_vec2( x : vec2f, y : vec2f ) -> vec2f { return x - y * floor( x / y ); }"),mod_vec3:new VU("fn tsl_mod_vec3( x : vec3f, y : vec3f ) -> vec3f { return x - y * floor( x / y ); }"),mod_vec4:new VU("fn tsl_mod_vec4( x : vec4f, y : vec4f ) -> vec4f { return x - y * floor( x / y ); }"),equals_bool:new VU("fn tsl_equals_bool( a : bool, b : bool ) -> bool { return a == b; }"),equals_bvec2:new VU("fn tsl_equals_bvec2( a : vec2f, b : vec2f ) -> vec2<bool> { return vec2<bool>( a.x == b.x, a.y == b.y ); }"),equals_bvec3:new VU("fn tsl_equals_bvec3( a : vec3f, b : vec3f ) -> vec3<bool> { return vec3<bool>( a.x == b.x, a.y == b.y, a.z == b.z ); }"),equals_bvec4:new VU("fn tsl_equals_bvec4( a : vec4f, b : vec4f ) -> vec4<bool> { return vec4<bool>( a.x == b.x, a.y == b.y, a.z == b.z, a.w == b.w ); }"),repeatWrapping:new VU("\nfn tsl_repeatWrapping( uv : vec2<f32>, dimension : vec2<u32> ) -> vec2<u32> {\n\n\tlet uvScaled = vec2<u32>( uv * vec2<f32>( dimension ) );\n\n\treturn ( ( uvScaled % dimension ) + dimension ) % dimension;\n\n}\n"),biquadraticTexture:new VU("\nfn tsl_biquadraticTexture( map : texture_2d<f32>, coord : vec2f, level : i32 ) -> vec4f {\n\n\tlet iRes = vec2i( textureDimensions( map, level ) );\n\tlet res = vec2f( iRes );\n\n\tlet uvScaled = coord * res;\n\tlet uvWrapping = ( ( uvScaled % res ) + res ) % res;\n\n\t// https://www.shadertoy.com/view/WtyXRy\n\n\tlet uv = uvWrapping - 0.5;\n\tlet iuv = floor( uv );\n\tlet f = fract( uv );\n\n\tlet rg1 = textureLoad( map, vec2i( iuv + vec2( 0.5, 0.5 ) ) % iRes, level );\n\tlet rg2 = textureLoad( map, vec2i( iuv + vec2( 1.5, 0.5 ) ) % iRes, level );\n\tlet rg3 = textureLoad( map, vec2i( iuv + vec2( 0.5, 1.5 ) ) % iRes, level );\n\tlet rg4 = textureLoad( map, vec2i( iuv + vec2( 1.5, 1.5 ) ) % iRes, level );\n\n\treturn mix( mix( rg1, rg2, f.x ), mix( rg3, rg4, f.x ), f.y );\n\n}\n")},Qq={dFdx:"dpdx",dFdy:"- dpdy",mod_float:"tsl_mod_float",mod_vec2:"tsl_mod_vec2",mod_vec3:"tsl_mod_vec3",mod_vec4:"tsl_mod_vec4",equals_bool:"tsl_equals_bool",equals_bvec2:"tsl_equals_bvec2",equals_bvec3:"tsl_equals_bvec3",equals_bvec4:"tsl_equals_bvec4",inversesqrt:"inverseSqrt",bitcast:"bitcast<f32>"};/Windows/g.test(navigator.userAgent)&&(Yq.pow_float=new VU("fn tsl_pow_float( a : f32, b : f32 ) -> f32 { return select( -pow( -a, b ), pow( a, b ), a > 0.0 ); }"),Yq.pow_vec2=new VU("fn tsl_pow_vec2( a : vec2f, b : vec2f ) -> vec2f { return vec2f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ) ); }",[Yq.pow_float]),Yq.pow_vec3=new VU("fn tsl_pow_vec3( a : vec3f, b : vec3f ) -> vec3f { return vec3f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ), tsl_pow_float( a.z, b.z ) ); }",[Yq.pow_float]),Yq.pow_vec4=new VU("fn tsl_pow_vec4( a : vec4f, b : vec4f ) -> vec4f { return vec4f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ), tsl_pow_float( a.z, b.z ), tsl_pow_float( a.w, b.w ) ); }",[Yq.pow_float]),Qq.pow_float="tsl_pow_float",Qq.pow_vec2="tsl_pow_vec2",Qq.pow_vec3="tsl_pow_vec3",Qq.pow_vec4="tsl_pow_vec4");let $q="";!0!==/Firefox/g.test(navigator.userAgent)&&($q+="diagnostic( off, derivative_uniformity );\n");class Zq extends LO{constructor(t,e){super(t,e,new Gq),this.uniformGroups={},this.builtins={},this.directives={},this.scopedArrays=new Map}needsToWorkingColorSpace(t){return!0===t.isVideoTexture&&t.colorSpace!==gb}_generateTextureSample(t,e,n,i,r=this.shaderStage){return"fragment"===r?i?`textureSample( ${e}, ${e}_sampler, ${n}, ${i} )`:`textureSample( ${e}, ${e}_sampler, ${n} )`:this.isFilteredTexture(t)?this.generateFilteredTexture(t,e,n):this.generateTextureLod(t,e,n,"0")}_generateVideoSample(t,e,n=this.shaderStage){if("fragment"===n)return`textureSampleBaseClampToEdge( ${t}, ${t}_sampler, vec2<f32>( ${e}.x, 1.0 - ${e}.y ) )`;console.error(`WebGPURenderer: THREE.VideoTexture does not support ${n} shader.`)}_generateTextureSampleLevel(t,e,n,i,r,s=this.shaderStage){return"fragment"===s&&!1===this.isUnfilterable(t)?`textureSampleLevel( ${e}, ${e}_sampler, ${n}, ${i} )`:this.isFilteredTexture(t)?this.generateFilteredTexture(t,e,n,i):this.generateTextureLod(t,e,n,i)}generateFilteredTexture(t,e,n,i="0"){return this._include("biquadraticTexture"),`tsl_biquadraticTexture( ${e}, ${n}, i32( ${i} ) )`}generateTextureLod(t,e,n,i="0"){this._include("repeatWrapping");return`textureLoad( ${e}, tsl_repeatWrapping( ${n}, ${!0===t.isMultisampleRenderTargetTexture?`textureDimensions( ${e} )`:`textureDimensions( ${e}, 0 )`} ), i32( ${i} ) )`}generateTextureLoad(t,e,n,i,r="0u"){return i?`textureLoad( ${e}, ${n}, ${i}, ${r} )`:`textureLoad( ${e}, ${n}, ${r} )`}generateTextureStore(t,e,n,i){return`textureStore( ${e}, ${n}, ${i} )`}isUnfilterable(t){return"float"!==this.getComponentTypeFromTexture(t)||!this.isAvailable("float32Filterable")&&!0===t.isDataTexture&&t.type===Fx||!0===t.isMultisampleRenderTargetTexture}generateTexture(t,e,n,i,r=this.shaderStage){let s=null;return s=!0===t.isVideoTexture?this._generateVideoSample(e,n,r):this.isUnfilterable(t)?this.generateTextureLod(t,e,n,"0",i,r):this._generateTextureSample(t,e,n,i,r),s}generateTextureGrad(t,e,n,i,r,s=this.shaderStage){if("fragment"===s)return`textureSampleGrad( ${e}, ${e}_sampler, ${n}, ${i[0]}, ${i[1]} )`;console.error(`WebGPURenderer: THREE.TextureNode.gradient() does not support ${s} shader.`)}generateTextureCompare(t,e,n,i,r,s=this.shaderStage){if("fragment"===s)return`textureSampleCompare( ${e}, ${e}_sampler, ${n}, ${i} )`;console.error(`WebGPURenderer: THREE.DepthTexture.compareFunction() does not support ${s} shader.`)}generateTextureLevel(t,e,n,i,r,s=this.shaderStage){let a=null;return a=!0===t.isVideoTexture?this._generateVideoSample(e,n,s):this._generateTextureSampleLevel(t,e,n,i,r,s),a}generateTextureBias(t,e,n,i,r,s=this.shaderStage){if("fragment"===s)return`textureSampleBias( ${e}, ${e}_sampler, ${n}, ${i} )`;console.error(`WebGPURenderer: THREE.TextureNode.biasNode does not support ${s} shader.`)}getPropertyName(t,e=this.shaderStage){if(!0===t.isNodeVarying&&!0===t.needsInterpolation){if("vertex"===e)return`varyings.${t.name}`}else if(!0===t.isNodeUniform){const e=t.name,n=t.type;return"texture"===n||"cubeTexture"===n||"storageTexture"===n||"texture3D"===n?e:"buffer"===n||"storageBuffer"===n?`NodeBuffer_${t.id}.${e}`:t.groupNode.name+"."+e}return super.getPropertyName(t)}getOutputStructName(){return"output"}_getUniformGroupCount(t){return Object.keys(this.uniforms[t]).length}getFunctionOperator(t){const e=Wq[t];return void 0!==e?(this._include(e),e):null}getStorageAccess(t){if(t.isStorageTextureNode)switch(t.access){case ZF:return"read";case $F:return"write";default:return"read_write"}else switch(t.access){case YF:return"read_write";case QF:return"read";default:return"write"}}getUniformFromNode(t,e,n,i=null){const r=super.getUniformFromNode(t,e,n,i),s=this.getDataFromNode(t,n,this.globalCache);if(void 0===s.uniformGPU){let i;const a=t.groupNode,o=a.name,l=this.getBindGroupArray(o,n);if("texture"===e||"cubeTexture"===e||"storageTexture"===e||"texture3D"===e){let s=null;if("texture"===e||"storageTexture"===e?s=new Kz(r.name,r.node,a,t.access?t.access:null):"cubeTexture"===e?s=new Jz(r.name,r.node,a,t.access?t.access:null):"texture3D"===e&&(s=new tq(r.name,r.node,a,t.access?t.access:null)),s.store=!0===t.isStorageTextureNode,s.setVisibility(Hq[n]),"fragment"===n&&!1===this.isUnfilterable(t.value)&&!1===s.store){const t=new Rq(`${r.name}_sampler`,r.node,a);t.setVisibility(Hq[n]),l.push(t,s),i=[t,s]}else l.push(s),i=[s]}else if("buffer"===e||"storageBuffer"===e){const r=new("storageBuffer"===e?Dq:Wz)(t,a);r.setVisibility(Hq[n]),l.push(r),i=r}else{const t=this.uniformGroups[n]||(this.uniformGroups[n]={});let s=t[o];void 0===s&&(s=new Qz(o,a),s.setVisibility(Hq[n]),t[o]=s,l.push(s)),i=this.getNodeUniform(r,e),s.addUniform(i)}s.uniformGPU=i}return r}getBuiltin(t,e,n,i=this.shaderStage){const r=this.builtins[i]||(this.builtins[i]=new Map);return!1===r.has(t)&&r.set(t,{name:t,property:e,type:n}),e}hasBuiltin(t,e=this.shaderStage){return void 0!==this.builtins[e]&&this.builtins[e].has(t)}getVertexIndex(){return"vertex"===this.shaderStage?this.getBuiltin("vertex_index","vertexIndex","u32","attribute"):"vertexIndex"}buildFunctionCode(t){const e=t.layout,n=this.flowShaderNode(t),i=[];for(const t of e.inputs)i.push(t.name+" : "+this.getType(t.type));let r=`fn ${e.name}( ${i.join(", ")} ) -> ${this.getType(e.type)} {\n${n.vars}\n${n.code}\n`;return n.result&&(r+=`\treturn ${n.result};\n`),r+="\n}\n",r}getInstanceIndex(){return"vertex"===this.shaderStage?this.getBuiltin("instance_index","instanceIndex","u32","attribute"):"instanceIndex"}getInvocationLocalIndex(){return this.getBuiltin("local_invocation_index","invocationLocalIndex","u32","attribute")}getSubgroupSize(){return this.enableSubGroups(),this.getBuiltin("subgroup_size","subgroupSize","u32","attribute")}getInvocationSubgroupIndex(){return this.enableSubGroups(),this.getBuiltin("subgroup_invocation_id","invocationSubgroupIndex","u32","attribute")}getSubgroupIndex(){return this.enableSubGroups(),this.getBuiltin("subgroup_id","subgroupIndex","u32","attribute")}getDrawIndex(){return null}getFrontFacing(){return this.getBuiltin("front_facing","isFront","bool")}getFragCoord(){return this.getBuiltin("position","fragCoord","vec4<f32>")+".xy"}getFragDepth(){return"output."+this.getBuiltin("frag_depth","depth","f32","output")}isFlipY(){return!1}enableDirective(t,e=this.shaderStage){(this.directives[e]||(this.directives[e]=new Set)).add(t)}getDirectives(t){const e=[],n=this.directives[t];if(void 0!==n)for(const t of n)e.push(`enable ${t};`);return e.join("\n")}enableSubGroups(){this.enableDirective("subgroups")}enableSubgroupsF16(){this.enableDirective("subgroups-f16")}enableClipDistances(){this.enableDirective("clip_distances")}enableShaderF16(){this.enableDirective("f16")}enableDualSourceBlending(){this.enableDirective("dual_source_blending")}getBuiltins(t){const e=[],n=this.builtins[t];if(void 0!==n)for(const{name:t,property:i,type:r}of n.values())e.push(`@builtin( ${t} ) ${i} : ${r}`);return e.join(",\n\t")}getScopedArray(t,e,n,i){return!1===this.scopedArrays.has(t)&&this.scopedArrays.set(t,{name:t,scope:e,bufferType:n,bufferCount:i}),t}getScopedArrays(t){if("compute"!==t)return;const e=[];for(const{name:t,scope:n,bufferType:i,bufferCount:r}of this.scopedArrays.values()){const s=this.getType(i);e.push(`var<${n}> ${t}: array< ${s}, ${r} >;`)}return e.join("\n")}getAttributes(t){const e=[];if("compute"===t&&(this.getBuiltin("global_invocation_id","id","vec3<u32>","attribute"),this.getBuiltin("workgroup_id","workgroupId","vec3<u32>","attribute"),this.getBuiltin("local_invocation_id","localId","vec3<u32>","attribute"),this.getBuiltin("num_workgroups","numWorkgroups","vec3<u32>","attribute"),this.renderer.hasFeature("subgroups")&&(this.enableDirective("subgroups",t),this.getBuiltin("subgroup_size","subgroupSize","u32","attribute"))),"vertex"===t||"compute"===t){const t=this.getBuiltins("attribute");t&&e.push(t);const n=this.getAttributesArray();for(let t=0,i=n.length;t<i;t++){const i=n[t],r=i.name,s=this.getType(i.type);e.push(`@location( ${t} ) ${r} : ${s}`)}}return e.join(",\n\t")}getStructMembers(t){const e=[],n=t.getMemberTypes();for(let t=0;t<n.length;t++){const i=n[t];e.push(`\t@location( ${t} ) m${t} : ${i}<f32>`)}const i=this.getBuiltins("output");return i&&e.push("\t"+i),e.join(",\n")}getStructs(t){const e=[],n=this.structs[t];for(let t=0,i=n.length;t<i;t++){const i=n[t],r=i.name;let s=`struct ${r} {\n`;s+=this.getStructMembers(i),s+="\n}",e.push(s),e.push(`\nvar<private> output : ${r};\n\n`)}return e.join("\n\n")}getVar(t,e){return`var ${e} : ${this.getType(t)}`}getVars(t){const e=[],n=this.vars[t];if(void 0!==n)for(const t of n)e.push(`\t${this.getVar(t.type,t.name)};`);return`\n${e.join("\n")}\n`}getVaryings(t){const e=[];if("vertex"===t&&this.getBuiltin("position","Vertex","vec4<f32>","vertex"),"vertex"===t||"fragment"===t){const n=this.varyings,i=this.vars[t];for(let r=0;r<n.length;r++){const s=n[r];if(s.needsInterpolation){let t=`@location( ${r} )`;/^(int|uint|ivec|uvec)/.test(s.type)&&(t+=" @interpolate( flat )"),e.push(`${t} ${s.name} : ${this.getType(s.type)}`)}else"vertex"===t&&!1===i.includes(s)&&i.push(s)}}const n=this.getBuiltins(t);n&&e.push(n);const i=e.join(",\n\t");return"vertex"===t?this._getWGSLStruct("VaryingsStruct","\t"+i):i}getUniforms(t){const e=this.uniforms[t],n=[],i=[],r=[],s={};for(const r of e){const e=r.groupNode.name,a=this.bindingsIndexes[e];if("texture"===r.type||"cubeTexture"===r.type||"storageTexture"===r.type||"texture3D"===r.type){const e=r.node.value;let i;"fragment"===t&&!1===this.isUnfilterable(e)&&!0!==r.node.isStorageTextureNode&&(!0===e.isDepthTexture&&null!==e.compareFunction?n.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var ${r.name}_sampler : sampler_comparison;`):n.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var ${r.name}_sampler : sampler;`));let s="";if(!0===e.isMultisampleRenderTargetTexture&&(s="_multisampled"),!0===e.isCubeTexture)i="texture_cube<f32>";else if(!0===e.isDataArrayTexture||!0===e.isCompressedArrayTexture)i="texture_2d_array<f32>";else if(!0===e.isDepthTexture)i=`texture_depth${s}_2d`;else if(!0===e.isVideoTexture)i="texture_external";else if(!0===e.isData3DTexture)i="texture_3d<f32>";else if(!0===r.node.isStorageTextureNode){i=`texture_storage_2d<${Oq(e)}, ${this.getStorageAccess(r.node)}>`}else{i=`texture${s}_2d<${this.getComponentTypeFromTexture(e).charAt(0)}32>`}n.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var ${r.name} : ${i};`)}else if("buffer"===r.type||"storageBuffer"===r.type){const t=r.node,e=this.getType(t.bufferType),n=t.bufferCount,s=n>0?", "+n:"",o=t.isAtomic?`atomic<${e}>`:`${e}`,l=`\t${r.name} : array< ${o}${s} >\n`,u=t.isStorageBufferNode?`storage, ${this.getStorageAccess(t)}`:"uniform";i.push(this._getWGSLStructBinding("NodeBuffer_"+t.id,l,u,a.binding++,a.group))}else{const t=this.getType(this.getVectorType(r.type)),e=r.groupNode.name;(s[e]||(s[e]={index:a.binding++,id:a.group,snippets:[]})).snippets.push(`\t${r.name} : ${t}`)}}for(const t in s){const e=s[t];r.push(this._getWGSLStructBinding(t,e.snippets.join(",\n"),"uniform",e.index,e.id))}let a=n.join("\n");return a+=i.join("\n"),a+=r.join("\n"),a}buildCode(){const t=null!==this.material?{fragment:{},vertex:{}}:{compute:{}};this.sortBindingGroups();for(const e in t){const n=t[e];n.uniforms=this.getUniforms(e),n.attributes=this.getAttributes(e),n.varyings=this.getVaryings(e),n.structs=this.getStructs(e),n.vars=this.getVars(e),n.codes=this.getCodes(e),n.directives=this.getDirectives(e),n.scopedArrays=this.getScopedArrays(e);let i="// code\n\n";i+=this.flowCode[e];const r=this.flowNodes[e],s=r[r.length-1],a=s.outputNode,o=void 0!==a&&!0===a.isOutputStructNode;for(const t of r){const r=this.getFlowData(t),l=t.name;if(l&&(i.length>0&&(i+="\n"),i+=`\t// flow -> ${l}\n\t`),i+=`${r.code}\n\t`,t===s&&"compute"!==e)if(i+="// result\n\n\t","vertex"===e)i+=`varyings.Vertex = ${r.result};`;else if("fragment"===e)if(o)n.returnType=a.nodeType,i+=`return ${r.result};`;else{let t="\t@location(0) color: vec4<f32>";const e=this.getBuiltins("output");e&&(t+=",\n\t"+e),n.returnType="OutputStruct",n.structs+=this._getWGSLStruct("OutputStruct",t),n.structs+="\nvar<private> output : OutputStruct;\n\n",i+=`output.color = ${r.result};\n\n\treturn output;`}}n.flow=i}null!==this.material?(this.vertexShader=this._getWGSLVertexCode(t.vertex),this.fragmentShader=this._getWGSLFragmentCode(t.fragment)):this.computeShader=this._getWGSLComputeCode(t.compute,(this.object.workgroupSize||[64]).join(", "))}getMethod(t,e=null){let n;return null!==e&&(n=this._getWGSLMethod(t+"_"+e)),void 0===n&&(n=this._getWGSLMethod(t)),n||t}getType(t){return Xq[t]||t}isAvailable(t){let e=jq[t];return void 0===e&&("float32Filterable"===t&&(e=this.renderer.hasFeature("float32-filterable")),jq[t]=e),e}_getWGSLMethod(t){return void 0!==Yq[t]&&this._include(t),Qq[t]}_include(t){const e=Yq[t];return e.build(this),null!==this.currentFunctionNode&&this.currentFunctionNode.includes.push(e),e}_getWGSLVertexCode(t){return`${this.getSignature()}\n// directives\n${t.directives}\n\n// uniforms\n${t.uniforms}\n\n// varyings\n${t.varyings}\nvar<private> varyings : VaryingsStruct;\n\n// codes\n${t.codes}\n\n@vertex\nfn main( ${t.attributes} ) -> VaryingsStruct {\n\n\t// vars\n\t${t.vars}\n\n\t// flow\n\t${t.flow}\n\n\treturn varyings;\n\n}\n`}_getWGSLFragmentCode(t){return`${this.getSignature()}\n// global\n${$q}\n\n// uniforms\n${t.uniforms}\n\n// structs\n${t.structs}\n\n// codes\n${t.codes}\n\n@fragment\nfn main( ${t.varyings} ) -> ${t.returnType} {\n\n\t// vars\n\t${t.vars}\n\n\t// flow\n\t${t.flow}\n\n}\n`}_getWGSLComputeCode(t,e){return`${this.getSignature()}\n// directives\n${t.directives}\n\n// system\nvar<private> instanceIndex : u32;\n\n// locals\n${t.scopedArrays}\n\n// uniforms\n${t.uniforms}\n\n// codes\n${t.codes}\n\n@compute @workgroup_size( ${e} )\nfn main( ${t.attributes} ) {\n\n\t// system\n\tinstanceIndex = id.x + id.y * numWorkgroups.x * u32(${e}) + id.z * numWorkgroups.x * numWorkgroups.y * u32(${e});\n\n\t// vars\n\t${t.vars}\n\n\t// flow\n\t${t.flow}\n\n}\n`}_getWGSLStruct(t,e){return`\nstruct ${t} {\n${e}\n};`}_getWGSLStructBinding(t,e,n,i=0,r=0){const s=t+"Struct";return`${this._getWGSLStruct(s,e)}\n@binding( ${i} ) @group( ${r} )\nvar<${n}> ${t} : ${s};`}}class Kq{constructor(t){this.backend=t}getCurrentDepthStencilFormat(t){let e;return null!==t.depthTexture?e=this.getTextureFormatGPU(t.depthTexture):t.depth&&t.stencil?e=pF.Depth24PlusStencil8:t.depth&&(e=pF.Depth24Plus),e}getTextureFormatGPU(t){return this.backend.get(t).format}getCurrentColorFormat(t){let e;return e=null!==t.textures?this.getTextureFormatGPU(t.textures[0]):this.getPreferredCanvasFormat(),e}getCurrentColorSpace(t){return null!==t.textures?t.textures[0].colorSpace:this.backend.renderer.outputColorSpace}getPrimitiveTopology(t,e){return t.isPoints?WO:t.isLineSegments||t.isMesh&&!0===e.wireframe?XO:t.isLine?YO:t.isMesh?QO:void 0}getSampleCount(t){let e=1;return t>1&&(e=Math.pow(2,Math.floor(Math.log2(t))),2===e&&(e=4)),e}getSampleCountRenderContext(t){return null!==t.textures?this.getSampleCount(t.sampleCount):this.getSampleCount(this.backend.renderer.samples)}getPreferredCanvasFormat(){return navigator.userAgent.includes("Quest")?pF.BGRA8Unorm:navigator.gpu.getPreferredCanvasFormat()}}const Jq=new Map([[Int8Array,["sint8","snorm8"]],[Uint8Array,["uint8","unorm8"]],[Int16Array,["sint16","snorm16"]],[Uint16Array,["uint16","unorm16"]],[Int32Array,["sint32","snorm32"]],[Uint32Array,["uint32","unorm32"]],[Float32Array,["float32"]]]),tG=new Map([[nw,["float16"]]]),eG=new Map([[Int32Array,"sint32"],[Int16Array,"sint32"],[Uint32Array,"uint32"],[Uint16Array,"uint32"],[Float32Array,"float32"]]);class nG{constructor(t){this.backend=t}createAttribute(t,e){const n=this._getBufferAttribute(t),i=this.backend,r=i.get(n);let s=r.buffer;if(void 0===s){const a=i.device;let o=n.array;if(!1===t.normalized&&(o.constructor===Int16Array||o.constructor===Uint16Array)){const t=new Uint32Array(o.length);for(let e=0;e<o.length;e++)t[e]=o[e];o=t}if(n.array=o,(n.isStorageBufferAttribute||n.isStorageInstancedBufferAttribute)&&3===n.itemSize){o=new o.constructor(4*n.count);for(let t=0;t<n.count;t++)o.set(n.array.subarray(3*t,3*t+3),4*t);n.itemSize=4,n.array=o}const l=o.byteLength+(4-o.byteLength%4)%4;s=a.createBuffer({label:n.name,size:l,usage:e,mappedAtCreation:!0}),new o.constructor(s.getMappedRange()).set(o),s.unmap(),r.buffer=s}}updateAttribute(t){const e=this._getBufferAttribute(t),n=this.backend,i=n.device,r=n.get(e).buffer,s=e.array,a=e.updateRanges;if(0===a.length)i.queue.writeBuffer(r,0,s,0);else{for(let t=0,e=a.length;t<e;t++){const e=a[t];i.queue.writeBuffer(r,0,s,e.start*s.BYTES_PER_ELEMENT,e.count*s.BYTES_PER_ELEMENT)}e.clearUpdateRanges()}}createShaderVertexBuffers(t){const e=t.getAttributes(),n=new Map;for(let t=0;t<e.length;t++){const i=e[t],r=i.array.BYTES_PER_ELEMENT,s=this._getBufferAttribute(i);let a=n.get(s);if(void 0===a){let t,e;!0===i.isInterleavedBufferAttribute?(t=i.data.stride*r,e=i.data.isInstancedInterleavedBuffer?ck:hk):(t=i.itemSize*r,e=i.isInstancedBufferAttribute?ck:hk),!1!==i.normalized||i.array.constructor!==Int16Array&&i.array.constructor!==Uint16Array||(t=4),a={arrayStride:t,attributes:[],stepMode:e},n.set(s,a)}const o=this._getVertexFormat(i),l=!0===i.isInterleavedBufferAttribute?i.offset*r:0;a.attributes.push({shaderLocation:t,offset:l,format:o})}return Array.from(n.values())}destroyAttribute(t){const e=this.backend;e.get(this._getBufferAttribute(t)).buffer.destroy(),e.delete(t)}async getArrayBufferAsync(t){const e=this.backend,n=e.device,i=e.get(this._getBufferAttribute(t)).buffer,r=i.size,s=n.createBuffer({label:t.name,size:r,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),a=n.createCommandEncoder({});a.copyBufferToBuffer(i,0,s,0,r),s.unmap();const o=a.finish();n.queue.submit([o]),await s.mapAsync(GPUMapMode.READ);return s.getMappedRange()}_getVertexFormat(t){const{itemSize:e,normalized:n}=t,i=t.array.constructor,r=t.constructor;let s;if(1==e)s=eG.get(i);else{const t=(tG.get(r)||Jq.get(i))[n?1:0];if(t){const n=i.BYTES_PER_ELEMENT*e,r=4*Math.floor((n+3)/4)/i.BYTES_PER_ELEMENT;if(r%1)throw new Error("THREE.WebGPUAttributeUtils: Bad vertex format item size.");s=`${t}x${r}`}}return s||console.error("THREE.WebGPUAttributeUtils: Vertex format not supported yet."),s}_getBufferAttribute(t){return t.isInterleavedBufferAttribute&&(t=t.data),t}}class iG{constructor(t){this.backend=t,this.bindGroupLayoutCache=new WeakMap}createBindingsLayout(t){const e=this.backend.device,n=[];let i=0;for(const e of t.bindings){const t={binding:i++,visibility:e.visibility};if(e.isUniformBuffer||e.isStorageBuffer){const n={};e.isStorageBuffer&&(n.type=e.access),t.buffer=n}else if(e.isSampler){const n={};e.texture.isDepthTexture&&null!==e.texture.compareFunction&&(n.type="comparison"),t.sampler=n}else if(e.isSampledTexture&&e.texture.isVideoTexture)t.externalTexture={};else if(e.isSampledTexture&&e.store){const n=this.backend.get(e.texture).texture.format,i=e.access;t.storageTexture={format:n,access:i}}else if(e.isSampledTexture){const n={};if(!0===e.texture.isMultisampleRenderTargetTexture&&(n.multisampled=!0),e.texture.isDepthTexture)n.sampleType=tk;else if(e.texture.isDataTexture||e.texture.isDataArrayTexture||e.texture.isData3DTexture){const t=e.texture.type;t===Ux?n.sampleType=ek:t===Ox?n.sampleType=nk:t===Fx&&(this.backend.hasFeature("float32-filterable")?n.sampleType=KF:n.sampleType=JF)}e.isSampledCubeTexture?n.viewDimension=ok:e.texture.isDataArrayTexture||e.texture.isCompressedArrayTexture?n.viewDimension=ak:e.isSampledTexture3D&&(n.viewDimension=lk),t.texture=n}else console.error(`WebGPUBindingUtils: Unsupported binding "${e}".`);n.push(t)}return e.createBindGroupLayout({entries:n})}createBindings(t){const{backend:e,bindGroupLayoutCache:n}=this,i=e.get(t);let r=n.get(t.bindingsReference);void 0===r&&(r=this.createBindingsLayout(t),n.set(t.bindingsReference,r));const s=this.createBindGroup(t,r);i.layout=r,i.group=s}updateBinding(t){const e=this.backend,n=e.device,i=t.buffer,r=e.get(t).buffer;n.queue.writeBuffer(r,0,i,0)}createBindGroup(t,e){const n=this.backend,i=n.device;let r=0;const s=[];for(const e of t.bindings){if(e.isUniformBuffer){const t=n.get(e);if(void 0===t.buffer){const n=e.byteLength,r=GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST,s=i.createBuffer({label:"bindingBuffer_"+e.name,size:n,usage:r});t.buffer=s}s.push({binding:r,resource:{buffer:t.buffer}})}else if(e.isStorageBuffer){const t=n.get(e);if(void 0===t.buffer){const i=e.attribute;t.buffer=n.get(i).buffer}s.push({binding:r,resource:{buffer:t.buffer}})}else if(e.isSampler){const t=n.get(e.texture);s.push({binding:r,resource:t.sampler})}else if(e.isSampledTexture){const t=n.get(e.texture);let a;if(void 0!==t.externalTexture)a=i.importExternalTexture({source:t.externalTexture});else{const n=e.store?1:t.texture.mipLevelCount,i=`view-${t.texture.width}-${t.texture.height}-${n}`;if(a=t[i],void 0===a){const r=uk;let s;s=e.isSampledCubeTexture?ok:e.isSampledTexture3D?lk:e.texture.isDataArrayTexture||e.texture.isCompressedArrayTexture?ak:sk,a=t[i]=t.texture.createView({aspect:r,dimension:s,mipLevelCount:n})}}s.push({binding:r,resource:a})}r++}return i.createBindGroup({label:"bindGroup_"+t.name,layout:e,entries:s})}}class rG{constructor(t){this.backend=t}_getSampleCount(t){return this.backend.utils.getSampleCountRenderContext(t)}createRenderPipeline(t,e){const{object:n,material:i,geometry:r,pipeline:s}=t,{vertexProgram:a,fragmentProgram:o}=s,l=this.backend,u=l.device,h=l.utils,c=l.get(s),A=[];for(const e of t.getBindings()){const t=l.get(e);A.push(t.layout)}const d=l.attributeUtils.createShaderVertexBuffers(t);let p;!0===i.transparent&&0!==i.blending&&(p=this._getBlending(i));let f={};!0===i.stencilWrite&&(f={compare:this._getStencilCompare(i),failOp:this._getStencilOperation(i.stencilFail),depthFailOp:this._getStencilOperation(i.stencilZFail),passOp:this._getStencilOperation(i.stencilZPass)});const m=this._getColorWriteMask(i),g=[];if(null!==t.context.textures){const e=t.context.textures;for(let t=0;t<e.length;t++){const n=h.getTextureFormatGPU(e[t]);g.push({format:n,blend:p,writeMask:m})}}else{const e=h.getCurrentColorFormat(t.context);g.push({format:e,blend:p,writeMask:m})}const y=l.get(a).module,v=l.get(o).module,_=this._getPrimitiveState(n,r,i),x=this._getDepthCompare(i),b=h.getCurrentDepthStencilFormat(t.context),S=this._getSampleCount(t.context),M={label:`renderPipeline_${i.name||i.type}_${i.id}`,vertex:Object.assign({},y,{buffers:d}),fragment:Object.assign({},v,{targets:g}),primitive:_,depthStencil:{format:b,depthWriteEnabled:i.depthWrite,depthCompare:x,stencilFront:f,stencilBack:{},stencilReadMask:i.stencilFuncMask,stencilWriteMask:i.stencilWriteMask},multisample:{count:S,alphaToCoverageEnabled:i.alphaToCoverage&&S>1},layout:u.createPipelineLayout({bindGroupLayouts:A})};if(null===e)c.pipeline=u.createRenderPipeline(M);else{const t=new Promise((t=>{u.createRenderPipelineAsync(M).then((e=>{c.pipeline=e,t()}))}));e.push(t)}}createBundleEncoder(t){const e=this.backend,{utils:n,device:i}=e,r=n.getCurrentDepthStencilFormat(t),s={label:"renderBundleEncoder",colorFormats:[n.getCurrentColorFormat(t)],depthStencilFormat:r,sampleCount:this._getSampleCount(t)};return i.createRenderBundleEncoder(s)}createComputePipeline(t,e){const n=this.backend,i=n.device,r=n.get(t.computeProgram).module,s=n.get(t),a=[];for(const t of e){const e=n.get(t);a.push(e.layout)}s.pipeline=i.createComputePipeline({compute:r,layout:i.createPipelineLayout({bindGroupLayouts:a})})}_getBlending(t){let e,n;const i=t.blending,r=t.blendSrc,s=t.blendDst,a=t.blendEquation;if(5===i){const i=null!==t.blendSrcAlpha?t.blendSrcAlpha:r,o=null!==t.blendDstAlpha?t.blendDstAlpha:s,l=null!==t.blendEquationAlpha?t.blendEquationAlpha:a;e={srcFactor:this._getBlendFactor(r),dstFactor:this._getBlendFactor(s),operation:this._getBlendOperation(a)},n={srcFactor:this._getBlendFactor(i),dstFactor:this._getBlendFactor(o),operation:this._getBlendOperation(l)}}else{const r=(t,i,r,s)=>{e={srcFactor:t,dstFactor:i,operation:IF},n={srcFactor:r,dstFactor:s,operation:IF}};if(t.premultipliedAlpha)switch(i){case 1:r(xF,wF,xF,wF);break;case 2:r(xF,xF,xF,xF);break;case 3:r(_F,SF,_F,xF);break;case 4:r(_F,bF,_F,MF)}else switch(i){case 1:r(MF,wF,xF,wF);break;case 2:r(MF,xF,MF,xF);break;case 3:r(_F,SF,_F,xF);break;case 4:r(_F,bF,_F,bF)}}if(void 0!==e&&void 0!==n)return{color:e,alpha:n};console.error("THREE.WebGPURenderer: Invalid blending: ",i)}_getBlendFactor(t){let e;switch(t){case 200:e=_F;break;case 201:e=xF;break;case 202:e=bF;break;case 203:e=SF;break;case Ax:e=MF;break;case dx:e=wF;break;case 208:e=TF;break;case 209:e=EF;break;case 206:e=CF;break;case 207:e=RF;break;case 210:e=NF;break;case 211:e=PF;break;case 212:e=DF;break;default:console.error("THREE.WebGPURenderer: Blend factor not supported.",t)}return e}_getStencilCompare(t){let e;const n=t.stencilFunc;switch(n){case 512:e=ZO;break;case 519:e=rF;break;case 513:e=KO;break;case 515:e=tF;break;case 514:e=JO;break;case 518:e=iF;break;case 516:e=eF;break;case 517:e=nF;break;default:console.error("THREE.WebGPURenderer: Invalid stencil function.",n)}return e}_getStencilOperation(t){let e;switch(t){case wb:e=zF;break;case 0:e=qF;break;case 7681:e=GF;break;case 5386:e=VF;break;case 7682:e=HF;break;case 7683:e=jF;break;case 34055:e=WF;break;case 34056:e=XF;break;default:console.error("THREE.WebGPURenderer: Invalid stencil operation.",e)}return e}_getBlendOperation(t){let e;switch(t){case sx:e=IF;break;case 101:e=LF;break;case 102:e=BF;break;case 103:e=UF;break;case 104:e=OF;break;default:console.error("THREE.WebGPUPipelineUtils: Blend equation not supported.",t)}return e}_getPrimitiveState(t,e,n){const i={},r=this.backend.utils;switch(i.topology=r.getPrimitiveTopology(t,n),null!==e.index&&!0===t.isLine&&!0!==t.isLineSegments&&(i.stripIndexFormat=e.index.array instanceof Uint16Array?AF:dF),n.side){case 0:i.frontFace=lF,i.cullMode=cF;break;case 1:i.frontFace=lF,i.cullMode=hF;break;case 2:i.frontFace=lF,i.cullMode=uF;break;default:console.error("THREE.WebGPUPipelineUtils: Unknown material.side value.",n.side)}return i}_getColorWriteMask(t){return!0===t.colorWrite?kF:FF}_getDepthCompare(t){let e;if(!1===t.depthTest)e=rF;else{const n=t.depthFunc;switch(n){case 0:e=ZO;break;case 1:e=rF;break;case 2:e=KO;break;case 3:e=tF;break;case 4:e=JO;break;case 5:e=iF;break;case 6:e=eF;break;case 7:e=nF;break;default:console.error("THREE.WebGPUPipelineUtils: Invalid depth function.",n)}}return e}}class sG extends uq{constructor(t={}){super(t),this.isWebGPUBackend=!0,this.parameters.alpha=void 0===t.alpha||t.alpha,this.parameters.requiredLimits=void 0===t.requiredLimits?{}:t.requiredLimits,this.trackTimestamp=!0===t.trackTimestamp,this.device=null,this.context=null,this.colorBuffer=null,this.defaultRenderPassdescriptor=null,this.utils=new Kq(this),this.attributeUtils=new nG(this),this.bindingUtils=new iG(this),this.pipelineUtils=new rG(this),this.textureUtils=new Uq(this),this.occludedResolveCache=new Map}async init(t){await super.init(t);const e=this.parameters;let n;if(void 0===e.device){const t={powerPreference:e.powerPreference},i=await navigator.gpu.requestAdapter(t);if(null===i)throw new Error("WebGPUBackend: Unable to create WebGPU adapter.");const r=Object.values(Ak),s=[];for(const t of r)i.features.has(t)&&s.push(t);const a={requiredFeatures:s,requiredLimits:e.requiredLimits};n=await i.requestDevice(a)}else n=e.device;const i=void 0!==e.context?e.context:t.domElement.getContext("webgpu");this.device=n,this.context=i;const r=e.alpha?"premultiplied":"opaque";this.trackTimestamp=this.trackTimestamp&&this.hasFeature(Ak.TimestampQuery),this.context.configure({device:this.device,format:this.utils.getPreferredCanvasFormat(),usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,alphaMode:r}),this.updateSize()}get coordinateSystem(){return Ob}async getArrayBufferAsync(t){return await this.attributeUtils.getArrayBufferAsync(t)}getContext(){return this.context}_getDefaultRenderPassDescriptor(){let t=this.defaultRenderPassdescriptor;if(null===t){const e=this.renderer;t={colorAttachments:[{view:null}],depthStencilAttachment:{view:this.textureUtils.getDepthBuffer(e.depth,e.stencil).createView()}};const n=t.colorAttachments[0];this.renderer.samples>0?n.view=this.colorBuffer.createView():n.resolveTarget=void 0,this.defaultRenderPassdescriptor=t}const e=t.colorAttachments[0];return this.renderer.samples>0?e.resolveTarget=this.context.getCurrentTexture().createView():e.view=this.context.getCurrentTexture().createView(),t}_getRenderPassDescriptor(t){const e=t.renderTarget,n=this.get(e);let i=n.descriptors;if(void 0===i||n.width!==e.width||n.height!==e.height||n.activeMipmapLevel!==e.activeMipmapLevel||n.samples!==e.samples){i={},n.descriptors=i;const t=()=>{e.removeEventListener("dispose",t),this.delete(e)};e.addEventListener("dispose",t)}const r=t.getCacheKey();let s=i[r];if(void 0===s){const a=t.textures,o=[];for(let e=0;e<a.length;e++){const n=this.get(a[e]),i=n.texture.createView({baseMipLevel:t.activeMipmapLevel,mipLevelCount:1,baseArrayLayer:t.activeCubeFace,dimension:sk});let r,s;void 0!==n.msaaTexture?(r=n.msaaTexture.createView(),s=i):(r=i,s=void 0),o.push({view:r,resolveTarget:s,loadOp:aF,storeOp:sF})}s={colorAttachments:o,depthStencilAttachment:{view:this.get(t.depthTexture).texture.createView()}},i[r]=s,n.width=e.width,n.height=e.height,n.samples=e.samples,n.activeMipmapLevel=e.activeMipmapLevel}return s}beginRender(t){const e=this.get(t),n=this.device,i=t.occlusionQueryCount;let r,s;i>0&&(e.currentOcclusionQuerySet&&e.currentOcclusionQuerySet.destroy(),e.currentOcclusionQueryBuffer&&e.currentOcclusionQueryBuffer.destroy(),e.currentOcclusionQuerySet=e.occlusionQuerySet,e.currentOcclusionQueryBuffer=e.occlusionQueryBuffer,e.currentOcclusionQueryObjects=e.occlusionQueryObjects,r=n.createQuerySet({type:"occlusion",count:i}),e.occlusionQuerySet=r,e.occlusionQueryIndex=0,e.occlusionQueryObjects=new Array(i),e.lastOcclusionObject=null),s=null===t.textures?this._getDefaultRenderPassDescriptor():this._getRenderPassDescriptor(t),this.initTimestampQuery(t,s),s.occlusionQuerySet=r;const a=s.depthStencilAttachment;if(null!==t.textures){const e=s.colorAttachments;for(let n=0;n<e.length;n++){const i=e[n];t.clearColor?(i.clearValue=0===n?t.clearColorValue:{r:0,g:0,b:0,a:1},i.loadOp=oF,i.storeOp=sF):(i.loadOp=aF,i.storeOp=sF)}}else{const e=s.colorAttachments[0];t.clearColor?(e.clearValue=t.clearColorValue,e.loadOp=oF,e.storeOp=sF):(e.loadOp=aF,e.storeOp=sF)}t.depth&&(t.clearDepth?(a.depthClearValue=t.clearDepthValue,a.depthLoadOp=oF,a.depthStoreOp=sF):(a.depthLoadOp=aF,a.depthStoreOp=sF)),t.stencil&&(t.clearStencil?(a.stencilClearValue=t.clearStencilValue,a.stencilLoadOp=oF,a.stencilStoreOp=sF):(a.stencilLoadOp=aF,a.stencilStoreOp=sF));const o=n.createCommandEncoder({label:"renderContext_"+t.id}),l=o.beginRenderPass(s);if(e.descriptor=s,e.encoder=o,e.currentPass=l,e.currentSets={attributes:{},bindingGroups:[],pipeline:null,index:null},e.renderBundles=[],t.viewport&&this.updateViewport(t),t.scissor){const{x:e,y:n,width:i,height:r}=t.scissorValue;l.setScissorRect(e,n,i,r)}}finishRender(t){const e=this.get(t),n=t.occlusionQueryCount;if(e.renderBundles.length>0&&e.currentPass.executeBundles(e.renderBundles),n>e.occlusionQueryIndex&&e.currentPass.endOcclusionQuery(),e.currentPass.end(),n>0){const i=8*n;let r=this.occludedResolveCache.get(i);void 0===r&&(r=this.device.createBuffer({size:i,usage:GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC}),this.occludedResolveCache.set(i,r));const s=this.device.createBuffer({size:i,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});e.encoder.resolveQuerySet(e.occlusionQuerySet,0,n,r,0),e.encoder.copyBufferToBuffer(r,0,s,0,i),e.occlusionQueryBuffer=s,this.resolveOccludedAsync(t)}if(this.prepareTimestampBuffer(t,e.encoder),this.device.queue.submit([e.encoder.finish()]),null!==t.textures){const e=t.textures;for(let t=0;t<e.length;t++){const n=e[t];!0===n.generateMipmaps&&this.textureUtils.generateMipmaps(n)}}}isOccluded(t,e){const n=this.get(t);return n.occluded&&n.occluded.has(e)}async resolveOccludedAsync(t){const e=this.get(t),{currentOcclusionQueryBuffer:n,currentOcclusionQueryObjects:i}=e;if(n&&i){const t=new WeakSet;e.currentOcclusionQueryObjects=null,e.currentOcclusionQueryBuffer=null,await n.mapAsync(GPUMapMode.READ);const r=n.getMappedRange(),s=new BigUint64Array(r);for(let e=0;e<i.length;e++)s[e]!==BigInt(0)&&t.add(i[e]);n.destroy(),e.occluded=t}}updateViewport(t){const{currentPass:e}=this.get(t),{x:n,y:i,width:r,height:s,minDepth:a,maxDepth:o}=t.viewportValue;e.setViewport(n,i,r,s,a,o)}clear(t,e,n,i=null){const r=this.device,s=this.renderer;let a,o,l,u,h=[];if(t){const t=this.getClearColor();if(!0===this.renderer.alpha){const e=t.a;o={r:t.r*e,g:t.g*e,b:t.b*e,a:e}}else o={r:t.r,g:t.g,b:t.b,a:t.a}}if(null===i){l=s.depth,u=s.stencil;const e=this._getDefaultRenderPassDescriptor();if(t){h=e.colorAttachments;const t=h[0];t.clearValue=o,t.loadOp=oF,t.storeOp=sF}(l||u)&&(a=e.depthStencilAttachment)}else{if(l=i.depth,u=i.stencil,t)for(const t of i.textures){const e=this.get(t),n=e.texture.createView();let i,r;void 0!==e.msaaTexture?(i=e.msaaTexture.createView(),r=n):(i=n,r=void 0),h.push({view:i,resolveTarget:r,clearValue:o,loadOp:oF,storeOp:sF})}if(l||u){a={view:this.get(i.depthTexture).texture.createView()}}}l&&(e?(a.depthLoadOp=oF,a.depthClearValue=s.getClearDepth(),a.depthStoreOp=sF):(a.depthLoadOp=aF,a.depthStoreOp=sF)),u&&(n?(a.stencilLoadOp=oF,a.stencilClearValue=s.getClearStencil(),a.stencilStoreOp=sF):(a.stencilLoadOp=aF,a.stencilStoreOp=sF));const c=r.createCommandEncoder({});c.beginRenderPass({colorAttachments:h,depthStencilAttachment:a}).end(),r.queue.submit([c.finish()])}beginCompute(t){const e=this.get(t),n={};this.initTimestampQuery(t,n),e.cmdEncoderGPU=this.device.createCommandEncoder(),e.passEncoderGPU=e.cmdEncoderGPU.beginComputePass(n)}compute(t,e,n,i){const{passEncoderGPU:r}=this.get(t),s=this.get(i).pipeline;r.setPipeline(s);for(let t=0,e=n.length;t<e;t++){const e=n[t],i=this.get(e);r.setBindGroup(t,i.group)}const a=this.device.limits.maxComputeWorkgroupsPerDimension,o=this.get(e);void 0===o.dispatchSize&&(o.dispatchSize={x:0,y:1,z:1});const{dispatchSize:l}=o;e.dispatchCount>a?(l.x=Math.min(e.dispatchCount,a),l.y=Math.ceil(e.dispatchCount/a)):l.x=e.dispatchCount,r.dispatchWorkgroups(l.x,l.y,l.z)}finishCompute(t){const e=this.get(t);e.passEncoderGPU.end(),this.prepareTimestampBuffer(t,e.cmdEncoderGPU),this.device.queue.submit([e.cmdEncoderGPU.finish()])}draw(t,e){const{object:n,context:i,pipeline:r}=t,s=t.getBindings(),a=this.get(i),o=this.get(r).pipeline,l=a.currentSets,u=a.currentPass,h=t.getDrawParameters();if(null===h)return;l.pipeline!==o&&(u.setPipeline(o),l.pipeline=o);const c=l.bindingGroups;for(let t=0,e=s.length;t<e;t++){const e=s[t],n=this.get(e);c[e.index]!==e.id&&(u.setBindGroup(e.index,n.group),c[e.index]=e.id)}const A=t.getIndex(),d=null!==A;if(!0===d&&l.index!==A){const t=this.get(A).buffer,e=A.array instanceof Uint16Array?AF:dF;u.setIndexBuffer(t,e),l.index=A}const p=t.getVertexBuffers();for(let t=0,e=p.length;t<e;t++){const e=p[t];if(l.attributes[t]!==e){const n=this.get(e).buffer;u.setVertexBuffer(t,n),l.attributes[t]=e}}if(void 0!==a.occlusionQuerySet){const t=a.lastOcclusionObject;t!==n&&(null!==t&&!0===t.occlusionTest&&(u.endOcclusionQuery(),a.occlusionQueryIndex++),!0===n.occlusionTest&&(u.beginOcclusionQuery(a.occlusionQueryIndex),a.occlusionQueryObjects[a.occlusionQueryIndex]=n),a.lastOcclusionObject=n)}if(!0===n.isBatchedMesh){const t=n._multiDrawStarts,e=n._multiDrawCounts,i=n._multiDrawCount,r=n._multiDrawInstances,s=d?A.array.BYTES_PER_ELEMENT:1;for(let n=0;n<i;n++){const i=r?r[n]:1,a=i>1?0:n;u.drawIndexed(e[n],i,t[n]/s,0,a)}}else if(!0===d){const{vertexCount:t,instanceCount:i,firstVertex:r}=h;u.drawIndexed(t,i,r,0,0),e.update(n,t,i)}else{const{vertexCount:t,instanceCount:i,firstVertex:r}=h;u.draw(t,i,r,0),e.update(n,t,i)}}needsRenderUpdate(t){const e=this.get(t),{object:n,material:i}=t,r=this.utils,s=r.getSampleCountRenderContext(t.context),a=r.getCurrentColorSpace(t.context),o=r.getCurrentColorFormat(t.context),l=r.getCurrentDepthStencilFormat(t.context),u=r.getPrimitiveTopology(n,i);let h=!1;return e.material===i&&e.materialVersion===i.version&&e.transparent===i.transparent&&e.blending===i.blending&&e.premultipliedAlpha===i.premultipliedAlpha&&e.blendSrc===i.blendSrc&&e.blendDst===i.blendDst&&e.blendEquation===i.blendEquation&&e.blendSrcAlpha===i.blendSrcAlpha&&e.blendDstAlpha===i.blendDstAlpha&&e.blendEquationAlpha===i.blendEquationAlpha&&e.colorWrite===i.colorWrite&&e.depthWrite===i.depthWrite&&e.depthTest===i.depthTest&&e.depthFunc===i.depthFunc&&e.stencilWrite===i.stencilWrite&&e.stencilFunc===i.stencilFunc&&e.stencilFail===i.stencilFail&&e.stencilZFail===i.stencilZFail&&e.stencilZPass===i.stencilZPass&&e.stencilFuncMask===i.stencilFuncMask&&e.stencilWriteMask===i.stencilWriteMask&&e.side===i.side&&e.alphaToCoverage===i.alphaToCoverage&&e.sampleCount===s&&e.colorSpace===a&&e.colorFormat===o&&e.depthStencilFormat===l&&e.primitiveTopology===u&&e.clippingContextCacheKey===t.clippingContext.cacheKey||(e.material=i,e.materialVersion=i.version,e.transparent=i.transparent,e.blending=i.blending,e.premultipliedAlpha=i.premultipliedAlpha,e.blendSrc=i.blendSrc,e.blendDst=i.blendDst,e.blendEquation=i.blendEquation,e.blendSrcAlpha=i.blendSrcAlpha,e.blendDstAlpha=i.blendDstAlpha,e.blendEquationAlpha=i.blendEquationAlpha,e.colorWrite=i.colorWrite,e.depthWrite=i.depthWrite,e.depthTest=i.depthTest,e.depthFunc=i.depthFunc,e.stencilWrite=i.stencilWrite,e.stencilFunc=i.stencilFunc,e.stencilFail=i.stencilFail,e.stencilZFail=i.stencilZFail,e.stencilZPass=i.stencilZPass,e.stencilFuncMask=i.stencilFuncMask,e.stencilWriteMask=i.stencilWriteMask,e.side=i.side,e.alphaToCoverage=i.alphaToCoverage,e.sampleCount=s,e.colorSpace=a,e.colorFormat=o,e.depthStencilFormat=l,e.primitiveTopology=u,e.clippingContextCacheKey=t.clippingContext.cacheKey,h=!0),h}getRenderCacheKey(t){const{object:e,material:n}=t,i=this.utils,r=t.context;return[n.transparent,n.blending,n.premultipliedAlpha,n.blendSrc,n.blendDst,n.blendEquation,n.blendSrcAlpha,n.blendDstAlpha,n.blendEquationAlpha,n.colorWrite,n.depthWrite,n.depthTest,n.depthFunc,n.stencilWrite,n.stencilFunc,n.stencilFail,n.stencilZFail,n.stencilZPass,n.stencilFuncMask,n.stencilWriteMask,n.side,i.getSampleCountRenderContext(r),i.getCurrentColorSpace(r),i.getCurrentColorFormat(r),i.getCurrentDepthStencilFormat(r),i.getPrimitiveTopology(e,n),t.clippingContext.cacheKey].join()}createSampler(t){this.textureUtils.createSampler(t)}destroySampler(t){this.textureUtils.destroySampler(t)}createDefaultTexture(t){this.textureUtils.createDefaultTexture(t)}createTexture(t,e){this.textureUtils.createTexture(t,e)}updateTexture(t,e){this.textureUtils.updateTexture(t,e)}generateMipmaps(t){this.textureUtils.generateMipmaps(t)}destroyTexture(t){this.textureUtils.destroyTexture(t)}copyTextureToBuffer(t,e,n,i,r,s){return this.textureUtils.copyTextureToBuffer(t,e,n,i,r,s)}initTimestampQuery(t,e){if(!this.trackTimestamp)return;const n=this.get(t);if(!n.timeStampQuerySet){const t=this.device.createQuerySet({type:"timestamp",count:2}),i={querySet:t,beginningOfPassWriteIndex:0,endOfPassWriteIndex:1};Object.assign(e,{timestampWrites:i}),n.timeStampQuerySet=t}}prepareTimestampBuffer(t,e){if(!this.trackTimestamp)return;const n=this.get(t),i=2*BigInt64Array.BYTES_PER_ELEMENT;void 0===n.currentTimestampQueryBuffers&&(n.currentTimestampQueryBuffers={resolveBuffer:this.device.createBuffer({label:"timestamp resolve buffer",size:i,usage:GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC}),resultBuffer:this.device.createBuffer({label:"timestamp result buffer",size:i,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),isMappingPending:!1});const{resolveBuffer:r,resultBuffer:s,isMappingPending:a}=n.currentTimestampQueryBuffers;!0!==a&&(e.resolveQuerySet(n.timeStampQuerySet,0,2,r,0),e.copyBufferToBuffer(r,0,s,0,i))}async resolveTimestampAsync(t,e="render"){if(!this.trackTimestamp)return;const n=this.get(t);if(void 0===n.currentTimestampQueryBuffers)return;const{resultBuffer:i,isMappingPending:r}=n.currentTimestampQueryBuffers;!0!==r&&(n.currentTimestampQueryBuffers.isMappingPending=!0,i.mapAsync(GPUMapMode.READ).then((()=>{const t=new BigUint64Array(i.getMappedRange()),r=Number(t[1]-t[0])/1e6;this.renderer.info.updateTimestamp(e,r),i.unmap(),n.currentTimestampQueryBuffers.isMappingPending=!1})))}createNodeBuilder(t,e){return new Zq(t,e)}createProgram(t){this.get(t).module={module:this.device.createShaderModule({code:t.code,label:t.stage}),entryPoint:"main"}}destroyProgram(t){this.delete(t)}createRenderPipeline(t,e){this.pipelineUtils.createRenderPipeline(t,e)}createComputePipeline(t,e){this.pipelineUtils.createComputePipeline(t,e)}beginBundle(t){const e=this.get(t);e._currentPass=e.currentPass,e._currentSets=e.currentSets,e.currentSets={attributes:{},bindingGroups:[],pipeline:null,index:null},e.currentPass=this.pipelineUtils.createBundleEncoder(t)}finishBundle(t,e){const n=this.get(t),i=n.currentPass.finish();this.get(e).bundleGPU=i,n.currentSets=n._currentSets,n.currentPass=n._currentPass}addBundle(t,e){this.get(t).renderBundles.push(this.get(e).bundleGPU)}createBindings(t){this.bindingUtils.createBindings(t)}updateBindings(t){this.bindingUtils.createBindings(t)}updateBinding(t){this.bindingUtils.updateBinding(t)}createIndexAttribute(t){this.attributeUtils.createAttribute(t,GPUBufferUsage.INDEX|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST)}createAttribute(t){this.attributeUtils.createAttribute(t,GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST)}createStorageAttribute(t){this.attributeUtils.createAttribute(t,GPUBufferUsage.STORAGE|GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST)}updateAttribute(t){this.attributeUtils.updateAttribute(t)}destroyAttribute(t){this.attributeUtils.destroyAttribute(t)}updateSize(){this.colorBuffer=this.textureUtils.getColorBuffer(),this.defaultRenderPassdescriptor=null}getMaxAnisotropy(){return 16}hasFeature(t){return this.device.features.has(t)}copyTextureToTexture(t,e,n=null,i=null,r=0){let s=0,a=0,o=0,l=0,u=0,h=0,c=t.image.width,A=t.image.height;null!==n&&(l=n.x,u=n.y,h=n.z||0,c=n.width,A=n.height),null!==i&&(s=i.x,a=i.y,o=i.z||0);const d=this.device.createCommandEncoder({label:"copyTextureToTexture_"+t.id+"_"+e.id}),p=this.get(t).texture,f=this.get(e).texture;d.copyTextureToTexture({texture:p,mipLevel:r,origin:{x:l,y:u,z:h}},{texture:f,mipLevel:r,origin:{x:s,y:a,z:o}},[c,A,1]),this.device.queue.submit([d.finish()])}copyFramebufferToTexture(t,e,n){const i=this.get(e),{encoder:r,descriptor:s}=i;let a=null;a=e.renderTarget?t.isDepthTexture?this.get(e.depthTexture).texture:this.get(e.textures[0]).texture:t.isDepthTexture?this.textureUtils.getDepthBuffer(e.depth,e.stencil):this.context.getCurrentTexture();const o=this.get(t).texture;if(a.format===o.format){i.currentPass.end(),r.copyTextureToTexture({texture:a,origin:{x:n.x,y:n.y,z:0}},{texture:o},[n.z,n.w]),t.generateMipmaps&&this.textureUtils.generateMipmaps(t);for(let t=0;t<s.colorAttachments.length;t++)s.colorAttachments[t].loadOp=aF;e.depth&&(s.depthStencilAttachment.depthLoadOp=aF),e.stencil&&(s.depthStencilAttachment.stencilLoadOp=aF),i.currentPass=r.beginRenderPass(s),i.currentSets={attributes:{},bindingGroups:[],pipeline:null,index:null}}else console.error("WebGPUBackend: copyFramebufferToTexture: Source and destination formats do not match.",a.format,o.format)}}class aG extends yT{constructor(t,e,n,i,r,s){super(t,e,n,i,r,s),this.iesMap=null}copy(t,e){return super.copy(t,e),this.iesMap=t.iesMap,this}}class oG extends Lz{constructor(){super(),this.addMaterial(ML,sT),this.addMaterial(HB,iT),this.addMaterial(WB,rT),this.addMaterial($B,aT),this.addMaterial(fL,WM),this.addMaterial(bL,lT),this.addMaterial(eL,oT),this.addMaterial(tU,uT),this.addMaterial(ZI,Zw),this.addMaterial(JI,hT),this.addMaterial(nU,Kw),this.addMaterial(aU,qw),this.addMaterial(uU,nT),this.addLight(Kk,ST),this.addLight(Jk,TT),this.addLight(iz,CT),this.addLight(rz,yT),this.addLight(az,ET),this.addLight(oz,AT),this.addLight(lz,NT),this.addLight(sz,aG),this.addToneMapping(zk,1),this.addToneMapping(qk,2),this.addToneMapping(Gk,3),this.addToneMapping(Hk,4),this.addToneMapping(Yk,6),this.addToneMapping(Qk,7),this.addColorSpace(kk,DN(vb,yb)),this.addColorSpace(Fk,DN(yb,vb))}}class lG extends qz{constructor(t={}){let e;t.forceWebGL?e=Eq:(e=sG,t.getFallback=()=>(console.warn("THREE.WebGPURenderer: WebGPU is not available, running under WebGL2 backend."),new Eq(t)));super(new e(t),t),this.nodes.library=new oG,this.isWebGPURenderer=!0}}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:rx}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=rx);const uG={type:"change"},hG={type:"start"},cG={type:"end"},AG=1e-6,dG=-1,pG=0,fG=1,mG=2,gG=3,yG=4,vG=new Ee,_G=new Ee,xG=new en,bG=new en,SG=new en,MG=new tn,wG=new en,TG=new en,EG=new en,CG=new en;class RG extends ru{constructor(t,e=null){super(t,e),this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.keys=["KeyA","KeyS","KeyD"],this.mouseButtons={LEFT:a.ROTATE,MIDDLE:a.DOLLY,RIGHT:a.PAN},this.state=dG,this.keyState=dG,this.target=new en,this._lastPosition=new en,this._lastZoom=1,this._touchZoomDistanceStart=0,this._touchZoomDistanceEnd=0,this._lastAngle=0,this._eye=new en,this._movePrev=new Ee,this._moveCurr=new Ee,this._lastAxis=new en,this._zoomStart=new Ee,this._zoomEnd=new Ee,this._panStart=new Ee,this._panEnd=new Ee,this._pointers=[],this._pointerPositions={},this._onPointerMove=PG.bind(this),this._onPointerDown=NG.bind(this),this._onPointerUp=DG.bind(this),this._onPointerCancel=IG.bind(this),this._onContextMenu=zG.bind(this),this._onMouseWheel=kG.bind(this),this._onKeyDown=BG.bind(this),this._onKeyUp=LG.bind(this),this._onTouchStart=qG.bind(this),this._onTouchMove=GG.bind(this),this._onTouchEnd=VG.bind(this),this._onMouseDown=UG.bind(this),this._onMouseMove=OG.bind(this),this._onMouseUp=FG.bind(this),this._target0=this.target.clone(),this._position0=this.object.position.clone(),this._up0=this.object.up.clone(),this._zoom0=this.object.zoom,null!==e&&(this.connect(),this.handleResize()),this.update()}connect(){window.addEventListener("keydown",this._onKeyDown),window.addEventListener("keyup",this._onKeyUp),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerCancel),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="none"}disconnect(){window.removeEventListener("keydown",this._onKeyDown),window.removeEventListener("keyup",this._onKeyUp),this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerCancel),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}handleResize(){const t=this.domElement.getBoundingClientRect(),e=this.domElement.ownerDocument.documentElement;this.screen.left=t.left+window.pageXOffset-e.clientLeft,this.screen.top=t.top+window.pageYOffset-e.clientTop,this.screen.width=t.width,this.screen.height=t.height}update(){this._eye.subVectors(this.object.position,this.target),this.noRotate||this._rotateCamera(),this.noZoom||this._zoomCamera(),this.noPan||this._panCamera(),this.object.position.addVectors(this.target,this._eye),this.object.isPerspectiveCamera?(this._checkDistances(),this.object.lookAt(this.target),this._lastPosition.distanceToSquared(this.object.position)>AG&&(this.dispatchEvent(uG),this._lastPosition.copy(this.object.position))):this.object.isOrthographicCamera?(this.object.lookAt(this.target),(this._lastPosition.distanceToSquared(this.object.position)>AG||this._lastZoom!==this.object.zoom)&&(this.dispatchEvent(uG),this._lastPosition.copy(this.object.position),this._lastZoom=this.object.zoom)):console.warn("THREE.TrackballControls: Unsupported camera type.")}reset(){this.state=dG,this.keyState=dG,this.target.copy(this._target0),this.object.position.copy(this._position0),this.object.up.copy(this._up0),this.object.zoom=this._zoom0,this.object.updateProjectionMatrix(),this._eye.subVectors(this.object.position,this.target),this.object.lookAt(this.target),this.dispatchEvent(uG),this._lastPosition.copy(this.object.position),this._lastZoom=this.object.zoom}_panCamera(){if(_G.copy(this._panEnd).sub(this._panStart),_G.lengthSq()){if(this.object.isOrthographicCamera){const t=(this.object.right-this.object.left)/this.object.zoom/this.domElement.clientWidth,e=(this.object.top-this.object.bottom)/this.object.zoom/this.domElement.clientWidth;_G.x*=t,_G.y*=e}_G.multiplyScalar(this._eye.length()*this.panSpeed),bG.copy(this._eye).cross(this.object.up).setLength(_G.x),bG.add(xG.copy(this.object.up).setLength(_G.y)),this.object.position.add(bG),this.target.add(bG),this.staticMoving?this._panStart.copy(this._panEnd):this._panStart.add(_G.subVectors(this._panEnd,this._panStart).multiplyScalar(this.dynamicDampingFactor))}}_rotateCamera(){CG.set(this._moveCurr.x-this._movePrev.x,this._moveCurr.y-this._movePrev.y,0);let t=CG.length();t?(this._eye.copy(this.object.position).sub(this.target),wG.copy(this._eye).normalize(),TG.copy(this.object.up).normalize(),EG.crossVectors(TG,wG).normalize(),TG.setLength(this._moveCurr.y-this._movePrev.y),EG.setLength(this._moveCurr.x-this._movePrev.x),CG.copy(TG.add(EG)),SG.crossVectors(CG,this._eye).normalize(),t*=this.rotateSpeed,MG.setFromAxisAngle(SG,t),this._eye.applyQuaternion(MG),this.object.up.applyQuaternion(MG),this._lastAxis.copy(SG),this._lastAngle=t):!this.staticMoving&&this._lastAngle&&(this._lastAngle*=Math.sqrt(1-this.dynamicDampingFactor),this._eye.copy(this.object.position).sub(this.target),MG.setFromAxisAngle(this._lastAxis,this._lastAngle),this._eye.applyQuaternion(MG),this.object.up.applyQuaternion(MG)),this._movePrev.copy(this._moveCurr)}_zoomCamera(){let t;this.state===yG?(t=this._touchZoomDistanceStart/this._touchZoomDistanceEnd,this._touchZoomDistanceStart=this._touchZoomDistanceEnd,this.object.isPerspectiveCamera?this._eye.multiplyScalar(t):this.object.isOrthographicCamera?(this.object.zoom=Te.clamp(this.object.zoom/t,this.minZoom,this.maxZoom),this._lastZoom!==this.object.zoom&&this.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")):(t=1+(this._zoomEnd.y-this._zoomStart.y)*this.zoomSpeed,1!==t&&t>0&&(this.object.isPerspectiveCamera?this._eye.multiplyScalar(t):this.object.isOrthographicCamera?(this.object.zoom=Te.clamp(this.object.zoom/t,this.minZoom,this.maxZoom),this._lastZoom!==this.object.zoom&&this.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")),this.staticMoving?this._zoomStart.copy(this._zoomEnd):this._zoomStart.y+=(this._zoomEnd.y-this._zoomStart.y)*this.dynamicDampingFactor)}_getMouseOnScreen(t,e){return vG.set((t-this.screen.left)/this.screen.width,(e-this.screen.top)/this.screen.height),vG}_getMouseOnCircle(t,e){return vG.set((t-.5*this.screen.width-this.screen.left)/(.5*this.screen.width),(this.screen.height+2*(this.screen.top-e))/this.screen.width),vG}_addPointer(t){this._pointers.push(t)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;e<this._pointers.length;e++)if(this._pointers[e].pointerId==t.pointerId)return void this._pointers.splice(e,1)}_trackPointer(t){let e=this._pointerPositions[t.pointerId];void 0===e&&(e=new Ee,this._pointerPositions[t.pointerId]=e),e.set(t.pageX,t.pageY)}_getSecondPointerPosition(t){const e=t.pointerId===this._pointers[0].pointerId?this._pointers[1]:this._pointers[0];return this._pointerPositions[e.pointerId]}_checkDistances(){this.noZoom&&this.noPan||(this._eye.lengthSq()>this.maxDistance*this.maxDistance&&(this.object.position.addVectors(this.target,this._eye.setLength(this.maxDistance)),this._zoomStart.copy(this._zoomEnd)),this._eye.lengthSq()<this.minDistance*this.minDistance&&(this.object.position.addVectors(this.target,this._eye.setLength(this.minDistance)),this._zoomStart.copy(this._zoomEnd)))}}function NG(t){!1!==this.enabled&&(0===this._pointers.length&&(this.domElement.setPointerCapture(t.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),this._addPointer(t),"touch"===t.pointerType?this._onTouchStart(t):this._onMouseDown(t))}function PG(t){!1!==this.enabled&&("touch"===t.pointerType?this._onTouchMove(t):this._onMouseMove(t))}function DG(t){!1!==this.enabled&&("touch"===t.pointerType?this._onTouchEnd(t):this._onMouseUp(),this._removePointer(t),0===this._pointers.length&&(this.domElement.releasePointerCapture(t.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp)))}function IG(t){this._removePointer(t)}function LG(){!1!==this.enabled&&(this.keyState=dG,window.addEventListener("keydown",this._onKeyDown))}function BG(t){!1!==this.enabled&&(window.removeEventListener("keydown",this._onKeyDown),this.keyState===dG&&(t.code!==this.keys[pG]||this.noRotate?t.code!==this.keys[fG]||this.noZoom?t.code!==this.keys[mG]||this.noPan||(this.keyState=mG):this.keyState=fG:this.keyState=pG))}function UG(t){let e;switch(t.button){case 0:e=this.mouseButtons.LEFT;break;case 1:e=this.mouseButtons.MIDDLE;break;case 2:e=this.mouseButtons.RIGHT;break;default:e=-1}switch(e){case a.DOLLY:this.state=fG;break;case a.ROTATE:this.state=pG;break;case a.PAN:this.state=mG;break;default:this.state=dG}const n=this.keyState!==dG?this.keyState:this.state;n!==pG||this.noRotate?n!==fG||this.noZoom?n!==mG||this.noPan||(this._panStart.copy(this._getMouseOnScreen(t.pageX,t.pageY)),this._panEnd.copy(this._panStart)):(this._zoomStart.copy(this._getMouseOnScreen(t.pageX,t.pageY)),this._zoomEnd.copy(this._zoomStart)):(this._moveCurr.copy(this._getMouseOnCircle(t.pageX,t.pageY)),this._movePrev.copy(this._moveCurr)),this.dispatchEvent(hG)}function OG(t){const e=this.keyState!==dG?this.keyState:this.state;e!==pG||this.noRotate?e!==fG||this.noZoom?e!==mG||this.noPan||this._panEnd.copy(this._getMouseOnScreen(t.pageX,t.pageY)):this._zoomEnd.copy(this._getMouseOnScreen(t.pageX,t.pageY)):(this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this._getMouseOnCircle(t.pageX,t.pageY)))}function FG(){this.state=dG,this.dispatchEvent(cG)}function kG(t){if(!1!==this.enabled&&!0!==this.noZoom){switch(t.preventDefault(),t.deltaMode){case 2:this._zoomStart.y-=.025*t.deltaY;break;case 1:this._zoomStart.y-=.01*t.deltaY;break;default:this._zoomStart.y-=25e-5*t.deltaY}this.dispatchEvent(hG),this.dispatchEvent(cG)}}function zG(t){!1!==this.enabled&&t.preventDefault()}function qG(t){if(this._trackPointer(t),1===this._pointers.length)this.state=gG,this._moveCurr.copy(this._getMouseOnCircle(this._pointers[0].pageX,this._pointers[0].pageY)),this._movePrev.copy(this._moveCurr);else{this.state=yG;const t=this._pointers[0].pageX-this._pointers[1].pageX,e=this._pointers[0].pageY-this._pointers[1].pageY;this._touchZoomDistanceEnd=this._touchZoomDistanceStart=Math.sqrt(t*t+e*e);const n=(this._pointers[0].pageX+this._pointers[1].pageX)/2,i=(this._pointers[0].pageY+this._pointers[1].pageY)/2;this._panStart.copy(this._getMouseOnScreen(n,i)),this._panEnd.copy(this._panStart)}this.dispatchEvent(hG)}function GG(t){if(this._trackPointer(t),1===this._pointers.length)this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this._getMouseOnCircle(t.pageX,t.pageY));else{const e=this._getSecondPointerPosition(t),n=t.pageX-e.x,i=t.pageY-e.y;this._touchZoomDistanceEnd=Math.sqrt(n*n+i*i);const r=(t.pageX+e.x)/2,s=(t.pageY+e.y)/2;this._panEnd.copy(this._getMouseOnScreen(r,s))}}function VG(t){switch(this._pointers.length){case 0:this.state=dG;break;case 1:this.state=gG,this._moveCurr.copy(this._getMouseOnCircle(t.pageX,t.pageY)),this._movePrev.copy(this._moveCurr);break;case 2:this.state=yG;for(let e=0;e<this._pointers.length;e++)if(this._pointers[e].pointerId!==t.pointerId){const t=this._pointerPositions[this._pointers[e].pointerId];this._moveCurr.copy(this._getMouseOnCircle(t.x,t.y)),this._movePrev.copy(this._moveCurr);break}}this.dispatchEvent(cG)}const HG={type:"change"},jG={type:"start"},WG={type:"end"},XG=new Pn,YG=new _r,QG=Math.cos(70*Te.DEG2RAD),$G=new en,ZG=2*Math.PI,KG=-1,JG=0,tV=1,eV=2,nV=3,iV=4,rV=5,sV=6,aV=1e-6;class oV extends ru{constructor(t,e=null){super(t,e),this.state=KG,this.enabled=!0,this.target=new en,this.cursor=new en,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:a.ROTATE,MIDDLE:a.DOLLY,RIGHT:a.PAN},this.touches={ONE:o,TWO:u},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new en,this._lastQuaternion=new tn,this._lastTargetPosition=new en,this._quat=(new tn).setFromUnitVectors(t.up,new en(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new tu,this._sphericalDelta=new tu,this._scale=1,this._panOffset=new en,this._rotateStart=new Ee,this._rotateEnd=new Ee,this._rotateDelta=new Ee,this._panStart=new Ee,this._panEnd=new Ee,this._panDelta=new Ee,this._dollyStart=new Ee,this._dollyEnd=new Ee,this._dollyDelta=new Ee,this._dollyDirection=new en,this._mouse=new Ee,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=uV.bind(this),this._onPointerDown=lV.bind(this),this._onPointerUp=hV.bind(this),this._onContextMenu=gV.bind(this),this._onMouseWheel=dV.bind(this),this._onKeyDown=pV.bind(this),this._onTouchStart=fV.bind(this),this._onTouchMove=mV.bind(this),this._onMouseDown=cV.bind(this),this._onMouseMove=AV.bind(this),this._interceptControlDown=yV.bind(this),this._interceptControlUp=vV.bind(this),null!==this.domElement&&this.connect(),this.update()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1});this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents();this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){null!==this._domElementKeyEvents&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(HG),this.update(),this.state=KG}update(t=null){const e=this.object.position;$G.copy(e).sub(this.target),$G.applyQuaternion(this._quat),this._spherical.setFromVector3($G),this.autoRotate&&this.state===KG&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,i=this.maxAzimuthAngle;isFinite(n)&&isFinite(i)&&(n<-Math.PI?n+=ZG:n>Math.PI&&(n-=ZG),i<-Math.PI?i+=ZG:i>Math.PI&&(i-=ZG),this._spherical.theta=n<=i?Math.max(n,Math.min(i,this._spherical.theta)):this._spherical.theta>(n+i)/2?Math.max(n,this._spherical.theta):Math.min(i,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),!0===this.enableDamping?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let r=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const t=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),r=t!=this._spherical.radius}if($G.setFromSpherical(this._spherical),$G.applyQuaternion(this._quatInverse),e.copy(this.target).add($G),this.object.lookAt(this.target),!0===this.enableDamping?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let t=null;if(this.object.isPerspectiveCamera){const e=$G.length();t=this._clampDistance(e*this._scale);const n=e-t;this.object.position.addScaledVector(this._dollyDirection,n),this.object.updateMatrixWorld(),r=!!n}else if(this.object.isOrthographicCamera){const e=new en(this._mouse.x,this._mouse.y,0);e.unproject(this.object);const n=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),r=n!==this.object.zoom;const i=new en(this._mouse.x,this._mouse.y,0);i.unproject(this.object),this.object.position.sub(i).add(e),this.object.updateMatrixWorld(),t=$G.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;null!==t&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(t).add(this.object.position):(XG.origin.copy(this.object.position),XG.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(XG.direction))<QG?this.object.lookAt(this.target):(YG.setFromNormalAndCoplanarPoint(this.object.up,this.target),XG.intersectPlane(YG,this.target))))}else if(this.object.isOrthographicCamera){const t=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),t!==this.object.zoom&&(this.object.updateProjectionMatrix(),r=!0)}return this._scale=1,this._performCursorZoom=!1,!!(r||this._lastPosition.distanceToSquared(this.object.position)>aV||8*(1-this._lastQuaternion.dot(this.object.quaternion))>aV||this._lastTargetPosition.distanceToSquared(this.target)>aV)&&(this.dispatchEvent(HG),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0)}_getAutoRotationAngle(t){return null!==t?ZG/60*this.autoRotateSpeed*t:ZG/60/60*this.autoRotateSpeed}_getZoomScale(t){const e=Math.abs(.01*t);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,e){$G.setFromMatrixColumn(e,0),$G.multiplyScalar(-t),this._panOffset.add($G)}_panUp(t,e){!0===this.screenSpacePanning?$G.setFromMatrixColumn(e,1):($G.setFromMatrixColumn(e,0),$G.crossVectors(this.object.up,$G)),$G.multiplyScalar(t),this._panOffset.add($G)}_pan(t,e){const n=this.domElement;if(this.object.isPerspectiveCamera){const i=this.object.position;$G.copy(i).sub(this.target);let r=$G.length();r*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*r/n.clientHeight,this.object.matrix),this._panUp(2*e*r/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const n=this.domElement.getBoundingClientRect(),i=t-n.left,r=e-n.top,s=n.width,a=n.height;this._mouse.x=i/s*2-1,this._mouse.y=-r/a*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(ZG*this._rotateDelta.x/e.clientHeight),this._rotateUp(ZG*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let e=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this._rotateUp(ZG*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this._rotateUp(-ZG*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this._rotateLeft(ZG*this.rotateSpeed/this.domElement.clientHeight):this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this._rotateLeft(-ZG*this.rotateSpeed/this.domElement.clientHeight):this._pan(-this.keyPanSpeed,0),e=!0}e&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(1===this._pointers.length)this._rotateStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),i=.5*(t.pageY+e.y);this._rotateStart.set(n,i)}}_handleTouchStartPan(t){if(1===this._pointers.length)this._panStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),i=.5*(t.pageY+e.y);this._panStart.set(n,i)}}_handleTouchStartDolly(t){const e=this._getSecondPointerPosition(t),n=t.pageX-e.x,i=t.pageY-e.y,r=Math.sqrt(n*n+i*i);this._dollyStart.set(0,r)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(1==this._pointers.length)this._rotateEnd.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),i=.5*(t.pageY+e.y);this._rotateEnd.set(n,i)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(ZG*this._rotateDelta.x/e.clientHeight),this._rotateUp(ZG*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(1===this._pointers.length)this._panEnd.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),i=.5*(t.pageY+e.y);this._panEnd.set(n,i)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const e=this._getSecondPointerPosition(t),n=t.pageX-e.x,i=t.pageY-e.y,r=Math.sqrt(n*n+i*i);this._dollyEnd.set(0,r),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const s=.5*(t.pageX+e.x),a=.5*(t.pageY+e.y);this._updateZoomParameters(s,a)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==t.pointerId)return void this._pointers.splice(e,1)}_isTrackingPointer(t){for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==t.pointerId)return!0;return!1}_trackPointer(t){let e=this._pointerPositions[t.pointerId];void 0===e&&(e=new Ee,this._pointerPositions[t.pointerId]=e),e.set(t.pageX,t.pageY)}_getSecondPointerPosition(t){const e=t.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[e]}_customWheelEvent(t){const e=t.deltaMode,n={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(e){case 1:n.deltaY*=16;break;case 2:n.deltaY*=100}return t.ctrlKey&&!this._controlActive&&(n.deltaY*=10),n}}function lV(t){!1!==this.enabled&&(0===this._pointers.length&&(this.domElement.setPointerCapture(t.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),this._isTrackingPointer(t)||(this._addPointer(t),"touch"===t.pointerType?this._onTouchStart(t):this._onMouseDown(t)))}function uV(t){!1!==this.enabled&&("touch"===t.pointerType?this._onTouchMove(t):this._onMouseMove(t))}function hV(t){switch(this._removePointer(t),this._pointers.length){case 0:this.domElement.releasePointerCapture(t.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(WG),this.state=KG;break;case 1:const e=this._pointers[0],n=this._pointerPositions[e];this._onTouchStart({pointerId:e,pageX:n.x,pageY:n.y})}}function cV(t){let e;switch(t.button){case 0:e=this.mouseButtons.LEFT;break;case 1:e=this.mouseButtons.MIDDLE;break;case 2:e=this.mouseButtons.RIGHT;break;default:e=-1}switch(e){case a.DOLLY:if(!1===this.enableZoom)return;this._handleMouseDownDolly(t),this.state=tV;break;case a.ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===this.enablePan)return;this._handleMouseDownPan(t),this.state=eV}else{if(!1===this.enableRotate)return;this._handleMouseDownRotate(t),this.state=JG}break;case a.PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===this.enableRotate)return;this._handleMouseDownRotate(t),this.state=JG}else{if(!1===this.enablePan)return;this._handleMouseDownPan(t),this.state=eV}break;default:this.state=KG}this.state!==KG&&this.dispatchEvent(jG)}function AV(t){switch(this.state){case JG:if(!1===this.enableRotate)return;this._handleMouseMoveRotate(t);break;case tV:if(!1===this.enableZoom)return;this._handleMouseMoveDolly(t);break;case eV:if(!1===this.enablePan)return;this._handleMouseMovePan(t)}}function dV(t){!1!==this.enabled&&!1!==this.enableZoom&&this.state===KG&&(t.preventDefault(),this.dispatchEvent(jG),this._handleMouseWheel(this._customWheelEvent(t)),this.dispatchEvent(WG))}function pV(t){!1!==this.enabled&&!1!==this.enablePan&&this._handleKeyDown(t)}function fV(t){switch(this._trackPointer(t),this._pointers.length){case 1:switch(this.touches.ONE){case o:if(!1===this.enableRotate)return;this._handleTouchStartRotate(t),this.state=nV;break;case l:if(!1===this.enablePan)return;this._handleTouchStartPan(t),this.state=iV;break;default:this.state=KG}break;case 2:switch(this.touches.TWO){case u:if(!1===this.enableZoom&&!1===this.enablePan)return;this._handleTouchStartDollyPan(t),this.state=rV;break;case h:if(!1===this.enableZoom&&!1===this.enableRotate)return;this._handleTouchStartDollyRotate(t),this.state=sV;break;default:this.state=KG}break;default:this.state=KG}this.state!==KG&&this.dispatchEvent(jG)}function mV(t){switch(this._trackPointer(t),this.state){case nV:if(!1===this.enableRotate)return;this._handleTouchMoveRotate(t),this.update();break;case iV:if(!1===this.enablePan)return;this._handleTouchMovePan(t),this.update();break;case rV:if(!1===this.enableZoom&&!1===this.enablePan)return;this._handleTouchMoveDollyPan(t),this.update();break;case sV:if(!1===this.enableZoom&&!1===this.enableRotate)return;this._handleTouchMoveDollyRotate(t),this.update();break;default:this.state=KG}}function gV(t){!1!==this.enabled&&t.preventDefault()}function yV(t){if("Control"===t.key){this._controlActive=!0;this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0})}}function vV(t){if("Control"===t.key){this._controlActive=!1;this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0})}}const _V={type:"change"},xV=1e-6,bV=new tn;class SV extends ru{constructor(t,e=null){super(t,e),this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1,this._moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this._moveVector=new en(0,0,0),this._rotationVector=new en(0,0,0),this._lastQuaternion=new tn,this._lastPosition=new en,this._status=0,this._onKeyDown=MV.bind(this),this._onKeyUp=wV.bind(this),this._onPointerMove=EV.bind(this),this._onPointerDown=TV.bind(this),this._onPointerUp=CV.bind(this),this._onPointerCancel=RV.bind(this),this._onContextMenu=NV.bind(this),null!==e&&this.connect()}connect(){window.addEventListener("keydown",this._onKeyDown),window.addEventListener("keyup",this._onKeyUp),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointerup",this._onPointerUp),this.domElement.addEventListener("pointercancel",this._onPointerCancel),this.domElement.addEventListener("contextmenu",this._onContextMenu)}disconnect(){window.removeEventListener("keydown",this._onKeyDown),window.removeEventListener("keyup",this._onKeyUp),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerCancel),this.domElement.removeEventListener("contextmenu",this._onContextMenu)}dispose(){this.disconnect()}update(t){if(!1===this.enabled)return;const e=this.object,n=t*this.movementSpeed,i=t*this.rollSpeed;e.translateX(this._moveVector.x*n),e.translateY(this._moveVector.y*n),e.translateZ(this._moveVector.z*n),bV.set(this._rotationVector.x*i,this._rotationVector.y*i,this._rotationVector.z*i,1).normalize(),e.quaternion.multiply(bV),(this._lastPosition.distanceToSquared(e.position)>xV||8*(1-this._lastQuaternion.dot(e.quaternion))>xV)&&(this.dispatchEvent(_V),this._lastQuaternion.copy(e.quaternion),this._lastPosition.copy(e.position))}_updateMovementVector(){const t=this._moveState.forward||this.autoForward&&!this._moveState.back?1:0;this._moveVector.x=-this._moveState.left+this._moveState.right,this._moveVector.y=-this._moveState.down+this._moveState.up,this._moveVector.z=-t+this._moveState.back}_updateRotationVector(){this._rotationVector.x=-this._moveState.pitchDown+this._moveState.pitchUp,this._rotationVector.y=-this._moveState.yawRight+this._moveState.yawLeft,this._rotationVector.z=-this._moveState.rollRight+this._moveState.rollLeft}_getContainerDimensions(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}}}function MV(t){if(!t.altKey&&!1!==this.enabled){switch(t.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=.1;break;case"KeyW":this._moveState.forward=1;break;case"KeyS":this._moveState.back=1;break;case"KeyA":this._moveState.left=1;break;case"KeyD":this._moveState.right=1;break;case"KeyR":this._moveState.up=1;break;case"KeyF":this._moveState.down=1;break;case"ArrowUp":this._moveState.pitchUp=1;break;case"ArrowDown":this._moveState.pitchDown=1;break;case"ArrowLeft":this._moveState.yawLeft=1;break;case"ArrowRight":this._moveState.yawRight=1;break;case"KeyQ":this._moveState.rollLeft=1;break;case"KeyE":this._moveState.rollRight=1}this._updateMovementVector(),this._updateRotationVector()}}function wV(t){if(!1!==this.enabled){switch(t.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=1;break;case"KeyW":this._moveState.forward=0;break;case"KeyS":this._moveState.back=0;break;case"KeyA":this._moveState.left=0;break;case"KeyD":this._moveState.right=0;break;case"KeyR":this._moveState.up=0;break;case"KeyF":this._moveState.down=0;break;case"ArrowUp":this._moveState.pitchUp=0;break;case"ArrowDown":this._moveState.pitchDown=0;break;case"ArrowLeft":this._moveState.yawLeft=0;break;case"ArrowRight":this._moveState.yawRight=0;break;case"KeyQ":this._moveState.rollLeft=0;break;case"KeyE":this._moveState.rollRight=0}this._updateMovementVector(),this._updateRotationVector()}}function TV(t){if(!1!==this.enabled)if(this.dragToLook)this._status++;else{switch(t.button){case 0:this._moveState.forward=1;break;case 2:this._moveState.back=1}this._updateMovementVector()}}function EV(t){if(!1!==this.enabled&&(!this.dragToLook||this._status>0)){const e=this._getContainerDimensions(),n=e.size[0]/2,i=e.size[1]/2;this._moveState.yawLeft=-(t.pageX-e.offset[0]-n)/n,this._moveState.pitchDown=(t.pageY-e.offset[1]-i)/i,this._updateRotationVector()}}function CV(t){if(!1!==this.enabled){if(this.dragToLook)this._status--,this._moveState.yawLeft=this._moveState.pitchDown=0;else{switch(t.button){case 0:this._moveState.forward=0;break;case 2:this._moveState.back=0}this._updateMovementVector()}this._updateRotationVector()}}function RV(){!1!==this.enabled&&(this.dragToLook?(this._status=0,this._moveState.yawLeft=this._moveState.pitchDown=0):(this._moveState.forward=0,this._moveState.back=0,this._updateMovementVector()),this._updateRotationVector())}function NV(t){!1!==this.enabled&&t.preventDefault()}const PV={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform float opacity;\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\t\t\tgl_FragColor = opacity * texel;\n\n\n\t\t}"};class DV{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}const IV=new kr(-1,1,1,-1,0,1);const LV=new class extends Gi{constructor(){super(),this.setAttribute("position",new Li([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Li([0,2,0,0,2,0],2))}};class BV{constructor(t){this._mesh=new tr(LV,t)}dispose(){this._mesh.geometry.dispose()}render(t){t.render(this._mesh,IV)}get material(){return this._mesh.material}set material(t){this._mesh.material=t}}class UV extends DV{constructor(t,e){super(),this.textureID=void 0!==e?e:"tDiffuse",t instanceof or?(this.uniforms=t.uniforms,this.material=t):t&&(this.uniforms=ar.clone(t.uniforms),this.material=new or({name:void 0!==t.name?t.name:"unspecified",defines:Object.assign({},t.defines),uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader})),this.fsQuad=new BV(this.material)}render(t,e,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(t.setRenderTarget(null),this.fsQuad.render(t)):(t.setRenderTarget(e),this.clear&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),this.fsQuad.render(t))}dispose(){this.material.dispose(),this.fsQuad.dispose()}}class OV extends DV{constructor(t,e){super(),this.scene=t,this.camera=e,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(t,e,n){const i=t.getContext(),r=t.state;let s,a;r.buffers.color.setMask(!1),r.buffers.depth.setMask(!1),r.buffers.color.setLocked(!0),r.buffers.depth.setLocked(!0),this.inverse?(s=0,a=1):(s=1,a=0),r.buffers.stencil.setTest(!0),r.buffers.stencil.setOp(i.REPLACE,i.REPLACE,i.REPLACE),r.buffers.stencil.setFunc(i.ALWAYS,s,4294967295),r.buffers.stencil.setClear(a),r.buffers.stencil.setLocked(!0),t.setRenderTarget(n),this.clear&&t.clear(),t.render(this.scene,this.camera),t.setRenderTarget(e),this.clear&&t.clear(),t.render(this.scene,this.camera),r.buffers.color.setLocked(!1),r.buffers.depth.setLocked(!1),r.buffers.color.setMask(!0),r.buffers.depth.setMask(!0),r.buffers.stencil.setLocked(!1),r.buffers.stencil.setFunc(i.EQUAL,1,4294967295),r.buffers.stencil.setOp(i.KEEP,i.KEEP,i.KEEP),r.buffers.stencil.setLocked(!0)}}class FV extends DV{constructor(){super(),this.needsSwap=!1}render(t){t.state.buffers.stencil.setLocked(!1),t.state.buffers.stencil.setTest(!1)}}class kV{constructor(t,e){if(this.renderer=t,this._pixelRatio=t.getPixelRatio(),void 0===e){const n=t.getSize(new Ee);this._width=n.width,this._height=n.height,(e=new Ze(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:st})).texture.name="EffectComposer.rt1"}else this._width=e.width,this._height=e.height;this.renderTarget1=e,this.renderTarget2=e.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],this.copyPass=new UV(PV),this.copyPass.material.blending=0,this.clock=new Yl}swapBuffers(){const t=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=t}addPass(t){this.passes.push(t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(t,e){this.passes.splice(e,0,t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(t){const e=this.passes.indexOf(t);-1!==e&&this.passes.splice(e,1)}isLastEnabledPass(t){for(let e=t+1;e<this.passes.length;e++)if(this.passes[e].enabled)return!1;return!0}render(t){void 0===t&&(t=this.clock.getDelta());const e=this.renderer.getRenderTarget();let n=!1;for(let e=0,i=this.passes.length;e<i;e++){const i=this.passes[e];if(!1!==i.enabled){if(i.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(e),i.render(this.renderer,this.writeBuffer,this.readBuffer,t,n),i.needsSwap){if(n){const e=this.renderer.getContext(),n=this.renderer.state.buffers.stencil;n.setFunc(e.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,t),n.setFunc(e.EQUAL,1,4294967295)}this.swapBuffers()}void 0!==OV&&(i instanceof OV?n=!0:i instanceof FV&&(n=!1))}}this.renderer.setRenderTarget(e)}reset(t){if(void 0===t){const e=this.renderer.getSize(new Ee);this._pixelRatio=this.renderer.getPixelRatio(),this._width=e.width,this._height=e.height,(t=this.renderTarget1.clone()).setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=t,this.renderTarget2=t.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(t,e){this._width=t,this._height=e;const n=this._width*this._pixelRatio,i=this._height*this._pixelRatio;this.renderTarget1.setSize(n,i),this.renderTarget2.setSize(n,i);for(let t=0;t<this.passes.length;t++)this.passes[t].setSize(n,i)}setPixelRatio(t){this._pixelRatio=t,this.setSize(this._width,this._height)}dispose(){this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.copyPass.dispose()}}class zV extends DV{constructor(t,e,n=null,i=null,r=null){super(),this.scene=t,this.camera=e,this.overrideMaterial=n,this.clearColor=i,this.clearAlpha=r,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new Mi}render(t,e,n){const i=t.autoClear;let r,s;t.autoClear=!1,null!==this.overrideMaterial&&(s=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),null!==this.clearColor&&(t.getClearColor(this._oldClearColor),t.setClearColor(this.clearColor,t.getClearAlpha())),null!==this.clearAlpha&&(r=t.getClearAlpha(),t.setClearAlpha(this.clearAlpha)),1==this.clearDepth&&t.clearDepth(),t.setRenderTarget(this.renderToScreen?null:n),!0===this.clear&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),t.render(this.scene,this.camera),null!==this.clearColor&&t.setClearColor(this._oldClearColor),null!==this.clearAlpha&&t.setClearAlpha(r),null!==this.overrideMaterial&&(this.scene.overrideMaterial=s),t.autoClear=i}}function qV(){return qV=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},qV.apply(null,arguments)}function GV(t,e){return GV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},GV(t,e)}function VV(t){return VV=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},VV(t)}function HV(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(HV=function(){return!!t})()}function jV(t){var e="function"==typeof Map?new Map:void 0;return jV=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(HV())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,e);var r=new(t.bind.apply(t,i));return n&&GV(r,n.prototype),r}(t,arguments,VV(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),GV(n,t)},jV(t)}var WV={1:"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",2:"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",3:"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",4:"Couldn't generate valid rgb string from %s, it returned %s.\n\n",5:"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",6:"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",7:"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",8:"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",9:"Please provide a number of steps to the modularScale helper.\n\n",10:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",11:'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',12:'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',13:'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',14:'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',15:'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',16:"You must provide a template to this method.\n\n",17:"You passed an unsupported selector state to this method.\n\n",18:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",19:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",20:"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:"fontFace expects a name of a font-family.\n\n",24:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",25:"fontFace expects localFonts to be an array.\n\n",26:"fontFace expects fileFormats to be an array.\n\n",27:"radialGradient requries at least 2 color-stops to properly render.\n\n",28:"Please supply a filename to retinaImage() as the first argument.\n\n",29:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",32:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",33:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",34:"borderRadius expects a radius value as a string or number as the second argument.\n\n",35:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',36:"Property must be a string value.\n\n",37:"Syntax Error at %s.\n\n",38:"Formula contains a function that needs parentheses at %s.\n\n",39:"Formula is missing closing parenthesis at %s.\n\n",40:"Formula has too many closing parentheses at %s.\n\n",41:"All values in a formula must have the same unit or be unitless.\n\n",42:"Please provide a number of steps to the modularScale helper.\n\n",43:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",44:"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",45:"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",46:"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",47:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",48:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",49:"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",50:"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",51:"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",52:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",53:"fontFace expects localFonts to be an array.\n\n",54:"fontFace expects fileFormats to be an array.\n\n",55:"fontFace expects a name of a font-family.\n\n",56:"linearGradient requries at least 2 color-stops to properly render.\n\n",57:"radialGradient requries at least 2 color-stops to properly render.\n\n",58:"Please supply a filename to retinaImage() as the first argument.\n\n",59:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:"Property must be a string value.\n\n",62:"borderRadius expects a radius value as a string or number as the second argument.\n\n",63:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',64:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",65:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",66:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",67:"You must provide a template to this method.\n\n",68:"You passed an unsupported selector state to this method.\n\n",69:'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',70:'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',71:'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',72:'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',73:"Please provide a valid CSS variable.\n\n",74:"CSS variable not found and no default was provided.\n\n",75:"important requires a valid style object, got a %s instead.\n\n",76:"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",77:'remToPx expects a value in "rem" but you provided it in "%s".\n\n',78:'base must be set in "px" or "%" but you set it in "%s".\n'};function XV(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var i,r=e[0],s=[];for(i=1;i<e.length;i+=1)s.push(e[i]);return s.forEach((function(t){r=r.replace(/%[a-z]/,t)})),r}var YV=function(t){var e,n;function i(e){var n;if("production"===process.env.NODE_ENV)n=t.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+e+" for more information.")||this;else{for(var i=arguments.length,r=new Array(i>1?i-1:0),s=1;s<i;s++)r[s-1]=arguments[s];n=t.call(this,XV.apply(void 0,[WV[e]].concat(r)))||this}return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(n)}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,GV(e,n),i}(jV(Error));function QV(t){return Math.round(255*t)}function $V(t,e,n){return QV(t)+","+QV(e)+","+QV(n)}function ZV(t,e,n,i){if(void 0===i&&(i=$V),0===e)return i(n,n,n);var r=(t%360+360)%360/60,s=(1-Math.abs(2*n-1))*e,a=s*(1-Math.abs(r%2-1)),o=0,l=0,u=0;r>=0&&r<1?(o=s,l=a):r>=1&&r<2?(o=a,l=s):r>=2&&r<3?(l=s,u=a):r>=3&&r<4?(l=a,u=s):r>=4&&r<5?(o=a,u=s):r>=5&&r<6&&(o=s,u=a);var h=n-s/2;return i(o+h,l+h,u+h)}var KV={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var JV=/^#[a-fA-F0-9]{6}$/,tH=/^#[a-fA-F0-9]{8}$/,eH=/^#[a-fA-F0-9]{3}$/,nH=/^#[a-fA-F0-9]{4}$/,iH=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,rH=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,sH=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,aH=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function oH(t){if("string"!=typeof t)throw new YV(3);var e=function(t){if("string"!=typeof t)return t;var e=t.toLowerCase();return KV[e]?"#"+KV[e]:t}(t);if(e.match(JV))return{red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16)};if(e.match(tH)){var n=parseFloat((parseInt(""+e[7]+e[8],16)/255).toFixed(2));return{red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16),alpha:n}}if(e.match(eH))return{red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16)};if(e.match(nH)){var i=parseFloat((parseInt(""+e[4]+e[4],16)/255).toFixed(2));return{red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16),alpha:i}}var r=iH.exec(e);if(r)return{red:parseInt(""+r[1],10),green:parseInt(""+r[2],10),blue:parseInt(""+r[3],10)};var s=rH.exec(e.substring(0,50));if(s)return{red:parseInt(""+s[1],10),green:parseInt(""+s[2],10),blue:parseInt(""+s[3],10),alpha:parseFloat(""+s[4])>1?parseFloat(""+s[4])/100:parseFloat(""+s[4])};var a=sH.exec(e);if(a){var o="rgb("+ZV(parseInt(""+a[1],10),parseInt(""+a[2],10)/100,parseInt(""+a[3],10)/100)+")",l=iH.exec(o);if(!l)throw new YV(4,e,o);return{red:parseInt(""+l[1],10),green:parseInt(""+l[2],10),blue:parseInt(""+l[3],10)}}var u=aH.exec(e.substring(0,50));if(u){var h="rgb("+ZV(parseInt(""+u[1],10),parseInt(""+u[2],10)/100,parseInt(""+u[3],10)/100)+")",c=iH.exec(h);if(!c)throw new YV(4,e,h);return{red:parseInt(""+c[1],10),green:parseInt(""+c[2],10),blue:parseInt(""+c[3],10),alpha:parseFloat(""+u[4])>1?parseFloat(""+u[4])/100:parseFloat(""+u[4])}}throw new YV(5)}function lH(t){return function(t){var e,n=t.red/255,i=t.green/255,r=t.blue/255,s=Math.max(n,i,r),a=Math.min(n,i,r),o=(s+a)/2;if(s===a)return void 0!==t.alpha?{hue:0,saturation:0,lightness:o,alpha:t.alpha}:{hue:0,saturation:0,lightness:o};var l=s-a,u=o>.5?l/(2-s-a):l/(s+a);switch(s){case n:e=(i-r)/l+(i<r?6:0);break;case i:e=(r-n)/l+2;break;default:e=(n-i)/l+4}return e*=60,void 0!==t.alpha?{hue:e,saturation:u,lightness:o,alpha:t.alpha}:{hue:e,saturation:u,lightness:o}}(oH(t))}var uH=function(t){return 7===t.length&&t[1]===t[2]&&t[3]===t[4]&&t[5]===t[6]?"#"+t[1]+t[3]+t[5]:t};function hH(t){var e=t.toString(16);return 1===e.length?"0"+e:e}function cH(t){return hH(Math.round(255*t))}function AH(t,e,n){return uH("#"+cH(t)+cH(e)+cH(n))}function dH(t,e,n){return ZV(t,e,n,AH)}function pH(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return uH("#"+hH(t)+hH(e)+hH(n));if("object"==typeof t&&void 0===e&&void 0===n)return uH("#"+hH(t.red)+hH(t.green)+hH(t.blue));throw new YV(6)}function fH(t,e,n,i){if("string"==typeof t&&"number"==typeof e){var r=oH(t);return"rgba("+r.red+","+r.green+","+r.blue+","+e+")"}if("number"==typeof t&&"number"==typeof e&&"number"==typeof n&&"number"==typeof i)return i>=1?pH(t,e,n):"rgba("+t+","+e+","+n+","+i+")";if("object"==typeof t&&void 0===e&&void 0===n&&void 0===i)return t.alpha>=1?pH(t.red,t.green,t.blue):"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")";throw new YV(7)}function mH(t){if("object"!=typeof t)throw new YV(8);if(function(t){return"number"==typeof t.red&&"number"==typeof t.green&&"number"==typeof t.blue&&"number"==typeof t.alpha}(t))return fH(t);if(function(t){return"number"==typeof t.red&&"number"==typeof t.green&&"number"==typeof t.blue&&("number"!=typeof t.alpha||void 0===t.alpha)}(t))return pH(t);if(function(t){return"number"==typeof t.hue&&"number"==typeof t.saturation&&"number"==typeof t.lightness&&"number"==typeof t.alpha}(t))return function(t,e,n,i){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n&&"number"==typeof i)return i>=1?dH(t,e,n):"rgba("+ZV(t,e,n)+","+i+")";if("object"==typeof t&&void 0===e&&void 0===n&&void 0===i)return t.alpha>=1?dH(t.hue,t.saturation,t.lightness):"rgba("+ZV(t.hue,t.saturation,t.lightness)+","+t.alpha+")";throw new YV(2)}(t);if(function(t){return"number"==typeof t.hue&&"number"==typeof t.saturation&&"number"==typeof t.lightness&&("number"!=typeof t.alpha||void 0===t.alpha)}(t))return function(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return dH(t,e,n);if("object"==typeof t&&void 0===e&&void 0===n)return dH(t.hue,t.saturation,t.lightness);throw new YV(1)}(t);throw new YV(8)}function gH(t,e,n){return function(){var i=n.concat(Array.prototype.slice.call(arguments));return i.length>=e?t.apply(this,i):gH(t,e,i)}}function yH(t){return gH(t,t.length,[])}function vH(t,e,n){return Math.max(t,Math.min(e,n))}yH((function(t,e){if("transparent"===e)return e;var n=lH(e);return mH(qV({},n,{hue:n.hue+parseFloat(t)}))})),yH((function(t,e){if("transparent"===e)return e;var n=lH(e);return mH(qV({},n,{lightness:vH(0,1,n.lightness-parseFloat(t))}))})),yH((function(t,e){if("transparent"===e)return e;var n=lH(e);return mH(qV({},n,{saturation:vH(0,1,n.saturation-parseFloat(t))}))})),yH((function(t,e){if("transparent"===e)return e;var n=lH(e);return mH(qV({},n,{lightness:vH(0,1,n.lightness+parseFloat(t))}))}));var _H=yH((function(t,e,n){if("transparent"===e)return n;if("transparent"===n)return e;if(0===t)return n;var i=oH(e),r=qV({},i,{alpha:"number"==typeof i.alpha?i.alpha:1}),s=oH(n),a=qV({},s,{alpha:"number"==typeof s.alpha?s.alpha:1}),o=r.alpha-a.alpha,l=2*parseFloat(t)-1,u=((l*o==-1?l:l+o)/(1+l*o)+1)/2,h=1-u;return fH({red:Math.floor(r.red*u+a.red*h),green:Math.floor(r.green*u+a.green*h),blue:Math.floor(r.blue*u+a.blue*h),alpha:r.alpha*parseFloat(t)+a.alpha*(1-parseFloat(t))})})),xH=_H;var bH=yH((function(t,e){if("transparent"===e)return e;var n=oH(e);return fH(qV({},n,{alpha:vH(0,1,(100*("number"==typeof n.alpha?n.alpha:1)+100*parseFloat(t))/100)}))})),SH=bH;yH((function(t,e){if("transparent"===e)return e;var n=lH(e);return mH(qV({},n,{saturation:vH(0,1,n.saturation+parseFloat(t))}))})),yH((function(t,e){return"transparent"===e?e:mH(qV({},lH(e),{hue:parseFloat(t)}))})),yH((function(t,e){return"transparent"===e?e:mH(qV({},lH(e),{lightness:parseFloat(t)}))})),yH((function(t,e){return"transparent"===e?e:mH(qV({},lH(e),{saturation:parseFloat(t)}))})),yH((function(t,e){return"transparent"===e?e:xH(parseFloat(t),"rgb(0, 0, 0)",e)})),yH((function(t,e){return"transparent"===e?e:xH(parseFloat(t),"rgb(255, 255, 255)",e)})),yH((function(t,e){if("transparent"===e)return e;var n=oH(e);return fH(qV({},n,{alpha:vH(0,1,+(100*("number"==typeof n.alpha?n.alpha:1)-100*parseFloat(t)).toFixed(2)/100)}))}));function MH(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function wH(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function TH(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(t)).next,0===e);else for(;!(l=(i=s.call(n)).done)&&(o.push(i.value),o.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return o}}(t,e)||CH(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function EH(t){return function(t){if(Array.isArray(t))return MH(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||CH(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function CH(t,e){if(t){if("string"==typeof t)return MH(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?MH(t,e):void 0}}!function(t,e){void 0===e&&(e={});var n=e.insertAt;if("undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}(".scene-nav-info {\n bottom: 5px;\n width: 100%;\n text-align: center;\n color: slategrey;\n opacity: 0.7;\n font-size: 10px;\n}\n\n.scene-tooltip {\n top: 0;\n color: lavender;\n font-size: 15px;\n}\n\n.scene-nav-info, .scene-tooltip {\n position: absolute;\n font-family: sans-serif;\n pointer-events: none;\n user-select: none;\n}\n\n.scene-container canvas:focus {\n outline: none;\n}");var RH=window.THREE?window.THREE:{WebGLRenderer:class{constructor(t={}){const{canvas:e=De(),context:n=null,depth:i=!0,stencil:r=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:c=!1}=t;let A;if(this.isWebGLRenderer=!0,null!==n){if("undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");A=n.getContextAttributes().alpha}else A=a;const d=new Uint32Array(4),p=new Int32Array(4);let f=null,m=null;const g=[],y=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Yt,this.toneMapping=0,this.toneMappingExposure=1;const v=this;let _=!1,x=0,b=0,S=null,M=-1,w=null;const T=new Qe,E=new Qe;let C=null;const R=new Mi(0);let N=0,P=e.width,D=e.height,I=1,L=null,B=null;const U=new Qe(0,0,P,D),O=new Qe(0,0,P,D);let F=!1;const k=new Sr;let z=!1,q=!1;const G=new Dn,V=new Dn,H=new en,j=new Qe,W={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let X=!1;function Y(){return null===S?I:1}let Q,$,J,tt,nt,rt,ut,ht,ct,At,mt,gt,yt,vt,_t,xt,bt,St,Mt,wt,Tt,Et,Ct,Rt,Nt=n;function Pt(t,n){return e.getContext(t,n)}try{const t={alpha:!0,depth:i,stencil:r,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:u,powerPreference:h,failIfMajorPerformanceCaveat:c};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${s}`),e.addEventListener("webglcontextlost",Lt,!1),e.addEventListener("webglcontextrestored",Bt,!1),e.addEventListener("webglcontextcreationerror",Ut,!1),null===Nt){const e="webgl2";if(Nt=Pt(e,t),null===Nt)throw Pt(e)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function Dt(){Q=new rs(Nt),Q.init(),Et=new io(Nt,Q),$=new Ur(Nt,Q,t,Et),J=new to(Nt),$.reverseDepthBuffer&&J.buffers.depth.setReversed(!0),tt=new os(Nt),nt=new ka,rt=new no(Nt,Q,J,nt,$,Et,tt),ut=new Fr(v),ht=new is(v),ct=new wr(Nt),Ct=new Lr(Nt,ct),At=new ss(Nt,ct,tt,Ct),mt=new us(Nt,At,ct,tt),Mt=new ls(Nt,$,rt),xt=new Or(nt),gt=new Fa(v,ut,ht,Q,$,Ct,xt),yt=new Ao(v,nt),vt=new Va,_t=new Qa(Q),St=new Ir(v,ut,ht,J,mt,A,l),bt=new Ka(v,mt,$),Rt=new po(Nt,tt,$,J),wt=new Br(Nt,Q,tt),Tt=new as(Nt,Q,tt),tt.programs=gt.programs,v.capabilities=$,v.extensions=Q,v.properties=nt,v.renderLists=vt,v.shadowMap=bt,v.state=J,v.info=tt}Dt();const It=new uo(v,Nt);function Lt(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),_=!0}function Bt(){console.log("THREE.WebGLRenderer: Context Restored."),_=!1;const t=tt.autoReset,e=bt.enabled,n=bt.autoUpdate,i=bt.needsUpdate,r=bt.type;Dt(),tt.autoReset=t,bt.enabled=e,bt.autoUpdate=n,bt.needsUpdate=i,bt.type=r}function Ut(t){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",t.statusMessage)}function Ot(t){const e=t.target;e.removeEventListener("dispose",Ot),function(t){(function(t){const e=nt.get(t).programs;void 0!==e&&(e.forEach((function(t){gt.releaseProgram(t)})),t.isShaderMaterial&>.releaseShaderCache(t))})(t),nt.remove(t)}(e)}function Ft(t,e,n){!0===t.transparent&&2===t.side&&!1===t.forceSinglePass?(t.side=1,t.needsUpdate=!0,$t(t,e,n),t.side=0,t.needsUpdate=!0,$t(t,e,n),t.side=2):$t(t,e,n)}this.xr=It,this.getContext=function(){return Nt},this.getContextAttributes=function(){return Nt.getContextAttributes()},this.forceContextLoss=function(){const t=Q.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){const t=Q.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return I},this.setPixelRatio=function(t){void 0!==t&&(I=t,this.setSize(P,D,!1))},this.getSize=function(t){return t.set(P,D)},this.setSize=function(t,n,i=!0){It.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(P=t,D=n,e.width=Math.floor(t*I),e.height=Math.floor(n*I),!0===i&&(e.style.width=t+"px",e.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(t){return t.set(P*I,D*I).floor()},this.setDrawingBufferSize=function(t,n,i){P=t,D=n,I=i,e.width=Math.floor(t*i),e.height=Math.floor(n*i),this.setViewport(0,0,t,n)},this.getCurrentViewport=function(t){return t.copy(T)},this.getViewport=function(t){return t.copy(U)},this.setViewport=function(t,e,n,i){t.isVector4?U.set(t.x,t.y,t.z,t.w):U.set(t,e,n,i),J.viewport(T.copy(U).multiplyScalar(I).round())},this.getScissor=function(t){return t.copy(O)},this.setScissor=function(t,e,n,i){t.isVector4?O.set(t.x,t.y,t.z,t.w):O.set(t,e,n,i),J.scissor(E.copy(O).multiplyScalar(I).round())},this.getScissorTest=function(){return F},this.setScissorTest=function(t){J.setScissorTest(F=t)},this.setOpaqueSort=function(t){L=t},this.setTransparentSort=function(t){B=t},this.getClearColor=function(t){return t.copy(St.getClearColor())},this.setClearColor=function(){St.setClearColor.apply(St,arguments)},this.getClearAlpha=function(){return St.getClearAlpha()},this.setClearAlpha=function(){St.setClearAlpha.apply(St,arguments)},this.clear=function(t=!0,e=!0,n=!0){let i=0;if(t){let t=!1;if(null!==S){const e=S.texture.format;t=e===ft||e===pt||e===dt}if(t){const t=S.texture.type,e=t===K||t===it||t===et||t===lt||t===at||t===ot,n=St.getClearColor(),i=St.getClearAlpha(),r=n.r,s=n.g,a=n.b;e?(d[0]=r,d[1]=s,d[2]=a,d[3]=i,Nt.clearBufferuiv(Nt.COLOR,0,d)):(p[0]=r,p[1]=s,p[2]=a,p[3]=i,Nt.clearBufferiv(Nt.COLOR,0,p))}else i|=Nt.COLOR_BUFFER_BIT}e&&(i|=Nt.DEPTH_BUFFER_BIT,Nt.clearDepth(this.capabilities.reverseDepthBuffer?0:1)),n&&(i|=Nt.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),Nt.clear(i)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",Lt,!1),e.removeEventListener("webglcontextrestored",Bt,!1),e.removeEventListener("webglcontextcreationerror",Ut,!1),vt.dispose(),_t.dispose(),nt.dispose(),ut.dispose(),ht.dispose(),mt.dispose(),Ct.dispose(),Rt.dispose(),gt.dispose(),It.dispose(),It.removeEventListener("sessionstart",zt),It.removeEventListener("sessionend",qt),Gt.stop()},this.renderBufferDirect=function(t,e,n,i,r,s){null===e&&(e=W);const a=r.isMesh&&r.matrixWorld.determinant()<0,o=function(t,e,n,i,r){!0!==e.isScene&&(e=W);rt.resetTextureUnits();const s=e.fog,a=i.isMeshStandardMaterial?e.environment:null,o=null===S?v.outputColorSpace:!0===S.isXRRenderTarget?S.texture.colorSpace:Qt,l=(i.isMeshStandardMaterial?ht:ut).get(i.envMap||a),u=!0===i.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,h=!!n.attributes.tangent&&(!!i.normalMap||i.anisotropy>0),c=!!n.morphAttributes.position,A=!!n.morphAttributes.normal,d=!!n.morphAttributes.color;let p=0;i.toneMapped&&(null!==S&&!0!==S.isXRRenderTarget||(p=v.toneMapping));const f=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,g=void 0!==f?f.length:0,y=nt.get(i),_=m.state.lights;if(!0===z&&(!0===q||t!==w)){const e=t===w&&i.id===M;xt.setState(i,t,e)}let x=!1;i.version===y.__version?y.needsLights&&y.lightsStateVersion!==_.state.version||y.outputColorSpace!==o||r.isBatchedMesh&&!1===y.batching?x=!0:r.isBatchedMesh||!0!==y.batching?r.isBatchedMesh&&!0===y.batchingColor&&null===r.colorTexture||r.isBatchedMesh&&!1===y.batchingColor&&null!==r.colorTexture||r.isInstancedMesh&&!1===y.instancing?x=!0:r.isInstancedMesh||!0!==y.instancing?r.isSkinnedMesh&&!1===y.skinning?x=!0:r.isSkinnedMesh||!0!==y.skinning?r.isInstancedMesh&&!0===y.instancingColor&&null===r.instanceColor||r.isInstancedMesh&&!1===y.instancingColor&&null!==r.instanceColor||r.isInstancedMesh&&!0===y.instancingMorph&&null===r.morphTexture||r.isInstancedMesh&&!1===y.instancingMorph&&null!==r.morphTexture||y.envMap!==l||!0===i.fog&&y.fog!==s?x=!0:void 0===y.numClippingPlanes||y.numClippingPlanes===xt.numPlanes&&y.numIntersection===xt.numIntersection?(y.vertexAlphas!==u||y.vertexTangents!==h||y.morphTargets!==c||y.morphNormals!==A||y.morphColors!==d||y.toneMapping!==p||y.morphTargetsCount!==g)&&(x=!0):x=!0:x=!0:x=!0:x=!0:(x=!0,y.__version=i.version);let b=y.currentProgram;!0===x&&(b=$t(i,e,r));let T=!1,E=!1,C=!1;const R=b.getUniforms(),N=y.uniforms;J.useProgram(b.program)&&(T=!0,E=!0,C=!0);i.id!==M&&(M=i.id,E=!0);if(T||w!==t){$.reverseDepthBuffer?(G.copy(t.projectionMatrix),function(t){const e=t.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}(G),function(t){const e=t.elements;-1===e[11]?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=1-e[14])}(G),R.setValue(Nt,"projectionMatrix",G)):R.setValue(Nt,"projectionMatrix",t.projectionMatrix),R.setValue(Nt,"viewMatrix",t.matrixWorldInverse);const e=R.map.cameraPosition;void 0!==e&&e.setValue(Nt,H.setFromMatrixPosition(t.matrixWorld)),$.logarithmicDepthBuffer&&R.setValue(Nt,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&R.setValue(Nt,"isOrthographic",!0===t.isOrthographicCamera),w!==t&&(w=t,E=!0,C=!0)}if(r.isSkinnedMesh){R.setOptional(Nt,r,"bindMatrix"),R.setOptional(Nt,r,"bindMatrixInverse");const t=r.skeleton;t&&(null===t.boneTexture&&t.computeBoneTexture(),R.setValue(Nt,"boneTexture",t.boneTexture,rt))}r.isBatchedMesh&&(R.setOptional(Nt,r,"batchingTexture"),R.setValue(Nt,"batchingTexture",r._matricesTexture,rt),R.setOptional(Nt,r,"batchingIdTexture"),R.setValue(Nt,"batchingIdTexture",r._indirectTexture,rt),R.setOptional(Nt,r,"batchingColorTexture"),null!==r._colorsTexture&&R.setValue(Nt,"batchingColorTexture",r._colorsTexture,rt));const P=n.morphAttributes;void 0===P.position&&void 0===P.normal&&void 0===P.color||Mt.update(r,n,b);(E||y.receiveShadow!==r.receiveShadow)&&(y.receiveShadow=r.receiveShadow,R.setValue(Nt,"receiveShadow",r.receiveShadow));i.isMeshGouraudMaterial&&null!==i.envMap&&(N.envMap.value=l,N.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1);i.isMeshStandardMaterial&&null===i.envMap&&null!==e.environment&&(N.envMapIntensity.value=e.environmentIntensity);E&&(R.setValue(Nt,"toneMappingExposure",v.toneMappingExposure),y.needsLights&&(B=C,(L=N).ambientLightColor.needsUpdate=B,L.lightProbe.needsUpdate=B,L.directionalLights.needsUpdate=B,L.directionalLightShadows.needsUpdate=B,L.pointLights.needsUpdate=B,L.pointLightShadows.needsUpdate=B,L.spotLights.needsUpdate=B,L.spotLightShadows.needsUpdate=B,L.rectAreaLights.needsUpdate=B,L.hemisphereLights.needsUpdate=B),s&&!0===i.fog&&yt.refreshFogUniforms(N,s),yt.refreshMaterialUniforms(N,i,I,D,m.state.transmissionRenderTarget[t.id]),fa.upload(Nt,Zt(y),N,rt));var L,B;i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(fa.upload(Nt,Zt(y),N,rt),i.uniformsNeedUpdate=!1);i.isSpriteMaterial&&R.setValue(Nt,"center",r.center);if(R.setValue(Nt,"modelViewMatrix",r.modelViewMatrix),R.setValue(Nt,"normalMatrix",r.normalMatrix),R.setValue(Nt,"modelMatrix",r.matrixWorld),i.isShaderMaterial||i.isRawShaderMaterial){const t=i.uniformsGroups;for(let e=0,n=t.length;e<n;e++){const n=t[e];Rt.update(n,b),Rt.bind(n,b)}}return b}(t,e,n,i,r);J.setMaterial(i,a);let l=n.index,u=1;if(!0===i.wireframe){if(l=At.getWireframeAttribute(n),void 0===l)return;u=2}const h=n.drawRange,c=n.attributes.position;let A=h.start*u,d=(h.start+h.count)*u;null!==s&&(A=Math.max(A,s.start*u),d=Math.min(d,(s.start+s.count)*u)),null!==l?(A=Math.max(A,0),d=Math.min(d,l.count)):null!=c&&(A=Math.max(A,0),d=Math.min(d,c.count));const p=d-A;if(p<0||p===1/0)return;let f;Ct.setup(r,i,o,n,l);let g=wt;if(null!==l&&(f=ct.get(l),g=Tt,g.setIndex(f)),r.isMesh)!0===i.wireframe?(J.setLineWidth(i.wireframeLinewidth*Y()),g.setMode(Nt.LINES)):g.setMode(Nt.TRIANGLES);else if(r.isLine){let t=i.linewidth;void 0===t&&(t=1),J.setLineWidth(t*Y()),r.isLineSegments?g.setMode(Nt.LINES):r.isLineLoop?g.setMode(Nt.LINE_LOOP):g.setMode(Nt.LINE_STRIP)}else r.isPoints?g.setMode(Nt.POINTS):r.isSprite&&g.setMode(Nt.TRIANGLES);if(r.isBatchedMesh)if(null!==r._multiDrawInstances)g.renderMultiDrawInstances(r._multiDrawStarts,r._multiDrawCounts,r._multiDrawCount,r._multiDrawInstances);else if(Q.get("WEBGL_multi_draw"))g.renderMultiDraw(r._multiDrawStarts,r._multiDrawCounts,r._multiDrawCount);else{const t=r._multiDrawStarts,e=r._multiDrawCounts,n=r._multiDrawCount,s=l?ct.get(l).bytesPerElement:1,a=nt.get(i).currentProgram.getUniforms();for(let i=0;i<n;i++)a.setValue(Nt,"_gl_DrawID",i),g.render(t[i]/s,e[i])}else if(r.isInstancedMesh)g.renderInstances(A,p,r.count);else if(n.isInstancedBufferGeometry){const t=void 0!==n._maxInstanceCount?n._maxInstanceCount:1/0,e=Math.min(n.instanceCount,t);g.renderInstances(A,p,e)}else g.render(A,p)},this.compile=function(t,e,n=null){null===n&&(n=t),m=_t.get(n),m.init(e),y.push(m),n.traverseVisible((function(t){t.isLight&&t.layers.test(e.layers)&&(m.pushLight(t),t.castShadow&&m.pushShadow(t))})),t!==n&&t.traverseVisible((function(t){t.isLight&&t.layers.test(e.layers)&&(m.pushLight(t),t.castShadow&&m.pushShadow(t))})),m.setupLights();const i=new Set;return t.traverse((function(t){if(!(t.isMesh||t.isPoints||t.isLine||t.isSprite))return;const e=t.material;if(e)if(Array.isArray(e))for(let r=0;r<e.length;r++){const s=e[r];Ft(s,n,t),i.add(s)}else Ft(e,n,t),i.add(e)})),y.pop(),m=null,i},this.compileAsync=function(t,e,n=null){const i=this.compile(t,e,n);return new Promise((e=>{function n(){i.forEach((function(t){nt.get(t).currentProgram.isReady()&&i.delete(t)})),0!==i.size?setTimeout(n,10):e(t)}null!==Q.get("KHR_parallel_shader_compile")?n():setTimeout(n,10)}))};let kt=null;function zt(){Gt.stop()}function qt(){Gt.start()}const Gt=new Mr;function Vt(t,e,n,i){if(!1===t.visible)return;if(t.layers.test(e.layers))if(t.isGroup)n=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)m.pushLight(t),t.castShadow&&m.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||k.intersectsSprite(t)){i&&j.setFromMatrixPosition(t.matrixWorld).applyMatrix4(V);const e=mt.update(t),r=t.material;r.visible&&f.push(t,e,r,n,j.z,null)}}else if((t.isMesh||t.isLine||t.isPoints)&&(!t.frustumCulled||k.intersectsObject(t))){const e=mt.update(t),r=t.material;if(i&&(void 0!==t.boundingSphere?(null===t.boundingSphere&&t.computeBoundingSphere(),j.copy(t.boundingSphere.center)):(null===e.boundingSphere&&e.computeBoundingSphere(),j.copy(e.boundingSphere.center)),j.applyMatrix4(t.matrixWorld).applyMatrix4(V)),Array.isArray(r)){const i=e.groups;for(let s=0,a=i.length;s<a;s++){const a=i[s],o=r[a.materialIndex];o&&o.visible&&f.push(t,e,o,n,j.z,a)}}else r.visible&&f.push(t,e,r,n,j.z,null)}const r=t.children;for(let t=0,s=r.length;t<s;t++)Vt(r[t],e,n,i)}function Ht(t,e,n,i){const r=t.opaque,s=t.transmissive,a=t.transparent;m.setupLightsView(n),!0===z&&xt.setGlobalState(v.clippingPlanes,n),i&&J.viewport(T.copy(i)),r.length>0&&Wt(r,e,n),s.length>0&&Wt(s,e,n),a.length>0&&Wt(a,e,n),J.buffers.depth.setTest(!0),J.buffers.depth.setMask(!0),J.buffers.color.setMask(!0),J.setPolygonOffset(!1)}function jt(t,e,n,i){if(null!==(!0===n.isScene?n.overrideMaterial:null))return;void 0===m.state.transmissionRenderTarget[i.id]&&(m.state.transmissionRenderTarget[i.id]=new Ze(1,1,{generateMipmaps:!0,type:Q.has("EXT_color_buffer_half_float")||Q.has("EXT_color_buffer_float")?st:K,minFilter:Z,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:ke.workingColorSpace}));const s=m.state.transmissionRenderTarget[i.id],a=i.viewport||T;s.setSize(a.z,a.w);const o=v.getRenderTarget();v.setRenderTarget(s),v.getClearColor(R),N=v.getClearAlpha(),N<1&&v.setClearColor(16777215,.5),v.clear(),X&&St.render(n);const l=v.toneMapping;v.toneMapping=0;const u=i.viewport;if(void 0!==i.viewport&&(i.viewport=void 0),m.setupLightsView(i),!0===z&&xt.setGlobalState(v.clippingPlanes,i),Wt(t,n,i),rt.updateMultisampleRenderTarget(s),rt.updateRenderTargetMipmap(s),!1===Q.has("WEBGL_multisampled_render_to_texture")){let t=!1;for(let r=0,s=e.length;r<s;r++){const s=e[r],a=s.object,o=s.geometry,l=s.material,u=s.group;if(2===l.side&&a.layers.test(i.layers)){const e=l.side;l.side=1,l.needsUpdate=!0,Xt(a,n,i,o,l,u),l.side=e,l.needsUpdate=!0,t=!0}}!0===t&&(rt.updateMultisampleRenderTarget(s),rt.updateRenderTargetMipmap(s))}v.setRenderTarget(o),v.setClearColor(R,N),void 0!==u&&(i.viewport=u),v.toneMapping=l}function Wt(t,e,n){const i=!0===e.isScene?e.overrideMaterial:null;for(let r=0,s=t.length;r<s;r++){const s=t[r],a=s.object,o=s.geometry,l=null===i?s.material:i,u=s.group;a.layers.test(n.layers)&&Xt(a,e,n,o,l,u)}}function Xt(t,e,n,i,r,s){t.onBeforeRender(v,e,n,i,r,s),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),r.onBeforeRender(v,e,n,i,t,s),!0===r.transparent&&2===r.side&&!1===r.forceSinglePass?(r.side=1,r.needsUpdate=!0,v.renderBufferDirect(n,e,i,r,t,s),r.side=0,r.needsUpdate=!0,v.renderBufferDirect(n,e,i,r,t,s),r.side=2):v.renderBufferDirect(n,e,i,r,t,s),t.onAfterRender(v,e,n,i,r,s)}function $t(t,e,n){!0!==e.isScene&&(e=W);const i=nt.get(t),r=m.state.lights,s=m.state.shadowsArray,a=r.state.version,o=gt.getParameters(t,r.state,s,e,n),l=gt.getProgramCacheKey(o);let u=i.programs;i.environment=t.isMeshStandardMaterial?e.environment:null,i.fog=e.fog,i.envMap=(t.isMeshStandardMaterial?ht:ut).get(t.envMap||i.environment),i.envMapRotation=null!==i.environment&&null===t.envMap?e.environmentRotation:t.envMapRotation,void 0===u&&(t.addEventListener("dispose",Ot),u=new Map,i.programs=u);let h=u.get(l);if(void 0!==h){if(i.currentProgram===h&&i.lightsStateVersion===a)return Kt(t,o),h}else o.uniforms=gt.getUniforms(t),t.onBeforeCompile(o,v),h=gt.acquireProgram(o,l),u.set(l,h),i.uniforms=o.uniforms;const c=i.uniforms;return(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(c.clippingPlanes=xt.uniform),Kt(t,o),i.needsLights=function(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}(t),i.lightsStateVersion=a,i.needsLights&&(c.ambientLightColor.value=r.state.ambient,c.lightProbe.value=r.state.probe,c.directionalLights.value=r.state.directional,c.directionalLightShadows.value=r.state.directionalShadow,c.spotLights.value=r.state.spot,c.spotLightShadows.value=r.state.spotShadow,c.rectAreaLights.value=r.state.rectArea,c.ltc_1.value=r.state.rectAreaLTC1,c.ltc_2.value=r.state.rectAreaLTC2,c.pointLights.value=r.state.point,c.pointLightShadows.value=r.state.pointShadow,c.hemisphereLights.value=r.state.hemi,c.directionalShadowMap.value=r.state.directionalShadowMap,c.directionalShadowMatrix.value=r.state.directionalShadowMatrix,c.spotShadowMap.value=r.state.spotShadowMap,c.spotLightMatrix.value=r.state.spotLightMatrix,c.spotLightMap.value=r.state.spotLightMap,c.pointShadowMap.value=r.state.pointShadowMap,c.pointShadowMatrix.value=r.state.pointShadowMatrix),i.currentProgram=h,i.uniformsList=null,h}function Zt(t){if(null===t.uniformsList){const e=t.currentProgram.getUniforms();t.uniformsList=fa.seqWithValue(e.seq,t.uniforms)}return t.uniformsList}function Kt(t,e){const n=nt.get(t);n.outputColorSpace=e.outputColorSpace,n.batching=e.batching,n.batchingColor=e.batchingColor,n.instancing=e.instancing,n.instancingColor=e.instancingColor,n.instancingMorph=e.instancingMorph,n.skinning=e.skinning,n.morphTargets=e.morphTargets,n.morphNormals=e.morphNormals,n.morphColors=e.morphColors,n.morphTargetsCount=e.morphTargetsCount,n.numClippingPlanes=e.numClippingPlanes,n.numIntersection=e.numClipIntersection,n.vertexAlphas=e.vertexAlphas,n.vertexTangents=e.vertexTangents,n.toneMapping=e.toneMapping}Gt.setAnimationLoop((function(t){kt&&kt(t)})),"undefined"!=typeof self&&Gt.setContext(self),this.setAnimationLoop=function(t){kt=t,It.setAnimationLoop(t),null===t?Gt.stop():Gt.start()},It.addEventListener("sessionstart",zt),It.addEventListener("sessionend",qt),this.render=function(t,e){if(void 0!==e&&!0!==e.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===_)return;if(!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),null===e.parent&&!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),!0===It.enabled&&!0===It.isPresenting&&(!0===It.cameraAutoUpdate&&It.updateCamera(e),e=It.getCamera()),!0===t.isScene&&t.onBeforeRender(v,t,e,S),m=_t.get(t,y.length),m.init(e),y.push(m),V.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),k.setFromProjectionMatrix(V),q=this.localClippingEnabled,z=xt.init(this.clippingPlanes,q),f=vt.get(t,g.length),f.init(),g.push(f),!0===It.enabled&&!0===It.isPresenting){const t=v.xr.getDepthSensingMesh();null!==t&&Vt(t,e,-1/0,v.sortObjects)}Vt(t,e,0,v.sortObjects),f.finish(),!0===v.sortObjects&&f.sort(L,B),X=!1===It.enabled||!1===It.isPresenting||!1===It.hasDepthSensing(),X&&St.addToRenderList(f,t),this.info.render.frame++,!0===z&&xt.beginShadows();const n=m.state.shadowsArray;bt.render(n,t,e),!0===z&&xt.endShadows(),!0===this.info.autoReset&&this.info.reset();const i=f.opaque,r=f.transmissive;if(m.setupLights(),e.isArrayCamera){const n=e.cameras;if(r.length>0)for(let e=0,s=n.length;e<s;e++){jt(i,r,t,n[e])}X&&St.render(t);for(let e=0,i=n.length;e<i;e++){const i=n[e];Ht(f,t,i,i.viewport)}}else r.length>0&&jt(i,r,t,e),X&&St.render(t),Ht(f,t,e);null!==S&&(rt.updateMultisampleRenderTarget(S),rt.updateRenderTargetMipmap(S)),!0===t.isScene&&t.onAfterRender(v,t,e),Ct.resetDefaultState(),M=-1,w=null,y.pop(),y.length>0?(m=y[y.length-1],!0===z&&xt.setGlobalState(v.clippingPlanes,m.state.camera)):m=null,g.pop(),f=g.length>0?g[g.length-1]:null},this.getActiveCubeFace=function(){return x},this.getActiveMipmapLevel=function(){return b},this.getRenderTarget=function(){return S},this.setRenderTargetTextures=function(t,e,n){nt.get(t.texture).__webglTexture=e,nt.get(t.depthTexture).__webglTexture=n;const i=nt.get(t);i.__hasExternalTextures=!0,i.__autoAllocateDepthBuffer=void 0===n,i.__autoAllocateDepthBuffer||!0===Q.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),i.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(t,e){const n=nt.get(t);n.__webglFramebuffer=e,n.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,n=0){S=t,x=e,b=n;let i=!0,r=null,s=!1,a=!1;if(t){const o=nt.get(t);if(void 0!==o.__useDefaultFramebuffer)J.bindFramebuffer(Nt.FRAMEBUFFER,null),i=!1;else if(void 0===o.__webglFramebuffer)rt.setupRenderTarget(t);else if(o.__hasExternalTextures)rt.rebindTextures(t,nt.get(t.texture).__webglTexture,nt.get(t.depthTexture).__webglTexture);else if(t.depthBuffer){const e=t.depthTexture;if(o.__boundDepthTexture!==e){if(null!==e&&nt.has(e)&&(t.width!==e.image.width||t.height!==e.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");rt.setupDepthRenderbuffer(t)}}const l=t.texture;(l.isData3DTexture||l.isDataArrayTexture||l.isCompressedArrayTexture)&&(a=!0);const u=nt.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(r=Array.isArray(u[e])?u[e][n]:u[e],s=!0):r=t.samples>0&&!1===rt.useMultisampledRTT(t)?nt.get(t).__webglMultisampledFramebuffer:Array.isArray(u)?u[n]:u,T.copy(t.viewport),E.copy(t.scissor),C=t.scissorTest}else T.copy(U).multiplyScalar(I).floor(),E.copy(O).multiplyScalar(I).floor(),C=F;if(J.bindFramebuffer(Nt.FRAMEBUFFER,r)&&i&&J.drawBuffers(t,r),J.viewport(T),J.scissor(E),J.setScissorTest(C),s){const i=nt.get(t.texture);Nt.framebufferTexture2D(Nt.FRAMEBUFFER,Nt.COLOR_ATTACHMENT0,Nt.TEXTURE_CUBE_MAP_POSITIVE_X+e,i.__webglTexture,n)}else if(a){const i=nt.get(t.texture),r=e||0;Nt.framebufferTextureLayer(Nt.FRAMEBUFFER,Nt.COLOR_ATTACHMENT0,i.__webglTexture,n||0,r)}M=-1},this.readRenderTargetPixels=function(t,e,n,i,r,s,a){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let o=nt.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==a&&(o=o[a]),o){J.bindFramebuffer(Nt.FRAMEBUFFER,o);try{const a=t.texture,o=a.format,l=a.type;if(!$.textureFormatReadable(o))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!$.textureTypeReadable(l))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");e>=0&&e<=t.width-i&&n>=0&&n<=t.height-r&&Nt.readPixels(e,n,i,r,Et.convert(o),Et.convert(l),s)}finally{const t=null!==S?nt.get(S).__webglFramebuffer:null;J.bindFramebuffer(Nt.FRAMEBUFFER,t)}}},this.readRenderTargetPixelsAsync=async function(t,e,n,i,r,s,a){if(!t||!t.isWebGLRenderTarget)throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let o=nt.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==a&&(o=o[a]),o){const a=t.texture,l=a.format,u=a.type;if(!$.textureFormatReadable(l))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!$.textureTypeReadable(u))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(e>=0&&e<=t.width-i&&n>=0&&n<=t.height-r){J.bindFramebuffer(Nt.FRAMEBUFFER,o);const t=Nt.createBuffer();Nt.bindBuffer(Nt.PIXEL_PACK_BUFFER,t),Nt.bufferData(Nt.PIXEL_PACK_BUFFER,s.byteLength,Nt.STREAM_READ),Nt.readPixels(e,n,i,r,Et.convert(l),Et.convert(u),0);const a=null!==S?nt.get(S).__webglFramebuffer:null;J.bindFramebuffer(Nt.FRAMEBUFFER,a);const h=Nt.fenceSync(Nt.SYNC_GPU_COMMANDS_COMPLETE,0);return Nt.flush(),await function(t,e,n){return new Promise((function(i,r){setTimeout((function s(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:r();break;case t.TIMEOUT_EXPIRED:setTimeout(s,n);break;default:i()}}),n)}))}(Nt,h,4),Nt.bindBuffer(Nt.PIXEL_PACK_BUFFER,t),Nt.getBufferSubData(Nt.PIXEL_PACK_BUFFER,0,s),Nt.deleteBuffer(t),Nt.deleteSync(h),s}throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(t,e=null,n=0){!0!==t.isTexture&&(Le("WebGLRenderer: copyFramebufferToTexture function signature has changed."),e=arguments[0]||null,t=arguments[1]);const i=Math.pow(2,-n),r=Math.floor(t.image.width*i),s=Math.floor(t.image.height*i),a=null!==e?e.x:0,o=null!==e?e.y:0;rt.setTexture2D(t,0),Nt.copyTexSubImage2D(Nt.TEXTURE_2D,n,0,0,a,o,r,s),J.unbindTexture()},this.copyTextureToTexture=function(t,e,n=null,i=null,r=0){let s,a,o,l,u,h;!0!==t.isTexture&&(Le("WebGLRenderer: copyTextureToTexture function signature has changed."),i=arguments[0]||null,t=arguments[1],e=arguments[2],r=arguments[3]||0,n=null),null!==n?(s=n.max.x-n.min.x,a=n.max.y-n.min.y,o=n.min.x,l=n.min.y):(s=t.image.width,a=t.image.height,o=0,l=0),null!==i?(u=i.x,h=i.y):(u=0,h=0);const c=Et.convert(e.format),A=Et.convert(e.type);rt.setTexture2D(e,0),Nt.pixelStorei(Nt.UNPACK_FLIP_Y_WEBGL,e.flipY),Nt.pixelStorei(Nt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),Nt.pixelStorei(Nt.UNPACK_ALIGNMENT,e.unpackAlignment);const d=Nt.getParameter(Nt.UNPACK_ROW_LENGTH),p=Nt.getParameter(Nt.UNPACK_IMAGE_HEIGHT),f=Nt.getParameter(Nt.UNPACK_SKIP_PIXELS),m=Nt.getParameter(Nt.UNPACK_SKIP_ROWS),g=Nt.getParameter(Nt.UNPACK_SKIP_IMAGES),y=t.isCompressedTexture?t.mipmaps[r]:t.image;Nt.pixelStorei(Nt.UNPACK_ROW_LENGTH,y.width),Nt.pixelStorei(Nt.UNPACK_IMAGE_HEIGHT,y.height),Nt.pixelStorei(Nt.UNPACK_SKIP_PIXELS,o),Nt.pixelStorei(Nt.UNPACK_SKIP_ROWS,l),t.isDataTexture?Nt.texSubImage2D(Nt.TEXTURE_2D,r,u,h,s,a,c,A,y.data):t.isCompressedTexture?Nt.compressedTexSubImage2D(Nt.TEXTURE_2D,r,u,h,y.width,y.height,c,y.data):Nt.texSubImage2D(Nt.TEXTURE_2D,r,u,h,s,a,c,A,y),Nt.pixelStorei(Nt.UNPACK_ROW_LENGTH,d),Nt.pixelStorei(Nt.UNPACK_IMAGE_HEIGHT,p),Nt.pixelStorei(Nt.UNPACK_SKIP_PIXELS,f),Nt.pixelStorei(Nt.UNPACK_SKIP_ROWS,m),Nt.pixelStorei(Nt.UNPACK_SKIP_IMAGES,g),0===r&&e.generateMipmaps&&Nt.generateMipmap(Nt.TEXTURE_2D),J.unbindTexture()},this.copyTextureToTexture3D=function(t,e,n=null,i=null,r=0){let s,a,o,l,u,h,c,A,d;!0!==t.isTexture&&(Le("WebGLRenderer: copyTextureToTexture3D function signature has changed."),n=arguments[0]||null,i=arguments[1]||null,t=arguments[2],e=arguments[3],r=arguments[4]||0);const p=t.isCompressedTexture?t.mipmaps[r]:t.image;null!==n?(s=n.max.x-n.min.x,a=n.max.y-n.min.y,o=n.max.z-n.min.z,l=n.min.x,u=n.min.y,h=n.min.z):(s=p.width,a=p.height,o=p.depth,l=0,u=0,h=0),null!==i?(c=i.x,A=i.y,d=i.z):(c=0,A=0,d=0);const f=Et.convert(e.format),m=Et.convert(e.type);let g;if(e.isData3DTexture)rt.setTexture3D(e,0),g=Nt.TEXTURE_3D;else{if(!e.isDataArrayTexture&&!e.isCompressedArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");rt.setTexture2DArray(e,0),g=Nt.TEXTURE_2D_ARRAY}Nt.pixelStorei(Nt.UNPACK_FLIP_Y_WEBGL,e.flipY),Nt.pixelStorei(Nt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),Nt.pixelStorei(Nt.UNPACK_ALIGNMENT,e.unpackAlignment);const y=Nt.getParameter(Nt.UNPACK_ROW_LENGTH),v=Nt.getParameter(Nt.UNPACK_IMAGE_HEIGHT),_=Nt.getParameter(Nt.UNPACK_SKIP_PIXELS),x=Nt.getParameter(Nt.UNPACK_SKIP_ROWS),b=Nt.getParameter(Nt.UNPACK_SKIP_IMAGES);Nt.pixelStorei(Nt.UNPACK_ROW_LENGTH,p.width),Nt.pixelStorei(Nt.UNPACK_IMAGE_HEIGHT,p.height),Nt.pixelStorei(Nt.UNPACK_SKIP_PIXELS,l),Nt.pixelStorei(Nt.UNPACK_SKIP_ROWS,u),Nt.pixelStorei(Nt.UNPACK_SKIP_IMAGES,h),t.isDataTexture||t.isData3DTexture?Nt.texSubImage3D(g,r,c,A,d,s,a,o,f,m,p.data):e.isCompressedArrayTexture?Nt.compressedTexSubImage3D(g,r,c,A,d,s,a,o,f,p.data):Nt.texSubImage3D(g,r,c,A,d,s,a,o,f,m,p),Nt.pixelStorei(Nt.UNPACK_ROW_LENGTH,y),Nt.pixelStorei(Nt.UNPACK_IMAGE_HEIGHT,v),Nt.pixelStorei(Nt.UNPACK_SKIP_PIXELS,_),Nt.pixelStorei(Nt.UNPACK_SKIP_ROWS,x),Nt.pixelStorei(Nt.UNPACK_SKIP_IMAGES,b),0===r&&e.generateMipmaps&&Nt.generateMipmap(g),J.unbindTexture()},this.initRenderTarget=function(t){void 0===nt.get(t).__webglFramebuffer&&rt.setupRenderTarget(t)},this.initTexture=function(t){t.isCubeTexture?rt.setTextureCube(t,0):t.isData3DTexture?rt.setTexture3D(t,0):t.isDataArrayTexture||t.isCompressedArrayTexture?rt.setTexture2DArray(t,0):rt.setTexture2D(t,0),J.unbindTexture()},this.resetState=function(){x=0,b=0,S=null,J.reset(),Ct.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return de}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=t===$t?"display-p3":"srgb",e.unpackColorSpace=ke.workingColorSpace===Zt?"display-p3":"srgb"}},Scene:class extends si{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Gn,this.environmentIntensity=1,this.environmentRotation=new Gn,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}},PerspectiveCamera:Ar,Raycaster:class{constructor(t,e,n=0,i=1/0){this.ray=new Pn(t,e),this.near=n,this.far=i,this.camera=null,this.layers=new Vn,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type: "+e.type)}setFromXRController(t){return Zl.identity().extractRotation(t.matrixWorld),this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Zl),this}intersectObject(t,e=!0,n=[]){return Jl(t,this,n,e),n.sort(Kl),n}intersectObjects(t,e=!0,n=[]){for(let i=0,r=t.length;i<r;i++)Jl(t[i],this,n,e);return n.sort(Kl),n}},SRGBColorSpace:Yt,TextureLoader:zl,Vector2:Ee,Vector3:en,Box3:sn,Color:Mi,Mesh:tr,SphereGeometry:Nl,MeshBasicMaterial:Ci,BackSide:1,EventDispatcher:fe,MOUSE:a,Quaternion:tn,Spherical:tu,Clock:Yl},NH=Fu({props:{width:{default:window.innerWidth,onChange:function(t,e,n){isNaN(t)&&(e.width=n)}},height:{default:window.innerHeight,onChange:function(t,e,n){isNaN(t)&&(e.height=n)}},backgroundColor:{default:"#000011"},backgroundImageUrl:{},onBackgroundImageLoaded:{},showNavInfo:{default:!0},skyRadius:{default:5e4},objects:{default:[]},lights:{default:[]},enablePointerInteraction:{default:!0,onChange:function(t,e){e.hoverObj=null,e.toolTipElem&&(e.toolTipElem.innerHTML="")},triggerUpdate:!1},lineHoverPrecision:{default:1,triggerUpdate:!1},hoverOrderComparator:{default:function(){return-1},triggerUpdate:!1},hoverFilter:{default:function(){return!0},triggerUpdate:!1},tooltipContent:{triggerUpdate:!1},hoverDuringDrag:{default:!1,triggerUpdate:!1},clickAfterDrag:{default:!1,triggerUpdate:!1},onHover:{default:function(){},triggerUpdate:!1},onClick:{default:function(){},triggerUpdate:!1},onRightClick:{triggerUpdate:!1}},methods:{tick:function(t){if(t.initialised){if(t.controls.update&&t.controls.update(Math.min(1,t.clock.getDelta())),t.postProcessingComposer?t.postProcessingComposer.render():t.renderer.render(t.scene,t.camera),t.extraRenderers.forEach((function(e){return e.render(t.scene,t.camera)})),t.enablePointerInteraction){var e=null;if(t.hoverDuringDrag||!t.isPointerDragging){var n=this.intersectingObjects(t.pointerPos.x,t.pointerPos.y).filter((function(e){return t.hoverFilter(e.object)})).sort((function(e,n){return t.hoverOrderComparator(e.object,n.object)})),i=n.length?n[0]:null;e=i?i.object:null,t.intersectionPoint=i?i.point:null}e!==t.hoverObj&&(t.onHover(e,t.hoverObj),t.toolTipElem.innerHTML=e&&Xd(t.tooltipContent)(e)||"",t.hoverObj=e)}t.tweenGroup.update()}return this},getPointerPos:function(t){var e=t.pointerPos;return{x:e.x,y:e.y}},cameraPosition:function(t,e,n,i){var r=t.camera;if(e&&t.initialised){var s=e,a=n||{x:0,y:0,z:0};if(i){var o=Object.assign({},r.position),l=c();t.tweenGroup.add(new Wu(o).to(s,i).easing(zu.Quadratic.Out).onUpdate(u).start()),t.tweenGroup.add(new Wu(l).to(a,i/3).easing(zu.Quadratic.Out).onUpdate(h).start())}else u(s),h(a);return this}return Object.assign({},r.position,{lookAt:c()});function u(t){var e=t.x,n=t.y,i=t.z;void 0!==e&&(r.position.x=e),void 0!==n&&(r.position.y=n),void 0!==i&&(r.position.z=i)}function h(e){var n=new RH.Vector3(e.x,e.y,e.z);t.controls.target?t.controls.target=n:r.lookAt(n)}function c(){return Object.assign(new RH.Vector3(0,0,-1e3).applyQuaternion(r.quaternion).add(r.position))}},zoomToFit:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,i=arguments.length,r=new Array(i>3?i-3:0),s=3;s<i;s++)r[s-3]=arguments[s];return this.fitToBbox(this.getBbox.apply(this,r),e,n)},fitToBbox:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,r=t.camera;if(e){var s=new RH.Vector3(0,0,0),a=2*Math.max.apply(Math,EH(Object.entries(e).map((function(t){var e=TH(t,2),n=e[0],i=e[1];return Math.max.apply(Math,EH(i.map((function(t){return Math.abs(s[n]-t)}))))})))),o=(1-2*i/t.height)*r.fov,l=a/Math.atan(o*Math.PI/180),u=l/r.aspect,h=Math.max(l,u);if(h>0){var c=s.clone().sub(r.position).normalize().multiplyScalar(-h);this.cameraPosition(c,s,n)}}return this},getBbox:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},n=new RH.Box3(new RH.Vector3(0,0,0),new RH.Vector3(0,0,0)),i=t.objects.filter(e);return i.length?(i.forEach((function(t){return n.expandByObject(t)})),Object.assign.apply(Object,EH(["x","y","z"].map((function(t){return wH({},t,[n.min[t],n.max[t]])}))))):null},getScreenCoords:function(t,e,n,i){var r=new RH.Vector3(e,n,i);return r.project(this.camera()),{x:(r.x+1)*t.width/2,y:-(r.y-1)*t.height/2}},getSceneCoords:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=new RH.Vector2(e/t.width*2-1,-n/t.height*2+1),s=new RH.Raycaster;return s.setFromCamera(r,t.camera),Object.assign({},s.ray.at(i,new RH.Vector3))},intersectingObjects:function(t,e,n){var i=new RH.Vector2(e/t.width*2-1,-n/t.height*2+1),r=new RH.Raycaster;return r.params.Line.threshold=t.lineHoverPrecision,r.setFromCamera(i,t.camera),r.intersectObjects(t.objects,!0)},renderer:function(t){return t.renderer},scene:function(t){return t.scene},camera:function(t){return t.camera},postProcessingComposer:function(t){return t.postProcessingComposer},controls:function(t){return t.controls},tbControls:function(t){return t.controls}},stateInit:function(){return{scene:new RH.Scene,camera:new RH.PerspectiveCamera,clock:new RH.Clock,tweenGroup:new Gu}},init:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.controlType,r=void 0===i?"trackball":i,s=n.useWebGPU,a=void 0!==s&&s,o=n.rendererConfig,l=void 0===o?{}:o,u=n.extraRenderers,h=void 0===u?[]:u,c=n.waitForLoadComplete,A=void 0===c||c;t.innerHTML="",t.appendChild(e.container=document.createElement("div")),e.container.className="scene-container",e.container.style.position="relative",e.container.appendChild(e.navInfo=document.createElement("div")),e.navInfo.className="scene-nav-info",e.navInfo.textContent={orbit:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",trackball:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",fly:"WASD: move, R|F: up | down, Q|E: roll, up|down: pitch, left|right: yaw"}[r]||"",e.navInfo.style.display=e.showNavInfo?null:"none",e.toolTipElem=document.createElement("div"),e.toolTipElem.classList.add("scene-tooltip"),e.container.appendChild(e.toolTipElem),e.pointerPos=new RH.Vector2,e.pointerPos.x=-2,e.pointerPos.y=-2,["pointermove","pointerdown"].forEach((function(t){return e.container.addEventListener(t,(function(n){if("pointerdown"===t&&(e.isPointerPressed=!0),!e.isPointerDragging&&"pointermove"===n.type&&(n.pressure>0||e.isPointerPressed)&&("touch"!==n.pointerType||void 0===n.movementX||[n.movementX,n.movementY].some((function(t){return Math.abs(t)>1})))&&(e.isPointerDragging=!0),e.enablePointerInteraction){var i=(r=e.container,s=r.getBoundingClientRect(),a=window.pageXOffset||document.documentElement.scrollLeft,o=window.pageYOffset||document.documentElement.scrollTop,{top:s.top+o,left:s.left+a});e.pointerPos.x=n.pageX-i.left,e.pointerPos.y=n.pageY-i.top,e.toolTipElem.style.top="".concat(e.pointerPos.y,"px"),e.toolTipElem.style.left="".concat(e.pointerPos.x,"px"),e.toolTipElem.style.transform="translate(-".concat(e.pointerPos.x/e.width*100,"%, ").concat(e.height-e.pointerPos.y<100?"calc(-100% - 8px)":"21px",")")}var r,s,a,o}),{passive:!0})})),e.container.addEventListener("pointerup",(function(t){e.isPointerPressed=!1,e.isPointerDragging&&(e.isPointerDragging=!1,!e.clickAfterDrag)||requestAnimationFrame((function(){0===t.button&&e.onClick(e.hoverObj||null,t,e.intersectionPoint),2===t.button&&e.onRightClick&&e.onRightClick(e.hoverObj||null,t,e.intersectionPoint)}))}),{passive:!0,capture:!0}),e.container.addEventListener("contextmenu",(function(t){e.onRightClick&&t.preventDefault()})),e.renderer=new(a?lG:RH.WebGLRenderer)(Object.assign({antialias:!0,alpha:!0},l)),e.renderer.setPixelRatio(Math.min(2,window.devicePixelRatio)),e.container.appendChild(e.renderer.domElement),e.extraRenderers=h,e.extraRenderers.forEach((function(t){t.domElement.style.position="absolute",t.domElement.style.top="0px",t.domElement.style.pointerEvents="none",e.container.appendChild(t.domElement)})),e.postProcessingComposer=new kV(e.renderer),e.postProcessingComposer.addPass(new zV(e.scene,e.camera)),e.controls=new{trackball:RG,orbit:oV,fly:SV}[r](e.camera,e.renderer.domElement),"fly"===r&&(e.controls.movementSpeed=300,e.controls.rollSpeed=Math.PI/6,e.controls.dragToLook=!0),"trackball"!==r&&"orbit"!==r||(e.controls.minDistance=.1,e.controls.maxDistance=e.skyRadius,e.controls.addEventListener("start",(function(){e.controlsEngaged=!0})),e.controls.addEventListener("change",(function(){e.controlsEngaged&&(e.controlsDragging=!0)})),e.controls.addEventListener("end",(function(){e.controlsEngaged=!1,e.controlsDragging=!1}))),[e.renderer,e.postProcessingComposer].concat(EH(e.extraRenderers)).forEach((function(t){return t.setSize(e.width,e.height)})),e.camera.aspect=e.width/e.height,e.camera.updateProjectionMatrix(),e.camera.position.z=1e3,e.scene.add(e.skysphere=new RH.Mesh),e.skysphere.visible=!1,e.loadComplete=e.scene.visible=!A,window.scene=e.scene},update:function(t,e){if(t.width&&t.height&&(e.hasOwnProperty("width")||e.hasOwnProperty("height"))&&(t.container.style.width="".concat(t.width,"px"),t.container.style.height="".concat(t.height,"px"),[t.renderer,t.postProcessingComposer].concat(EH(t.extraRenderers)).forEach((function(e){return e.setSize(t.width,t.height)})),t.camera.aspect=t.width/t.height,t.camera.updateProjectionMatrix()),e.hasOwnProperty("skyRadius")&&t.skyRadius&&(t.controls.hasOwnProperty("maxDistance")&&e.skyRadius&&(t.controls.maxDistance=Math.min(t.controls.maxDistance,t.skyRadius)),t.camera.far=2.5*t.skyRadius,t.camera.updateProjectionMatrix(),t.skysphere.geometry=new RH.SphereGeometry(t.skyRadius)),e.hasOwnProperty("backgroundColor")){var n=oH(t.backgroundColor).alpha;void 0===n&&(n=1),t.renderer.setClearColor(new RH.Color(SH(1,t.backgroundColor)),n)}function i(){t.loadComplete=t.scene.visible=!0}e.hasOwnProperty("backgroundImageUrl")&&(t.backgroundImageUrl?(new RH.TextureLoader).load(t.backgroundImageUrl,(function(e){e.colorSpace=RH.SRGBColorSpace,t.skysphere.material=new RH.MeshBasicMaterial({map:e,side:RH.BackSide}),t.skysphere.visible=!0,t.onBackgroundImageLoaded&&setTimeout(t.onBackgroundImageLoaded),!t.loadComplete&&i()})):(t.skysphere.visible=!1,t.skysphere.material.map=null,!t.loadComplete&&i())),e.hasOwnProperty("showNavInfo")&&(t.navInfo.style.display=t.showNavInfo?null:"none"),e.hasOwnProperty("lights")&&((e.lights||[]).forEach((function(e){return t.scene.remove(e)})),t.lights.forEach((function(e){return t.scene.add(e)}))),e.hasOwnProperty("objects")&&((e.objects||[]).forEach((function(e){return t.scene.remove(e)})),t.objects.forEach((function(e){return t.scene.add(e)})))}});function PH(t,e){var n=new e;return n._destructor&&n._destructor(),{linkProp:function(e){return{default:n[e](),onChange:function(n,i){i[t][e](n)},triggerUpdate:!1}},linkMethod:function(e){return function(n){for(var i=n[t],r=arguments.length,s=new Array(r>1?r-1:0),a=1;a<r;a++)s[a-1]=arguments[a];var o=i[e].apply(i,s);return o===i?this:o}}}}var DH=["rendererConfig","waitForGlobeReady"],IH=i(i({},window.THREE?window.THREE:{AmbientLight:class extends ql{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight"}},DirectionalLight:class extends ql{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(si.DEFAULT_UP),this.updateMatrix(),this.target=new si,this.shadow=new Wl}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}},Vector2:Ee,REVISION:s}),{},{CSS2DRenderer:class{constructor(t={}){const e=this;let n,i,r,s;const a={objects:new WeakMap},o=void 0!==t.element?t.element:document.createElement("div");function l(t){t.isCSS2DObject&&(t.element.style.display="none");for(let e=0,n=t.children.length;e<n;e++)l(t.children[e])}function u(t,n,i){if(!1!==t.visible){if(t.isCSS2DObject){su.setFromMatrixPosition(t.matrixWorld),su.applyMatrix4(ou);const l=su.z>=-1&&su.z<=1&&!0===t.layers.test(i.layers),u=t.element;u.style.display=!0===l?"":"none",!0===l&&(t.onBeforeRender(e,n,i),u.style.transform="translate("+-100*t.center.x+"%,"+-100*t.center.y+"%)translate("+(su.x*r+r)+"px,"+(-su.y*s+s)+"px)",u.parentNode!==o&&o.appendChild(u),t.onAfterRender(e,n,i));const c={distanceToCameraSquared:h(i,t)};a.objects.set(t,c)}for(let e=0,r=t.children.length;e<r;e++)u(t.children[e],n,i)}else l(t)}function h(t,e){return lu.setFromMatrixPosition(t.matrixWorld),uu.setFromMatrixPosition(e.matrixWorld),lu.distanceToSquared(uu)}o.style.overflow="hidden",this.domElement=o,this.getSize=function(){return{width:n,height:i}},this.render=function(t,e){!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),null===e.parent&&!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),au.copy(e.matrixWorldInverse),ou.multiplyMatrices(e.projectionMatrix,au),u(t,t,e),function(t){const e=function(t){const e=[];return t.traverseVisible((function(t){t.isCSS2DObject&&e.push(t)})),e}(t).sort((function(t,e){if(t.renderOrder!==e.renderOrder)return e.renderOrder-t.renderOrder;return a.objects.get(t).distanceToCameraSquared-a.objects.get(e).distanceToCameraSquared})),n=e.length;for(let t=0,i=e.length;t<i;t++)e[t].element.style.zIndex=n-t}(t)},this.setSize=function(t,e){n=t,i=e,r=n/2,s=i/2,o.style.width=t+"px",o.style.height=e+"px"}}}}),LH=PH("globe",ix),BH=Object.assign.apply(Object,r(["globeImageUrl","bumpImageUrl","showGlobe","showGraticules","showAtmosphere","atmosphereColor","atmosphereAltitude","onGlobeReady","pointsData","pointLat","pointLng","pointColor","pointAltitude","pointRadius","pointResolution","pointsMerge","pointsTransitionDuration","arcsData","arcStartLat","arcStartLng","arcEndLat","arcEndLng","arcColor","arcAltitude","arcAltitudeAutoScale","arcStroke","arcCurveResolution","arcCircularResolution","arcDashLength","arcDashGap","arcDashInitialGap","arcDashAnimateTime","arcsTransitionDuration","polygonsData","polygonGeoJsonGeometry","polygonCapColor","polygonCapMaterial","polygonSideColor","polygonSideMaterial","polygonStrokeColor","polygonAltitude","polygonCapCurvatureResolution","polygonsTransitionDuration","pathsData","pathPoints","pathPointLat","pathPointLng","pathPointAlt","pathResolution","pathColor","pathStroke","pathDashLength","pathDashGap","pathDashInitialGap","pathDashAnimateTime","pathTransitionDuration","heatmapsData","heatmapPoints","heatmapPointLat","heatmapPointLng","heatmapPointWeight","heatmapBandwidth","heatmapColorFn","heatmapColorSaturation","heatmapBaseAltitude","heatmapTopAltitude","heatmapsTransitionDuration","hexBinPointsData","hexBinPointLat","hexBinPointLng","hexBinPointWeight","hexBinResolution","hexMargin","hexTopCurvatureResolution","hexTopColor","hexSideColor","hexAltitude","hexBinMerge","hexTransitionDuration","hexPolygonsData","hexPolygonGeoJsonGeometry","hexPolygonColor","hexPolygonAltitude","hexPolygonResolution","hexPolygonMargin","hexPolygonUseDots","hexPolygonCurvatureResolution","hexPolygonDotResolution","hexPolygonsTransitionDuration","tilesData","tileLat","tileLng","tileAltitude","tileWidth","tileHeight","tileUseGlobeProjection","tileMaterial","tileCurvatureResolution","tilesTransitionDuration","ringsData","ringLat","ringLng","ringAltitude","ringColor","ringResolution","ringMaxRadius","ringPropagationSpeed","ringRepeatPeriod","labelsData","labelLat","labelLng","labelAltitude","labelRotation","labelText","labelSize","labelTypeFace","labelColor","labelResolution","labelIncludeDot","labelDotRadius","labelDotOrientation","labelsTransitionDuration","htmlElementsData","htmlLat","htmlLng","htmlAltitude","htmlElement","htmlTransitionDuration","objectsData","objectLat","objectLng","objectAltitude","objectRotation","objectFacesSurface","objectThreeObject","customLayerData","customThreeObject","customThreeObjectUpdate"].map((function(t){return e({},t,LH.linkProp(t))})))),UH=Object.assign.apply(Object,r(["globeMaterial","getGlobeRadius","getCoords","toGeoCoords"].map((function(t){return e({},t,LH.linkMethod(t))})))),OH=PH("renderObjs",NH),FH=Object.assign.apply(Object,r(["width","height","backgroundColor","backgroundImageUrl","enablePointerInteraction"].map((function(t){return e({},t,OH.linkProp(t))})))),kH=Object.assign.apply(Object,r(["lights","postProcessingComposer"].map((function(t){return e({},t,OH.linkMethod(t))})))),zH=Fu({props:i(i({onZoom:{triggerUpdate:!1},onGlobeClick:{triggerUpdate:!1},onGlobeRightClick:{triggerUpdate:!1},pointLabel:{default:"name",triggerUpdate:!1},onPointClick:{triggerUpdate:!1},onPointRightClick:{triggerUpdate:!1},onPointHover:{triggerUpdate:!1},arcLabel:{default:"name",triggerUpdate:!1},onArcClick:{triggerUpdate:!1},onArcRightClick:{triggerUpdate:!1},onArcHover:{triggerUpdate:!1},polygonLabel:{default:"name",triggerUpdate:!1},onPolygonClick:{triggerUpdate:!1},onPolygonRightClick:{triggerUpdate:!1},onPolygonHover:{triggerUpdate:!1},pathLabel:{default:"name",triggerUpdate:!1},onPathClick:{triggerUpdate:!1},onPathRightClick:{triggerUpdate:!1},onPathHover:{triggerUpdate:!1},onHeatmapClick:{triggerUpdate:!1},onHeatmapRightClick:{triggerUpdate:!1},onHeatmapHover:{triggerUpdate:!1},hexLabel:{triggerUpdate:!1},onHexClick:{triggerUpdate:!1},onHexRightClick:{triggerUpdate:!1},onHexHover:{triggerUpdate:!1},hexPolygonLabel:{triggerUpdate:!1},onHexPolygonClick:{triggerUpdate:!1},onHexPolygonRightClick:{triggerUpdate:!1},onHexPolygonHover:{triggerUpdate:!1},tileLabel:{default:"name",triggerUpdate:!1},onTileClick:{triggerUpdate:!1},onTileRightClick:{triggerUpdate:!1},onTileHover:{triggerUpdate:!1},labelLabel:{triggerUpdate:!1},onLabelClick:{triggerUpdate:!1},onLabelRightClick:{triggerUpdate:!1},onLabelHover:{triggerUpdate:!1},objectLabel:{default:"name",triggerUpdate:!1},onObjectClick:{triggerUpdate:!1},onObjectRightClick:{triggerUpdate:!1},onObjectHover:{triggerUpdate:!1},customLayerLabel:{default:"name",triggerUpdate:!1},onCustomLayerClick:{triggerUpdate:!1},onCustomLayerRightClick:{triggerUpdate:!1},onCustomLayerHover:{triggerUpdate:!1},pointerEventsFilter:{default:function(){return!0},triggerUpdate:!1,onChange:function(t,e){return e.renderObjs.hoverFilter((function(e){return t(e,e.__data)}))}},lineHoverPrecision:{default:.2,triggerUpdate:!1,onChange:function(t,e){return e.renderObjs.lineHoverPrecision(t)}}},BH),FH),methods:i(i({pauseAnimation:function(t){var e;return null!==t.animationFrameRequestId&&(cancelAnimationFrame(t.animationFrameRequestId),t.animationFrameRequestId=null),null===(e=t.globe)||void 0===e||e.pauseAnimation(),this},resumeAnimation:function(t){var e;return null===t.animationFrameRequestId&&this._animationCycle(),null===(e=t.globe)||void 0===e||e.resumeAnimation(),this},_animationCycle:function(t){t.renderObjs.tick(),t.tweenGroup.update(),t.animationFrameRequestId=requestAnimationFrame(this._animationCycle)},pointOfView:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=t.globe.toGeoCoords(t.renderObjs.cameraPosition());if(void 0===e.lat&&void 0===e.lng&&void 0===e.altitude)return i;var r=Object.assign({},i,e);if(["lat","lng","altitude"].forEach((function(t){return r[t]=+r[t]})),n){for(;i.lng-r.lng>180;)i.lng-=360;for(;i.lng-r.lng<-180;)i.lng+=360;t.tweenGroup.add(new Wu(i).to(r,n).easing(zu.Cubic.InOut).onUpdate(s).start())}else s(r);return this;function s(e){var n=e.lat,i=e.lng,r=e.altitude;t.renderObjs.cameraPosition(t.globe.getCoords(n,i,r))}},getScreenCoords:function(t){for(var e,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var s=(e=t.globe).getCoords.apply(e,i);return t.renderObjs.getScreenCoords(s.x,s.y,s.z)},toGlobeCoords:function(t,e,n){var i=t.renderObjs.intersectingObjects(e,n).find((function(t){return"globe"===t.object.__globeObjType}));if(!i)return null;var r=t.globe.toGeoCoords(i.point);return{lat:r.lat,lng:r.lng}},scene:function(t){return t.renderObjs.scene()},camera:function(t){return t.renderObjs.camera()},renderer:function(t){return t.renderObjs.renderer()},controls:function(t){return t.renderObjs.controls()},_destructor:function(t){t.globe._destructor(),this.pauseAnimation(),this.pointsData([]),this.arcsData([]),this.polygonsData([]),this.pathsData([]),this.heatmapsData([]),this.hexBinPointsData([]),this.hexPolygonsData([]),this.tilesData([]),this.labelsData([]),this.htmlElementsData([]),this.objectsData([]),this.customLayerData([])}},UH),kH),stateInit:function(t){var e=t.rendererConfig,n=t.waitForGlobeReady,r=void 0===n||n,s=function(t,e){if(null==t)return{};var n,i,r=function(t,e){if(null==t)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.includes(i))continue;n[i]=t[i]}return n}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],e.includes(n)||{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(t,DH),a=new ix(i({waitForGlobeReady:r},s));return{globe:a,renderObjs:NH({controlType:"orbit",rendererConfig:e,waitForLoadComplete:r,extraRenderers:[new IH.CSS2DRenderer]}).skyRadius(500*a.getGlobeRadius()).showNavInfo(!1).objects([a]).lights([new IH.AmbientLight(13421772,Math.PI),new IH.DirectionalLight(16777215,.6*Math.PI)]),tweenGroup:new Gu}},init:function(t,e){var n=this;t.innerHTML="",t.appendChild(e.container=document.createElement("div")),e.container.style.position="relative";var i=document.createElement("div");e.container.appendChild(i),e.renderObjs(i),e.globe.rendererSize(e.renderObjs.renderer().getSize(new IH.Vector2)),this.pointOfView({altitude:2.5});var r=e.globe.getGlobeRadius(),s=e.renderObjs.controls();s.minDistance=1.01*r,s.maxDistance=100*r,s.enablePan=!1,s.enableDamping=!0,s.dampingFactor=.1,s.rotateSpeed=.3,s.zoomSpeed=.3,s.addEventListener("change",(function(){var t=n.pointOfView();s.rotateSpeed=.2*t.altitude,s.zoomSpeed=.1*(t.altitude+1),e.globe.setPointOfView(e.renderObjs.camera().position),e.onZoom&&e.onZoom(t)}));var a=function(t){for(var e=t;e&&!e.hasOwnProperty("__globeObjType");)e=e.parent;return e},o={point:function(t){return t},arc:function(t){return t},polygon:function(t){return t.data},path:function(t){return t},heatmap:function(t){return t},hexbin:function(t){return t},hexPolygon:function(t){return t},tile:function(t){return t},label:function(t){return t},object:function(t){return t},custom:function(t){return t}};IH.REVISION<155&&(e.renderObjs.renderer().useLegacyLights=!1),e.renderObjs.hoverOrderComparator((function(t,e){var n=a(t),i=a(e),r=function(t){return!t};return r(n)-r(i)})).tooltipContent((function(t){var n={point:e.pointLabel,arc:e.arcLabel,polygon:e.polygonLabel,path:e.pathLabel,hexbin:e.hexLabel,hexPolygon:e.hexPolygonLabel,tile:e.tileLabel,label:e.labelLabel,object:e.objectLabel,custom:e.customLayerLabel},i=a(t),r=i&&i.__globeObjType;return i&&r&&n.hasOwnProperty(r)&&o.hasOwnProperty(r)&&Xd(n[r])(o[r](i.__data))||""})).onHover((function(t){var n={point:e.onPointHover,arc:e.onArcHover,polygon:e.onPolygonHover,path:e.onPathHover,heatmap:e.onHeatmapHover,hexbin:e.onHexHover,hexPolygon:e.onHexPolygonHover,tile:e.onTileHover,label:e.onLabelHover,object:e.onObjectHover,custom:e.onCustomLayerHover},i={globe:e.onGlobeClick,point:e.onPointClick,arc:e.onArcClick,polygon:e.onPolygonClick,path:e.onPathClick,heatmap:e.onHeatmapClick,hexbin:e.onHexClick,hexPolygon:e.onHexPolygonClick,tile:e.onTileClick,label:e.onLabelClick,object:e.onObjectClick,custom:e.onCustomLayerClick},r=a(t);if(r&&!n.hasOwnProperty(r.__globeObjType)&&(r=null),r!==e.hoverObj){var s=e.hoverObj?e.hoverObj.__globeObjType:null,l=e.hoverObj?o[s](e.hoverObj.__data):null,u=r?r.__globeObjType:null,h=r?o[u](r.__data):null;s&&s!==u&&n[s]&&n[s](null,l),u&&n[u]&&n[u](h,s===u?l:null),e.renderObjs.renderer().domElement.classList[u&&i[u]?"add":"remove"]("clickable"),e.hoverObj=r}})).onClick((function(t,i,r){if(t){var s={globe:e.onGlobeClick,point:e.onPointClick,arc:e.onArcClick,polygon:e.onPolygonClick,path:e.onPathClick,heatmap:e.onHeatmapClick,hexbin:e.onHexClick,hexPolygon:e.onHexPolygonClick,tile:e.onTileClick,label:e.onLabelClick,object:e.onObjectClick,custom:e.onCustomLayerClick},l=a(t),u=l.__globeObjType;if(l&&s.hasOwnProperty(u)&&s[u]){var h=[i];if("globe"===u){var c=n.toGeoCoords(r),A=c.lat,d=c.lng;h.unshift({lat:A,lng:d})}else h.push(n.toGeoCoords(r));o.hasOwnProperty(u)&&h.unshift(o[u](l.__data)),s[u].apply(s,h)}}})).onRightClick((function(t,i,r){if(t){var s={globe:e.onGlobeRightClick,point:e.onPointRightClick,arc:e.onArcRightClick,polygon:e.onPolygonRightClick,path:e.onPathRightClick,heatmap:e.onHeatmapRightClick,hexbin:e.onHexRightClick,hexPolygon:e.onHexPolygonRightClick,tile:e.onTileRightClick,label:e.onLabelRightClick,object:e.onObjectRightClick,custom:e.onCustomLayerRightClick},l=a(t),u=l.__globeObjType;if(l&&s.hasOwnProperty(u)&&s[u]){var h=[i];if("globe"===u){var c=n.toGeoCoords(r),A=c.lat,d=c.lng;h.unshift({lat:A,lng:d})}else h.push(n.toGeoCoords(r));o.hasOwnProperty(u)&&h.unshift(o[u](l.__data)),s[u].apply(s,h)}}})),this._animationCycle()}});return zH})); 20 */var Rv={};[["sizeOfH3Index",bv],["sizeOfLatLng",bv],["sizeOfCellBoundary",bv],["sizeOfGeoLoop",bv],["sizeOfGeoPolygon",bv],["sizeOfLinkedGeoPolygon",bv],["sizeOfCoordIJ",bv],["readInt64AsDoubleFromPointer",bv],["isValidCell",bv,[bv,bv]],["latLngToCell",bv,[bv,bv,bv,bv]],["cellToLatLng",bv,[bv,bv,bv]],["cellToBoundary",bv,[bv,bv,bv]],["maxGridDiskSize",bv,[bv,bv]],["gridDisk",bv,[bv,bv,bv,bv]],["gridDiskDistances",bv,[bv,bv,bv,bv,bv]],["gridRingUnsafe",bv,[bv,bv,bv,bv]],["maxPolygonToCellsSize",bv,[bv,bv,bv,bv]],["polygonToCells",bv,[bv,bv,bv,bv]],["cellsToLinkedMultiPolygon",bv,[bv,bv,bv]],["destroyLinkedMultiPolygon",null,[bv]],["compactCells",bv,[bv,bv,bv,bv]],["uncompactCells",bv,[bv,bv,bv,bv,bv,bv]],["uncompactCellsSize",bv,[bv,bv,bv,bv,bv]],["isPentagon",bv,[bv,bv]],["isResClassIII",bv,[bv,bv]],["getBaseCellNumber",bv,[bv,bv]],["getResolution",bv,[bv,bv]],["maxFaceCount",bv,[bv,bv,bv]],["getIcosahedronFaces",bv,[bv,bv,bv]],["cellToParent",bv,[bv,bv,bv,bv]],["cellToChildren",bv,[bv,bv,bv,bv]],["cellToCenterChild",bv,[bv,bv,bv,bv]],["cellToChildrenSize",bv,[bv,bv,bv,bv]],["cellToChildPos",bv,[bv,bv,bv,bv]],["childPosToCell",bv,[bv,bv,bv,bv,bv,bv]],["areNeighborCells",bv,[bv,bv,bv,bv,bv]],["cellsToDirectedEdge",bv,[bv,bv,bv,bv,bv]],["getDirectedEdgeOrigin",bv,[bv,bv,bv]],["getDirectedEdgeDestination",bv,[bv,bv,bv]],["isValidDirectedEdge",bv,[bv,bv]],["directedEdgeToCells",bv,[bv,bv,bv]],["originToDirectedEdges",bv,[bv,bv,bv]],["directedEdgeToBoundary",bv,[bv,bv,bv]],["gridDistance",bv,[bv,bv,bv,bv,bv]],["gridPathCells",bv,[bv,bv,bv,bv,bv]],["gridPathCellsSize",bv,[bv,bv,bv,bv,bv]],["cellToLocalIj",bv,[bv,bv,bv,bv,bv,bv]],["localIjToCell",bv,[bv,bv,bv,bv,bv]],["getHexagonAreaAvgM2",bv,[bv,bv]],["getHexagonAreaAvgKm2",bv,[bv,bv]],["getHexagonEdgeLengthAvgM",bv,[bv,bv]],["getHexagonEdgeLengthAvgKm",bv,[bv,bv]],["greatCircleDistanceM",bv,[bv,bv]],["greatCircleDistanceKm",bv,[bv,bv]],["greatCircleDistanceRads",bv,[bv,bv]],["cellAreaM2",bv,[bv,bv,bv]],["cellAreaKm2",bv,[bv,bv,bv]],["cellAreaRads2",bv,[bv,bv,bv]],["edgeLengthM",bv,[bv,bv,bv]],["edgeLengthKm",bv,[bv,bv,bv]],["edgeLengthRads",bv,[bv,bv,bv]],["getNumCells",bv,[bv,bv]],["getRes0Cells",bv,[bv]],["res0CellCount",bv],["getPentagons",bv,[bv,bv]],["pentagonCount",bv],["cellToVertex",bv,[bv,bv,bv,bv]],["cellToVertexes",bv,[bv,bv,bv]],["vertexToLatLng",bv,[bv,bv,bv]],["isValidVertex",bv,[bv,bv]]].forEach((function(e){Rv[e[0]]=xv.cwrap.apply(xv,e)}));var Nv=16,Pv=Rv.sizeOfH3Index(),Dv=Rv.sizeOfLatLng(),Lv=Rv.sizeOfCellBoundary(),Iv=Rv.sizeOfGeoPolygon(),Uv=Rv.sizeOfGeoLoop();Rv.sizeOfLinkedGeoPolygon(),Rv.sizeOfCoordIJ();var Bv=Math.pow(2,32)-1;var Ov,Fv,kv,qv,Gv,zv,Vv,Hv,jv=/[^0-9a-fA-F]/;function Wv(e){if(Array.isArray(e)&&2===e.length&&Number.isInteger(e[0])&&Number.isInteger(e[1]))return e;if("string"!=typeof e||jv.test(e))return[0,0];var t=parseInt(e.substring(0,e.length-8),Nv);return[parseInt(e.substring(e.length-8),Nv),t]}function Xv(e){if(e>=0)return e.toString(Nv);var t=Qv(8,(e&=2147483647).toString(Nv));return t=(parseInt(t[0],Nv)+8).toString(Nv)+t.substring(1)}function Qv(e,t){for(var n=e-t.length,r="",i=0;i<n;i++)r+="0";return r+=t}function Yv(e,t,n){for(var r=e.length,i=xv._calloc(r,Dv),s=n?1:0,a=n?0:1,o=0;o<2*r;o+=2)xv.HEAPF64.set([e[o/2][s],e[o/2][a]].map(r_),i/8+o);return xv.HEAPU32.set([r,i],t/4),t}function $v(e,t){void 0===t&&(t=0);var n=xv.getValue(e+Pv*t,"i32"),r=xv.getValue(e+Pv*t+4,"i32");return r?function(e,t){return Xv(t)+Qv(8,Xv(e))}(n,r):null}function Kv(e){return 180*xv.getValue(e,"double")/Math.PI}function Zv(e){return[Kv(e+8),Kv(e)]}function Jv(e,t,n){var r=xv._malloc(Dv);xv.HEAPF64.set([e,t].map(r_),r/8);var i=xv._malloc(Pv);try{return Cv(Rv.latLngToCell(r,n,i)),function(e){if(!e)throw Ev(1002);return e}($v(i))}finally{xv._free(i),xv._free(r)}}function e_(e){var t,n=xv._malloc(Dv),r=Wv(e),i=r[0],s=r[1];try{return Cv(Rv.cellToLatLng(i,s,n)),[Kv(t=n),Kv(t+8)]}finally{xv._free(n)}}function t_(e,t){var n=xv._malloc(Lv),r=Wv(e),i=r[0],s=r[1];try{return Cv(Rv.cellToBoundary(i,s,n)),function(e){for(var t=xv.getValue(e,"i32"),n=e+8,r=[],i=Zv,s=0;s<2*t;s+=2)r.push(i(n+8*s));return r.push(r[0]),r}(n)}finally{xv._free(n)}}function n_(e,t,n){if(function(e){if("number"!=typeof e||e<0||e>15||Math.floor(e)!==e)throw Mv(4,e)}(t),n=Boolean(n),0===e.length||0===e[0].length)return[];var r,i=function(e,t){var n,r=e.length-1,i=xv._calloc(Iv),s=0+Uv,a=s+4;if(Yv(e[0],i+0,t),r>0){n=xv._calloc(r,Uv);for(var o=0;o<r;o++)Yv(e[o+1],n+Uv*o,t)}return xv.setValue(i+s,r,"i32"),xv.setValue(i+a,n,"i32"),i}("number"==typeof e[0][0]?[e]:e,n),s=xv._malloc(8);try{Cv(Rv.maxPolygonToCellsSize(i,t,0,s));var a=function(e){if(e>Bv)throw Ev(1001,e);return e}((r=s,Rv.readInt64AsDoubleFromPointer(r))),o=xv._calloc(a,Pv);try{return Cv(Rv.polygonToCells(i,t,0,o)),function(e,t){for(var n=[],r=0;r<t;r++){var i=$v(e,r);null!==i&&n.push(i)}return n}(o,a)}finally{xv._free(o)}}finally{xv._free(s),function(e){var t=0+Uv,n=t+4;xv._free(xv.getValue(e+0+4,"i8*"));var r=xv.getValue(e+t,"i32");if(r>0){for(var i=xv.getValue(e+n,"i32"),s=0;s<r;s++)xv._free(xv.getValue(i+Uv*s+4,"i8*"));xv._free(i)}xv._free(e)}(i)}}function r_(e){return e*Math.PI/180}function i_(){if(Fv)return Ov;function e(e,t,n,r){this.x="number"==typeof e?e:0,this.y="number"==typeof t?t:0,this.z="number"==typeof n?n:0,this.half="number"==typeof r?r:0}return Fv=1,Ov=e,e.prototype.contains=function(e,t,n){var r=this.half;return this.x-r<=e&&e<this.x+r&&this.y-r<=t&&t<this.y+r&&this.z-r<=n&&n<this.z+r},Ov}var s_=function(){if(Hv)return Vv;Hv=1;var e=i_(),t=function(){if(qv)return kv;qv=1;var e=i_();function t(e){this.bounds=e,this.q0=null,this.q1=null,this.q2=null,this.q3=null,this.q4=null,this.q5=null,this.q6=null,this.q7=null,this.items=null}return kv=t,t.prototype.subdivide=function(){var n=this.bounds,r=n.half/2;this.q0=new t(new e(n.x-r,n.y-r,n.z-r,r)),this.q1=new t(new e(n.x+r,n.y-r,n.z-r,r)),this.q2=new t(new e(n.x-r,n.y+r,n.z-r,r)),this.q3=new t(new e(n.x+r,n.y+r,n.z-r,r)),this.q4=new t(new e(n.x-r,n.y-r,n.z+r,r)),this.q5=new t(new e(n.x+r,n.y-r,n.z+r,r)),this.q6=new t(new e(n.x-r,n.y+r,n.z+r,r)),this.q7=new t(new e(n.x+r,n.y+r,n.z+r,r))},t.prototype.insert=function(e,t,n){if(null===this.q0){if(null===this.items?this.items=[e]:this.items.push(e),this.items.length>=4&&n<16){this.subdivide();for(var r=0;r<this.items.length;++r)this.insert(this.items[r],t,n+1);this.items=null}}else{var i=t[e],s=t[e+1],a=t[e+2],o=this.bounds,l=0;i>o.x&&(l+=1),s>o.y&&(l+=2),a>o.z&&(l+=4);var u=function(e,t){return 0===t?e.q0:1===t?e.q1:2===t?e.q2:3===t?e.q3:4===t?e.q4:5===t?e.q5:6===t?e.q6:7===t?e.q7:void 0}(this,l);u.insert(e,t,n+1)}},t.prototype.query=function(e,t,n,r){if(n(this.bounds)){var i=this.items,s="function"==typeof r;if(i)for(var a=0;a<i.length;++a){var o=i[a];s?r(t[o],t[o+1],t[o+2])&&e.push(o):e.push(o)}this.q0&&(this.q0.query(e,t,n,r),this.q1.query(e,t,n,r),this.q2.query(e,t,n,r),this.q3.query(e,t,n,r),this.q4.query(e,t,n,r),this.q5.query(e,t,n,r),this.q6.query(e,t,n,r),this.q7.query(e,t,n,r))}},kv}(),n=new e,r=(zv||(zv=1,Gv=function(e,t,n,r){var i=0,s=0,a=(r=r||{}).step||1,o=r.maxTimeMS||8,l=r.probeElements||5e3;setTimeout((function r(){var u=Math.min(e.length,i+l),c=i,A=new Date;for(c=i;c<u;c+=a)t(e[c],c,e);c<e.length?(s+=new Date-A,i=c,l=Math.round(i*o/s),setTimeout(r,0)):n(e)}),0)}),Gv);return Vv=function(i){var s,a,o=[],l={initAsync:function(e,t){c(e);var n=A(e);function i(t,r){n.insert(r,e,0)}function o(){a=e,s=n,"function"==typeof t&&t(l)}r(e,i,o,{step:3})},init:function(e){c(e),a=e,s=A(e);for(var t=0;t<e.length;t+=3)s.insert(t,a,0)},bounds:function(){return s?s.bounds:n},intersectRay:function(e,t,n,r){if(!s)return o;void 0===n&&(n=0);void 0===r&&(r=Number.POSITIVE_INFINITY);n*=n,r*=r;var i=[];return s.query(i,a,l,u),i.sort(c);function l(n){var i,s=n.half,a=(n.x-s-e.x)/t.x,o=(n.x+s-e.x)/t.x,l=(n.y+s-e.y)/t.y,u=(n.y-s-e.y)/t.y,c=(n.z-s-e.z)/t.z,A=(n.z+s-e.z)/t.z,h=Math.min(Math.min(Math.max(a,o),Math.max(l,u)),Math.max(c,A));return!(h<0)&&((i=Math.max(Math.max(Math.min(a,o),Math.min(l,u)),Math.min(c,A)))<=h&&i<=r)}function u(t,i,s){var a=(t-e.x)*(t-e.x)+(i-e.y)*(i-e.y)+(s-e.z)*(s-e.z);return n<=a&&a<=r}function c(t,n){var r=e[t],i=e[t+1],s=e[t+2],a=(r-e.x)*(r-e.x)+(i-e.y)*(i-e.y)+(s-e.z)*(s-e.z),o=e[n],l=e[n+1],u=e[n+2];return a-((o-e.x)*(o-e.x)+(l-e.y)*(l-e.y)+(u-e.z)*(u-e.z))}},intersectSphere:function(e,t,n,r){if(!s)return o;var i=[],l=r*r;return s.query(i,a,c,A),i;function c(r){var i=l,s=r.half;return e<r.x-s?i-=u(e-(r.x-s)):e>r.x+s&&(i-=u(e-(r.x+s))),t<r.y-s?i-=u(t-(r.y-s)):t>r.y+s&&(i-=u(t-(r.y+s))),n<r.z-s?i-=u(n-(r.z-s)):n>r.z+s&&(i-=u(n-(r.z+s))),i>0}function A(r,i,s){return u(r-e)+u(i-t)+u(s-n)<l}},getRoot:function(){return s}};return l;function u(e){return e*e}function c(e){if(!e)throw new Error("Points array is required for quadtree to work");if("number"!=typeof e.length)throw new Error("Points should be array-like object");if(e.length%3!=0)throw new Error("Points array should consist of series of x,y,z coordinates and be multiple of 3")}function A(n){if(0===n.length){var r=new e;return new t(r)}for(var i=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY,c=0;c<n.length;c+=3){var A=n[c],h=n[c+1],d=n[c+2];A<i&&(i=A),A>o&&(o=A),h<s&&(s=h),h>l&&(l=h),d<a&&(a=d),d>u&&(u=d)}var p=Math.max(Math.max(o-i,l-s),u-a),f=(p+=2)/2,m=new e((i-=1)+f,(s-=1)+f,(a-=1)+f,f);return new t(m)}},Vv}(),a_=Am(s_);const o_=new cn,l_=new on;class u_ extends Ha{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new Hr([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new Hr([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(e){const t=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==t&&(t.applyMatrix4(e),n.applyMatrix4(e),t.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const n=new Qa(t,6,1);return this.setAttribute("instanceStart",new Ni(n,3,0)),this.setAttribute("instanceEnd",new Ni(n,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const n=new Qa(t,6,1);return this.setAttribute("instanceColorStart",new Ni(n,3,0)),this.setAttribute("instanceColorEnd",new Ni(n,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new sa(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new cn);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;void 0!==e&&void 0!==t&&(this.boundingBox.setFromBufferAttribute(e),o_.setFromBufferAttribute(t),this.boundingBox.union(o_))}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Cn),null===this.boundingBox&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(void 0!==e&&void 0!==t){const n=this.boundingSphere.center;this.boundingBox.getCenter(n);let r=0;for(let i=0,s=e.count;i<s;i++)l_.fromBufferAttribute(e,i),r=Math.max(r,n.distanceToSquared(l_)),l_.fromBufferAttribute(t,i),r=Math.max(r,n.distanceToSquared(l_));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(e){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}}oo.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Lt(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}},lo.line={uniforms:mi.merge([oo.common,oo.fog,oo.line]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\t#ifdef WORLD_UNITS\n\n\t\t\tvarying vec4 worldPos;\n\t\t\tvarying vec3 worldStart;\n\t\t\tvarying vec3 worldEnd;\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t#endif\n\n\t\t#else\n\n\t\t\tvarying vec2 vUv;\n\n\t\t#endif\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\t\t\t\tvUv = uv;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\tworldStart = start.xyz;\n\t\t\t\tworldEnd = end.xyz;\n\n\t\t\t#else\n\n\t\t\t\tvUv = uv;\n\n\t\t\t#endif\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec3 ndcStart = clipStart.xyz / clipStart.w;\n\t\t\tvec3 ndcEnd = clipEnd.xyz / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd.xy - ndcStart.xy;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\tvec3 worldDir = normalize( end.xyz - start.xyz );\n\t\t\t\tvec3 tmpFwd = normalize( mix( start.xyz, end.xyz, 0.5 ) );\n\t\t\t\tvec3 worldUp = normalize( cross( worldDir, tmpFwd ) );\n\t\t\t\tvec3 worldFwd = cross( worldDir, worldUp );\n\t\t\t\tworldPos = position.y < 0.5 ? start: end;\n\n\t\t\t\t// height offset\n\t\t\t\tfloat hw = linewidth * 0.5;\n\t\t\t\tworldPos.xyz += position.x < 0.0 ? hw * worldUp : - hw * worldUp;\n\n\t\t\t\t// don't extend the line if we're rendering dashes because we\n\t\t\t\t// won't be rendering the endcaps\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t// cap extension\n\t\t\t\t\tworldPos.xyz += position.y < 0.5 ? - hw * worldDir : hw * worldDir;\n\n\t\t\t\t\t// add width to the box\n\t\t\t\t\tworldPos.xyz += worldFwd * hw;\n\n\t\t\t\t\t// endcaps\n\t\t\t\t\tif ( position.y > 1.0 || position.y < 0.0 ) {\n\n\t\t\t\t\t\tworldPos.xyz -= worldFwd * 2.0 * hw;\n\n\t\t\t\t\t}\n\n\t\t\t\t#endif\n\n\t\t\t\t// project the worldpos\n\t\t\t\tvec4 clip = projectionMatrix * worldPos;\n\n\t\t\t\t// shift the depth of the projected points so the line\n\t\t\t\t// segments overlap neatly\n\t\t\t\tvec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;\n\t\t\t\tclip.z = clipPose.z * clip.w;\n\n\t\t\t#else\n\n\t\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\t\t\t\t// undo aspect ratio adjustment\n\t\t\t\tdir.x /= aspect;\n\t\t\t\toffset.x /= aspect;\n\n\t\t\t\t// sign flip\n\t\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t\t// endcaps\n\t\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\t\toffset += - dir;\n\n\t\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\t\toffset += dir;\n\n\t\t\t\t}\n\n\t\t\t\t// adjust for linewidth\n\t\t\t\toffset *= linewidth;\n\n\t\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\t\toffset /= resolution.y;\n\n\t\t\t\t// select end\n\t\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t\t// back to clip space\n\t\t\t\toffset *= clip.w;\n\n\t\t\t\tclip.xy += offset;\n\n\t\t\t#endif\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\t\tuniform float linewidth;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashOffset;\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#ifdef WORLD_UNITS\n\n\t\t\tvarying vec4 worldPos;\n\t\t\tvarying vec3 worldStart;\n\t\t\tvarying vec3 worldEnd;\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t#endif\n\n\t\t#else\n\n\t\t\tvarying vec2 vUv;\n\n\t\t#endif\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {\n\n\t\t\tfloat mua;\n\t\t\tfloat mub;\n\n\t\t\tvec3 p13 = p1 - p3;\n\t\t\tvec3 p43 = p4 - p3;\n\n\t\t\tvec3 p21 = p2 - p1;\n\n\t\t\tfloat d1343 = dot( p13, p43 );\n\t\t\tfloat d4321 = dot( p43, p21 );\n\t\t\tfloat d1321 = dot( p13, p21 );\n\t\t\tfloat d4343 = dot( p43, p43 );\n\t\t\tfloat d2121 = dot( p21, p21 );\n\n\t\t\tfloat denom = d2121 * d4343 - d4321 * d4321;\n\n\t\t\tfloat numer = d1343 * d4321 - d1321 * d4343;\n\n\t\t\tmua = numer / denom;\n\t\t\tmua = clamp( mua, 0.0, 1.0 );\n\t\t\tmub = ( d1343 + d4321 * ( mua ) ) / d4343;\n\t\t\tmub = clamp( mub, 0.0, 1.0 );\n\n\t\t\treturn vec2( mua, mub );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tfloat alpha = opacity;\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t// Find the closest points on the view ray and the line segment\n\t\t\t\tvec3 rayEnd = normalize( worldPos.xyz ) * 1e5;\n\t\t\t\tvec3 lineDir = worldEnd - worldStart;\n\t\t\t\tvec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );\n\n\t\t\t\tvec3 p1 = worldStart + lineDir * params.x;\n\t\t\t\tvec3 p2 = rayEnd * params.y;\n\t\t\t\tvec3 delta = p1 - p2;\n\t\t\t\tfloat len = length( delta );\n\t\t\t\tfloat norm = len / linewidth;\n\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t#ifdef USE_ALPHA_TO_COVERAGE\n\n\t\t\t\t\t\tfloat dnorm = fwidth( norm );\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tif ( norm > 0.5 ) {\n\n\t\t\t\t\t\t\tdiscard;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t#endif\n\n\t\t\t\t#endif\n\n\t\t\t#else\n\n\t\t\t\t#ifdef USE_ALPHA_TO_COVERAGE\n\n\t\t\t\t\t// artifacts appear on some hardware if a derivative is taken within a conditional\n\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\tfloat len2 = a * a + b * b;\n\t\t\t\t\tfloat dlen = fwidth( len2 );\n\n\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t#else\n\n\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t\t\t}\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, alpha );\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, alpha );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <colorspace_fragment>\n\t\t\t#include <fog_fragment>\n\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t}\n\t\t"};class c_ extends gi{constructor(e){super({type:"LineMaterial",uniforms:mi.clone(lo.line.uniforms),vertexShader:lo.line.vertexShader,fragmentShader:lo.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){!0===e?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){!0===e!==this.dashed&&(this.needsUpdate=!0),!0===e?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(!0===e!==this.alphaToCoverage&&(this.needsUpdate=!0),!0===e?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const A_=new en,h_=new on,d_=new on,p_=new en,f_=new en,m_=new en,g_=new on,v_=new On,__=new class{constructor(e=new on,t=new on){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){Ja.subVectors(e,this.start),eo.subVectors(this.end,this.start);const n=eo.dot(eo);let r=eo.dot(Ja)/n;return t&&(r=Et(r,0,1)),r}closestPointToPoint(e,t,n){const r=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}},y_=new on,x_=new cn,b_=new Cn,S_=new en;let T_,w_;function M_(e,t,n){return S_.set(0,0,-t,1).applyMatrix4(e.projectionMatrix),S_.multiplyScalar(1/S_.w),S_.x=w_/n.width,S_.y=w_/n.height,S_.applyMatrix4(e.projectionMatrixInverse),S_.multiplyScalar(1/S_.w),Math.abs(Math.max(S_.x,S_.y))}class E_ extends ci{constructor(e=new u_,t=new c_({color:16777215*Math.random()})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,r=new Float32Array(2*t.count);for(let e=0,i=0,s=t.count;e<s;e++,i+=2)h_.fromBufferAttribute(t,e),d_.fromBufferAttribute(n,e),r[i]=0===i?0:r[i-1],r[i+1]=r[i]+h_.distanceTo(d_);const i=new Qa(r,2,1);return e.setAttribute("instanceDistanceStart",new Ni(i,1,0)),e.setAttribute("instanceDistanceEnd",new Ni(i,1,1)),this}raycast(e,t){const n=this.material.worldUnits,r=e.camera;null!==r||n||console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const i=void 0!==e.params.Line2&&e.params.Line2.threshold||0;T_=e.ray;const s=this.matrixWorld,a=this.geometry,o=this.material;let l,u;if(w_=o.linewidth+i,null===a.boundingSphere&&a.computeBoundingSphere(),b_.copy(a.boundingSphere).applyMatrix4(s),n)l=.5*w_;else{l=M_(r,Math.max(r.near,b_.distanceToPoint(T_.origin)),o.resolution)}if(b_.radius+=l,!1!==T_.intersectsSphere(b_)){if(null===a.boundingBox&&a.computeBoundingBox(),x_.copy(a.boundingBox).applyMatrix4(s),n)u=.5*w_;else{u=M_(r,Math.max(r.near,x_.distanceToPoint(T_.origin)),o.resolution)}x_.expandByScalar(u),!1!==T_.intersectsBox(x_)&&(n?function(e,t){const n=e.matrixWorld,r=e.geometry,i=r.attributes.instanceStart,s=r.attributes.instanceEnd;for(let a=0,o=Math.min(r.instanceCount,i.count);a<o;a++){__.start.fromBufferAttribute(i,a),__.end.fromBufferAttribute(s,a),__.applyMatrix4(n);const r=new on,o=new on;T_.distanceSqToSegment(__.start,__.end,o,r),o.distanceTo(r)<.5*w_&&t.push({point:o,pointOnLine:r,distance:T_.origin.distanceTo(o),object:e,face:null,faceIndex:a,uv:null,uv1:null})}}(this,t):function(e,t,n){const r=t.projectionMatrix,i=e.material.resolution,s=e.matrixWorld,a=e.geometry,o=a.attributes.instanceStart,l=a.attributes.instanceEnd,u=Math.min(a.instanceCount,o.count),c=-t.near;T_.at(1,m_),m_.w=1,m_.applyMatrix4(t.matrixWorldInverse),m_.applyMatrix4(r),m_.multiplyScalar(1/m_.w),m_.x*=i.x/2,m_.y*=i.y/2,m_.z=0,g_.copy(m_),v_.multiplyMatrices(t.matrixWorldInverse,s);for(let t=0,a=u;t<a;t++){if(p_.fromBufferAttribute(o,t),f_.fromBufferAttribute(l,t),p_.w=1,f_.w=1,p_.applyMatrix4(v_),f_.applyMatrix4(v_),p_.z>c&&f_.z>c)continue;if(p_.z>c){const e=p_.z-f_.z,t=(p_.z-c)/e;p_.lerp(f_,t)}else if(f_.z>c){const e=f_.z-p_.z,t=(f_.z-c)/e;f_.lerp(p_,t)}p_.applyMatrix4(r),f_.applyMatrix4(r),p_.multiplyScalar(1/p_.w),f_.multiplyScalar(1/f_.w),p_.x*=i.x/2,p_.y*=i.y/2,f_.x*=i.x/2,f_.y*=i.y/2,__.start.copy(p_),__.start.z=0,__.end.copy(f_),__.end.z=0;const a=__.closestPointToPointParameter(g_,!0);__.at(a,y_);const u=Dt.lerp(p_.z,f_.z,a),A=u>=-1&&u<=1,h=g_.distanceTo(y_)<.5*w_;if(A&&h){__.start.fromBufferAttribute(o,t),__.end.fromBufferAttribute(l,t),__.start.applyMatrix4(s),__.end.applyMatrix4(s);const r=new on,i=new on;T_.distanceSqToSegment(__.start,__.end,i,r),n.push({point:i,pointOnLine:r,distance:T_.origin.distanceTo(i),object:e,face:null,faceIndex:t,uv:null,uv1:null})}}}(this,r,t))}}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(A_),this.material.uniforms.resolution.value.set(A_.z,A_.w))}}class C_ extends u_{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,n=new Float32Array(2*t);for(let r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return super.setPositions(n),this}setColors(e){const t=e.length-3,n=new Float32Array(2*t);for(let r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return super.setColors(n),this}setFromPoints(e){const t=e.length-1,n=new Float32Array(6*t);for(let r=0;r<t;r++)n[6*r]=e[r].x,n[6*r+1]=e[r].y,n[6*r+2]=e[r].z||0,n[6*r+3]=e[r+1].x,n[6*r+4]=e[r+1].y,n[6*r+5]=e[r+1].z||0;return super.setPositions(n),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class R_ extends E_{constructor(e=new C_,t=new c_({color:16777215*Math.random()})){super(e,t),this.isLine2=!0,this.type="Line2"}}class N_ extends ea{constructor(e,t={}){const n=t.font;if(void 0===n)super();else{const r=n.generateShapes(e,t.size);void 0===t.depth&&void 0!==t.height&&console.warn("THREE.TextGeometry: .height is now depreciated. Please use .depth instead"),t.depth=void 0!==t.depth?t.depth:void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),super(r,t)}this.type="TextGeometry"}}function P_(e,t,n,r,i){const s=i.glyphs[e]||i.glyphs["?"];if(!s)return void console.error('THREE.Font: character "'+e+'" does not exists in font family '+i.familyName+".");const a=new to;let o,l,u,c,A,h,d,p;if(s.o){const e=s._cachedOutline||(s._cachedOutline=s.o.split(" "));for(let i=0,s=e.length;i<s;){switch(e[i++]){case"m":o=e[i++]*t+n,l=e[i++]*t+r,a.moveTo(o,l);break;case"l":o=e[i++]*t+n,l=e[i++]*t+r,a.lineTo(o,l);break;case"q":u=e[i++]*t+n,c=e[i++]*t+r,A=e[i++]*t+n,h=e[i++]*t+r,a.quadraticCurveTo(A,h,u,c);break;case"b":u=e[i++]*t+n,c=e[i++]*t+r,A=e[i++]*t+n,h=e[i++]*t+r,d=e[i++]*t+n,p=e[i++]*t+r,a.bezierCurveTo(A,h,d,p,u,c)}}}return{offsetX:s.ha*t,path:a}}function D_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function L_(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function I_(e,t,n){return t=H_(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,W_()?Reflect.construct(t,n||[],H_(e).constructor):t.apply(e,n))}function U_(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function B_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O_(e,t){return e.get(L_(e,t))}function F_(e,t,n){U_(e,t),t.set(e,n)}function k_(e,t,n){return e.set(L_(e,t),n),n}function q_(e,t,n){if(W_())return Reflect.construct.apply(null,arguments);var r=[null];return r.push.apply(r,t),new(e.bind.apply(e,r))}function G_(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,J_(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function z_(e,t,n){return(t=J_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V_(){return V_="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=H_(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},V_.apply(null,arguments)}function H_(e){return H_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},H_(e)}function j_(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Y_(e,t)}function W_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(W_=function(){return!!e})()}function X_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Q_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?X_(Object(n),!0).forEach((function(t){z_(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Y_(e,t){return Y_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Y_(e,t)}function $_(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}(e,t)||ey(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function K_(e,t,n,r){var i=V_(H_(e.prototype),t,n);return"function"==typeof i?function(e){return i.apply(n,e)}:i}function Z_(e){return function(e){if(Array.isArray(e))return D_(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ey(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function J_(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function ey(e,t){if(e){if("string"==typeof e)return D_(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D_(e,t):void 0}}var ty=function(e){e instanceof Array?e.forEach(ty):(e.map&&e.map.dispose(),e.dispose())},ny=function(e){e.geometry&&e.geometry.dispose(),e.material&&ty(e.material),e.texture&&e.texture.dispose(),e.children&&e.children.forEach(ny)},ry=function(e){if(e&&e.children)for(;e.children.length;){var t=e.children[0];e.remove(t),ny(t)}};function iy(e,t){var n=new t;return{linkProp:function(t){return{default:n[t](),onChange:function(n,r){r[e][t](n)},triggerUpdate:!1}},linkMethod:function(t){return function(n){for(var r=n[e],i=arguments.length,s=new Array(i>1?i-1:0),a=1;a<i;a++)s[a-1]=arguments[a];var o=r[t].apply(r,s);return o===r?this:o}}}}var sy=100;function ay(){return sy}function oy(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(90-e)*Math.PI/180,i=(90-t)*Math.PI/180,s=sy*(1+n);return{x:s*Math.sin(r)*Math.cos(i),y:s*Math.cos(r),z:s*Math.sin(r)*Math.sin(i)}}function ly(e){var t=e.x,n=e.y,r=e.z,i=Math.sqrt(t*t+n*n+r*r),s=Math.acos(n/i),a=Math.atan2(r,t);return{lat:90-180*s/Math.PI,lng:90-180*a/Math.PI-(a<-Math.PI/2?360:0),altitude:i/sy-1}}function uy(e){return e*Math.PI/180}var cy=window.THREE?window.THREE:{BackSide:1,BufferAttribute:qr,Color:Rr,Mesh:ci,ShaderMaterial:gi};var Ay=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.color,s=void 0===i?"gold":i,a=r.size,o=void 0===a?2:a,l=r.coefficient,u=void 0===l?.5:l,c=r.power,A=void 0===c?1:c,h=r.hollowRadius,d=void 0===h?0:h,p=r.backside,f=void 0===p||p;B_(this,t),n=I_(this,t);var m=function(e,t){for(var n=e.clone(),r=new Float32Array(3*e.attributes.position.count),i=0,s=r.length;i<s;i++){var a=e.attributes.normal.array[i],o=e.attributes.position.array[i];r[i]=o+a*t}return n.setAttribute("position",new cy.BufferAttribute(r,3)),n}(e,o),g=function(e,t,n,r){return new cy.ShaderMaterial({depthWrite:!1,transparent:!0,vertexShader:"\nuniform float hollowRadius;\n\nvarying vec3 vVertexWorldPosition;\nvarying vec3 vVertexNormal;\nvarying float vCameraDistanceToObjCenter;\nvarying float vVertexAngularDistanceToHollowRadius;\n\nvoid main() { \n vVertexNormal\t= normalize(normalMatrix * normal);\n vVertexWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n \n vec4 objCenterViewPosition = modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0);\n vCameraDistanceToObjCenter = length(objCenterViewPosition);\n \n float edgeAngle = atan(hollowRadius / vCameraDistanceToObjCenter);\n float vertexAngle = acos(dot(normalize(modelViewMatrix * vec4(position, 1.0)), normalize(objCenterViewPosition)));\n vVertexAngularDistanceToHollowRadius = vertexAngle - edgeAngle;\n\n gl_Position\t= projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",fragmentShader:"\nuniform vec3 color;\nuniform float coefficient;\nuniform float power;\nuniform float hollowRadius;\n\nvarying vec3 vVertexNormal;\nvarying vec3 vVertexWorldPosition;\nvarying float vCameraDistanceToObjCenter;\nvarying float vVertexAngularDistanceToHollowRadius;\n\nvoid main() {\n if (vCameraDistanceToObjCenter < hollowRadius) discard; // inside the hollowRadius\n if (vVertexAngularDistanceToHollowRadius < 0.0) discard; // frag position is within the hollow radius\n\n vec3 worldCameraToVertex = vVertexWorldPosition - cameraPosition;\n vec3 viewCameraToVertex\t= (viewMatrix * vec4(worldCameraToVertex, 0.0)).xyz;\n viewCameraToVertex = normalize(viewCameraToVertex);\n float intensity\t= pow(\n coefficient + dot(vVertexNormal, viewCameraToVertex),\n power\n );\n gl_FragColor = vec4(color, intensity);\n}",uniforms:{coefficient:{value:e},color:{value:new cy.Color(t)},power:{value:n},hollowRadius:{value:r}}})}(u,s,A,d);return f&&(g.side=cy.BackSide),n.geometry=m,n.material=g,n}return j_(t,e),G_(t)}(cy.Mesh),hy=window.THREE?window.THREE:{Color:Rr,LineBasicMaterial:Gi,LineSegments:Ji,Mesh:ci,MeshPhongMaterial:ca,SphereGeometry:ra,SRGBColorSpace:rt,TextureLoader:Sa},dy=xc({props:{globeImageUrl:{},bumpImageUrl:{},showGlobe:{default:!0,onChange:function(e,t){t.globeObj.visible=!!e},triggerUpdate:!1},showGraticules:{default:!1,onChange:function(e,t){t.graticulesObj.visible=!!e},triggerUpdate:!1},showAtmosphere:{default:!0,onChange:function(e,t){t.atmosphereObj&&(t.atmosphereObj.visible=!!e)},triggerUpdate:!1},atmosphereColor:{default:"lightskyblue"},atmosphereAltitude:{default:.15},onReady:{default:function(){},triggerUpdate:!1}},methods:{globeMaterial:function(e,t){return void 0!==t?(e.globeObj.material=t||e.defaultGlobeMaterial,this):e.globeObj.material},_destructor:function(e){ry(e.globeObj),ry(e.graticulesObj)}},stateInit:function(){var e=new hy.SphereGeometry(sy,75,75),t=new hy.MeshPhongMaterial({color:0}),n=new hy.Mesh(e,t);return n.rotation.y=-Math.PI/2,n.__globeObjType="globe",{globeObj:n,graticulesObj:new hy.LineSegments(new Tp(Yd(),sy,2),new hy.LineBasicMaterial({color:"lightgrey",transparent:!0,opacity:.1})),defaultGlobeMaterial:t}},init:function(e,t){ry(e),t.scene=e,t.scene.add(t.globeObj),t.scene.add(t.graticulesObj),t.ready=!1},update:function(e,t){var n=e.globeObj.material;if(t.hasOwnProperty("globeImageUrl")&&(e.globeImageUrl?(new hy.TextureLoader).load(e.globeImageUrl,(function(t){t.colorSpace=hy.SRGBColorSpace,n.map=t,n.color=null,n.needsUpdate=!0,!e.ready&&(e.ready=!0)&&setTimeout(e.onReady)})):!n.color&&(n.color=new hy.Color(0))),t.hasOwnProperty("bumpImageUrl")&&(e.bumpImageUrl?e.bumpImageUrl&&(new hy.TextureLoader).load(e.bumpImageUrl,(function(e){n.bumpMap=e,n.needsUpdate=!0})):(n.bumpMap=null,n.needsUpdate=!0)),(t.hasOwnProperty("atmosphereColor")||t.hasOwnProperty("atmosphereAltitude"))&&(e.atmosphereObj&&(e.scene.remove(e.atmosphereObj),ry(e.atmosphereObj)),e.atmosphereColor&&e.atmosphereAltitude)){var r=e.atmosphereObj=new Ay(e.globeObj.geometry,{color:e.atmosphereColor,size:sy*e.atmosphereAltitude,hollowRadius:sy,coefficient:.1,power:3.5});r.visible=!!e.showAtmosphere,r.__globeObjType="atmosphere",e.scene.add(r)}e.ready||e.globeImageUrl||(e.ready=!0,e.onReady())}}),py=function(e){return isNaN(e)?parseInt(mf(e).toHex(),16):e},fy=function(e){return e&&isNaN(e)?$p(e).opacity:1},my=function(e){var t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=1,s=/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.eE+-]+)\s*\)$/.exec(e.trim().toLowerCase());if(s){var a=$_(s.slice(1),4),o=a[0],l=a[1],u=a[2],c=a[3];t=new Rr("rgb(".concat(+o,",").concat(+l,",").concat(+u,")")),i=Math.min(+c,1)}else t=new Rr(e);r&&t.convertLinearToSRGB();var A=t.toArray();return n?[].concat(Z_(A),[i]):A};var gy=window.THREE?window.THREE:{BufferAttribute:qr};function vy(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Float32Array;if(1===t)return new gy.BufferAttribute(new n(e),t);for(var r=new gy.BufferAttribute(new n(e.length*t),t),i=0,s=e.length;i<s;i++)r.set(e[i],i*t);return r}var _y=new WeakMap,yy=new WeakMap,xy=new WeakMap,by=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.dataBindAttr,s=void 0===i?"__data":i,a=r.objBindAttr,o=void 0===a?"__threeObj":a,l=r.removeDelay,u=void 0===l?0:l;return B_(this,t),z_(n=I_(this,t),"scene",void 0),F_(n,_y,void 0),F_(n,yy,void 0),F_(n,xy,void 0),n.scene=e,k_(_y,n,s),k_(yy,n,o),k_(xy,n,u),n.onRemoveObj((function(){})),n}return j_(t,e),G_(t,[{key:"onCreateObj",value:function(e){var n=this;return K_(t,"onCreateObj",this)([function(t){var r=e(t);return t[O_(yy,n)]=r,r[O_(_y,n)]=t,n.scene.add(r),r}]),this}},{key:"onRemoveObj",value:function(e){var n=this;return K_(t,"onRemoveObj",this)([function(r,i){var s=K_(t,"getData",n)([r]);e(r,i);var a=function(){n.scene.remove(r),ry(r),delete s[O_(yy,n)]};O_(xy,n)?setTimeout(a,O_(xy,n)):a()}]),this}}])}(cm),Sy=window.THREE?window.THREE:{BufferGeometry:Zr,Color:Rr,CylinderGeometry:Ts,Matrix4:On,Mesh:ci,MeshLambertMaterial:da,Object3D:cr,Vector3:on},Ty=Object.assign({},Np),wy=Ty.BufferGeometryUtils||Ty,My=xc({props:{pointsData:{default:[]},pointLat:{default:"lat"},pointLng:{default:"lng"},pointColor:{default:function(){return"#ffffaa"}},pointAltitude:{default:.1},pointRadius:{default:.25},pointResolution:{default:12,triggerUpdate:!1},pointsMerge:{default:!1},pointsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(e,t,n){var r=n.tweenGroup;ry(e),t.scene=e,t.tweenGroup=r,t.dataMapper=new by(e,{objBindAttr:"__threeObjPoint"})},update:function(e,t){var n=Pp(e.pointLat),r=Pp(e.pointLng),i=Pp(e.pointAltitude),s=Pp(e.pointRadius),a=Pp(e.pointColor),o=new Sy.CylinderGeometry(1,1,1,e.pointResolution);o.applyMatrix4((new Sy.Matrix4).makeRotationX(Math.PI/2)),o.applyMatrix4((new Sy.Matrix4).makeTranslation(0,0,-.5));var l=2*Math.PI*sy/360,u={};if(!e.pointsMerge&&t.hasOwnProperty("pointsMerge")&&ry(e.scene),e.dataMapper.scene=e.pointsMerge?new Sy.Object3D:e.scene,e.dataMapper.onCreateObj((function(){var e=new Sy.Mesh(o);return e.__globeObjType="point",e})).onUpdateObj((function(t,o){var c=function(n){var r=t.__currentTargetD=n,i=r.r,s=r.alt,a=r.lat,o=r.lng;Object.assign(t.position,oy(a,o));var u=e.pointsMerge?new Sy.Vector3(0,0,0):e.scene.localToWorld(new Sy.Vector3(0,0,0));t.lookAt(u),t.scale.x=t.scale.y=Math.min(30,i)*l,t.scale.z=Math.max(s*sy,.1)},A={alt:+i(o),r:+s(o),lat:+n(o),lng:+r(o)},h=t.__currentTargetD||Object.assign({},A,{alt:-.001});Object.keys(A).some((function(e){return h[e]!==A[e]}))&&(e.pointsMerge||!e.pointsTransitionDuration||e.pointsTransitionDuration<0?c(A):e.tweenGroup.add(new Rc(h).to(A,e.pointsTransitionDuration).easing(Sc.Quadratic.InOut).onUpdate(c).start()));if(!e.pointsMerge){var d=a(o),p=d?fy(d):0,f=!!p;t.visible=f,f&&(u.hasOwnProperty(d)||(u[d]=new Sy.MeshLambertMaterial({color:py(d),transparent:p<1,opacity:p})),t.material=u[d])}})).digest(e.pointsData),e.pointsMerge){var c=e.pointsData.length?(wy.mergeGeometries||wy.mergeBufferGeometries)(e.pointsData.map((function(t){var n=e.dataMapper.getObj(t),r=n.geometry.clone();n.updateMatrix(),r.applyMatrix4(n.matrix);var i=my(a(t));return r.setAttribute("color",vy(Array(r.getAttribute("position").count).fill(i),4)),r}))):new Sy.BufferGeometry,A=new Sy.Mesh(c,new Sy.MeshLambertMaterial({color:16777215,transparent:!0,vertexColors:!0}));A.__globeObjType="points",A.__data=e.pointsData,e.dataMapper.clear(),ry(e.scene),e.scene.add(A)}}}),Ey=function(e){return e.uniforms.surfaceRadius={type:"float",value:0},e.vertexShader=("attribute float surfaceRadius;\nvarying float vSurfaceRadius;\nvarying vec3 vPos;\n"+e.vertexShader).replace("void main() {",["void main() {","vSurfaceRadius = surfaceRadius;","vPos = position;"].join("\n")),e.fragmentShader=("uniform float surfaceRadius;\nvarying float vSurfaceRadius;\nvarying vec3 vPos;\n"+e.fragmentShader).replace("void main() {",["void main() {","if (length(vPos) < max(surfaceRadius, vSurfaceRadius)) discard;"].join("\n")),e},Cy=function(e){return e.vertexShader="\n attribute float r;\n \n const float PI = 3.1415926535897932384626433832795;\n float toRad(in float a) {\n return a * PI / 180.0;\n }\n \n vec3 Polar2Cartesian(in vec3 c) { // [lat, lng, r]\n float phi = toRad(90.0 - c.x);\n float theta = toRad(90.0 - c.y);\n float r = c.z;\n return vec3( // x,y,z\n r * sin(phi) * cos(theta),\n r * cos(phi),\n r * sin(phi) * sin(theta)\n );\n }\n \n vec2 Cartesian2Polar(in vec3 p) {\n float r = sqrt(p.x * p.x + p.y * p.y + p.z * p.z);\n float phi = acos(p.y / r);\n float theta = atan(p.z, p.x);\n return vec2( // lat,lng\n 90.0 - phi * 180.0 / PI,\n 90.0 - theta * 180.0 / PI - (theta < -PI / 2.0 ? 360.0 : 0.0)\n );\n }\n ".concat(e.vertexShader.replace("}"," \n vec3 pos = Polar2Cartesian(vec3(Cartesian2Polar(position), r));\n gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n }\n "),"\n "),e},Ry=function(e,t){return e.onBeforeCompile=function(n){e.userData.shader=t(n)},e},Ny=["stroke"],Py=window.THREE?window.THREE:{BufferGeometry:Zr,CubicBezierCurve3:fs,Curve:is,Group:ts,Line:Yi,Mesh:ci,NormalBlending:1,QuadraticBezierCurve3:vs,ShaderMaterial:gi,TubeGeometry:ia,Vector3:on},Dy=fm.default||fm,Ly=xc({props:{arcsData:{default:[]},arcStartLat:{default:"startLat"},arcStartLng:{default:"startLng"},arcEndLat:{default:"endLat"},arcEndLng:{default:"endLng"},arcColor:{default:function(){return"#ffffaa"}},arcAltitude:{},arcAltitudeAutoScale:{default:.5},arcStroke:{},arcCurveResolution:{default:64,triggerUpdate:!1},arcCircularResolution:{default:6,triggerUpdate:!1},arcDashLength:{default:1},arcDashGap:{default:0},arcDashInitialGap:{default:0},arcDashAnimateTime:{default:0},arcsTransitionDuration:{default:1e3,triggerUpdate:!1}},methods:{pauseAnimation:function(e){var t;null===(t=e.ticker)||void 0===t||t.pause()},resumeAnimation:function(e){var t;null===(t=e.ticker)||void 0===t||t.resume()},_destructor:function(e){var t;e.sharedMaterial.dispose(),null===(t=e.ticker)||void 0===t||t.dispose()}},stateInit:function(e){return{tweenGroup:e.tweenGroup,ticker:new Dy,sharedMaterial:new Py.ShaderMaterial(Q_(Q_({},{uniforms:{dashOffset:{value:0},dashSize:{value:1},gapSize:{value:0},dashTranslate:{value:0}},vertexShader:"\n uniform float dashTranslate; \n\n attribute vec4 color;\n varying vec4 vColor;\n \n attribute float relDistance;\n varying float vRelDistance;\n\n void main() {\n // pass through colors and distances\n vColor = color;\n vRelDistance = relDistance + dashTranslate;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",fragmentShader:"\n uniform float dashOffset; \n uniform float dashSize;\n uniform float gapSize; \n \n varying vec4 vColor;\n varying float vRelDistance;\n \n void main() {\n // ignore pixels in the gap\n if (vRelDistance < dashOffset) discard;\n if (mod(vRelDistance - dashOffset, dashSize + gapSize) > dashSize) discard;\n \n // set px color: [r, g, b, a], interpolated between vertices \n gl_FragColor = vColor; \n }\n "}),{},{transparent:!0,blending:Py.NormalBlending}))}},init:function(e,t){ry(e),t.scene=e,t.dataMapper=new by(e,{objBindAttr:"__threeObjArc"}).onCreateObj((function(){var e=new Py.Group;return e.__globeObjType="arc",e})),t.ticker.onTick.add((function(e,n){t.dataMapper.entries().map((function(e){return $_(e,2)[1]})).filter((function(e){return e.children.length&&e.children[0].material&&e.children[0].__dashAnimateStep})).forEach((function(e){var t=e.children[0],r=t.__dashAnimateStep*n,i=t.material.uniforms.dashTranslate.value%1e9;t.material.uniforms.dashTranslate.value=i+r}))}))},update:function(e){var t=Pp(e.arcStartLat),n=Pp(e.arcStartLng),r=Pp(e.arcEndLat),i=Pp(e.arcEndLng),s=Pp(e.arcAltitude),a=Pp(e.arcAltitudeAutoScale),o=Pp(e.arcStroke),l=Pp(e.arcColor),u=Pp(e.arcDashLength),c=Pp(e.arcDashGap),A=Pp(e.arcDashInitialGap),h=Pp(e.arcDashAnimateTime);e.dataMapper.onUpdateObj((function(d,p){var f=o(p),m=null!=f;if(!d.children.length||m!==("Mesh"===d.children[0].type)){ry(d);var g=m?new Py.Mesh:new Py.Line(new Py.BufferGeometry);g.material=e.sharedMaterial.clone(),d.add(g)}var v=d.children[0];Object.assign(v.material.uniforms,{dashSize:{value:u(p)},gapSize:{value:c(p)},dashOffset:{value:A(p)}});var _=h(p);v.__dashAnimateStep=_>0?1e3/_:0;var y=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=t+1;if(e instanceof Array||e instanceof Function){var s=e instanceof Array?rg().domain(e.map((function(t,n){return n/(e.length-1)}))).range(e):e;n=function(e){return my(s(e),!0,!0)}}else{var a=my(e,!0,!0);n=function(){return a}}for(var o=[],l=0,u=i;l<u;l++)for(var c=n(l/(u-1)),A=0;A<r;A++)o.push(c);return vy(o,4)}(l(p),e.arcCurveResolution,m?e.arcCircularResolution+1:1),x=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[],i=0,s=e+1;i<s;i++)for(var a=i/(s-1),o=0;o<t;o++)r.push(a);return n&&r.reverse(),vy(r,1)}(e.arcCurveResolution,m?e.arcCircularResolution+1:1,!0);v.geometry.setAttribute("color",y),v.geometry.setAttribute("relDistance",x);var b=function(t){var n=d.__currentTargetD=t,r=n.stroke,i=function(e){var t=e.alt,n=e.altAutoScale,r=e.startLat,i=e.startLng,s=e.endLat,a=e.endLng,o=function(e){var t=$_(e,3),n=t[0],r=oy(t[1],n,t[2]),i=r.x,s=r.y,a=r.z;return new Py.Vector3(i,s,a)},l=[i,r],u=[a,s],c=t;if(null==c&&(c=Fd(l,u)/2*n),c){var A=$d(l,u),h=$_([.25,.75].map((function(e){return[].concat(Z_(A(e)),[1.5*c])})),2),d=h[0],p=h[1];return q_(Py.CubicBezierCurve3,Z_([l,d,p,u].map(o)))}var f=.001;return m.apply(void 0,Z_([[].concat(l,[f]),[].concat(u,[f])].map(o)));function m(e,t){var n=e.angleTo(t),r=0===n?function(){return e.clone()}:function(r){return(new Py.Vector3).addVectors(e.clone().multiplyScalar(Math.sin((1-r)*n)),t.clone().multiplyScalar(Math.sin(r*n))).divideScalar(Math.sin(n))},i=new Py.Curve;return i.getPoint=r,i}}(function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(n,Ny));m?(v.geometry&&v.geometry.dispose(),v.geometry=new Py.TubeGeometry(i,e.arcCurveResolution,r/2,e.arcCircularResolution),v.geometry.setAttribute("color",y),v.geometry.setAttribute("relDistance",x)):v.geometry.setFromPoints(i.getPoints(e.arcCurveResolution))},S={stroke:f,alt:s(p),altAutoScale:+a(p),startLat:+t(p),startLng:+n(p),endLat:+r(p),endLng:+i(p)},T=d.__currentTargetD||Object.assign({},S,{altAutoScale:-.001});Object.keys(S).some((function(e){return T[e]!==S[e]}))&&(!e.arcsTransitionDuration||e.arcsTransitionDuration<0?b(S):e.tweenGroup.add(new Rc(T).to(S,e.arcsTransitionDuration).easing(Sc.Quadratic.InOut).onUpdate(b).start()))})).digest(e.arcsData)}}),Iy=window.THREE?window.THREE:{BufferGeometry:Zr,Color:Rr,DoubleSide:2,Mesh:ci,MeshLambertMaterial:da,Object3D:cr},Uy=Object.assign({},Np),By=Uy.BufferGeometryUtils||Uy,Oy=xc({props:{hexBinPointsData:{default:[]},hexBinPointLat:{default:"lat"},hexBinPointLng:{default:"lng"},hexBinPointWeight:{default:1},hexBinResolution:{default:4},hexMargin:{default:.2},hexTopCurvatureResolution:{default:5},hexTopColor:{default:function(){return"#ffffaa"}},hexSideColor:{default:function(){return"#ffffaa"}},hexAltitude:{default:function(e){return.01*e.sumWeight}},hexBinMerge:{default:!1},hexTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(e,t,n){var r=n.tweenGroup;ry(e),t.scene=e,t.tweenGroup=r,t.dataMapper=new by(e,{objBindAttr:"__threeObjHexbin"})},update:function(e,t){var n=Pp(e.hexBinPointLat),r=Pp(e.hexBinPointLng),i=Pp(e.hexBinPointWeight),s=Pp(e.hexAltitude),a=Pp(e.hexTopColor),o=Pp(e.hexSideColor),l=Pp(e.hexMargin),u=yv(e.hexBinPointsData.map((function(t){return Q_(Q_({},t),{},{h3Idx:Jv(n(t),r(t),e.hexBinResolution)})})),"h3Idx"),c=Object.entries(u).map((function(e){var t=$_(e,2),n=t[0],r=t[1];return{h3Idx:n,points:r,sumWeight:r.reduce((function(e,t){return e+ +i(t)}),0)}})),A={};if(!e.hexBinMerge&&t.hasOwnProperty("hexBinMerge")&&ry(e.scene),e.dataMapper.scene=e.hexBinMerge?new Iy.Object3D:e.scene,e.dataMapper.id((function(e){return e.h3Idx})).onCreateObj((function(e){var t=new Iy.Mesh;t.__hexCenter=e_(e.h3Idx),t.__hexGeoJson=t_(e.h3Idx).reverse();var n=t.__hexCenter[1];return t.__hexGeoJson.forEach((function(e){var t=e[0];Math.abs(n-t)>170&&(e[0]+=n>t?360:-360)})),t.__globeObjType="hexbin",t})).onUpdateObj((function(t,n){var r=Math.max(0,Math.min(1,+l(n))),i=$_(t.__hexCenter,2),u=i[0],c=i[1],h=0===r?t.__hexGeoJson:t.__hexGeoJson.map((function(e){var t=$_(e,2),n=t[0],i=t[1];return[[n,c],[i,u]].map((function(e){var t=$_(e,2);return function(e,t,n){return e-(e-t)*n}(t[0],t[1],r)}))})),d=e.hexTopCurvatureResolution;t.geometry&&t.geometry.dispose(),t.geometry=new pv([h],0,sy,!1,!0,!0,d);var p={alt:+s(n)},f=function(e){var n=(t.__currentTargetD=e).alt;t.scale.x=t.scale.y=t.scale.z=1+n;var r=sy/(n+1);t.geometry.setAttribute("surfaceRadius",vy(Array(t.geometry.getAttribute("position").count).fill(r),1))},m=t.__currentTargetD||Object.assign({},p,{alt:-.001});Object.keys(p).some((function(e){return m[e]!==p[e]}))&&(e.hexBinMerge||!e.hexTransitionDuration||e.hexTransitionDuration<0?f(p):e.tweenGroup.add(new Rc(m).to(p,e.hexTransitionDuration).easing(Sc.Quadratic.InOut).onUpdate(f).start()));if(!e.hexBinMerge){var g=o(n),v=a(n);[g,v].forEach((function(e){if(!A.hasOwnProperty(e)){var t=fy(e);A[e]=Ry(new Iy.MeshLambertMaterial({color:py(e),transparent:t<1,opacity:t,side:Iy.DoubleSide}),Ey)}})),t.material=[g,v].map((function(e){return A[e]}))}})).digest(c),e.hexBinMerge){var h=c.length?(By.mergeGeometries||By.mergeBufferGeometries)(c.map((function(t){var n=e.dataMapper.getObj(t),r=n.geometry.toNonIndexed();n.updateMatrix(),r.applyMatrix4(n.matrix);var i=my(a(t)),s=my(o(t)),l=r.getAttribute("position").count,u=r.groups[0].count;return r.setAttribute("color",vy(Z_(new Array(l)).map((function(e,t){return t>=u?i:s})),4)),r}))):new Iy.BufferGeometry,d=new Iy.MeshLambertMaterial({color:16777215,transparent:!0,vertexColors:!0,side:Iy.DoubleSide});d.onBeforeCompile=function(e){d.userData.shader=Ey(e)};var p=new Iy.Mesh(h,d);p.__globeObjType="hexBinPoints",p.__data=c,e.dataMapper.clear(),ry(e.scene),e.scene.add(p)}}}),Fy=function(e){return e*e};var ky=Math.sqrt(2*Math.PI);var qy=function(e){var t=$_(e,2),n=t[0],r=t[1],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=s.lngAccessor,o=void 0===a?function(e){return e[0]}:a,l=s.latAccessor,u=void 0===l?function(e){return e[1]}:l,c=s.weightAccessor,A=void 0===c?function(){return 1}:c,h=s.bandwidth,d=[n,r],p=h*Math.PI/180;return function(e){let t=0;for(let n of e)(n=+n)&&(t+=n);return t}(i.map((function(e){var t=A(e);if(!t)return 0;var n,r,i=function(e,t){var n=Math.sqrt,r=Math.cos,i=function(e){return e*Math.PI/180},s=function(e){return Fy(Math.sin(e/2))},a=i(e[1]),o=i(t[1]),l=i(e[0]),u=i(t[0]);return 2*Math.asin(n(s(o-a)+r(a)*r(o)*s(u-l)))}(d,[o(e),u(e)]);return n=i,r=p,Math.exp(-Fy(n/r)/2)/(r*ky)*t})))},Gy=window.THREE?window.THREE:{Mesh:ci,MeshLambertMaterial:da,SphereGeometry:ra},zy=new WeakSet,Vy=new WeakMap,Hy=new WeakMap,jy=new WeakMap,Wy=function(){return G_((function e(t,n){B_(this,e),function(e,t){U_(e,t),t.add(e)}(this,zy),F_(this,Vy,void 0),F_(this,Hy,void 0),F_(this,jy,void 0),k_(Vy,this,t),k_(Hy,this,a_()),O_(Hy,this).init(t.map((function(e){return[e.x,e.y,e.z]})).flat()),k_(jy,this,L_(zy,this,Xy).call(this,oy(0,0),oy(0,Math.min(180,n))))}),[{key:"getNearPoints",value:function(e,t,n){var r=this;return O_(Hy,this).intersectSphere(e,t,n,O_(jy,this)).map((function(e){return O_(Vy,r)[e/3]}))}}])}();function Xy(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)+Math.pow(e.z-t.z,2))}var Qy=function(e){var t=$p(function(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+e*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-14825.05*e)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+707.56*e)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-6838.66*e)))))))+")"}(e));return t.opacity=Math.cbrt(e),t.formatRgb()},Yy=xc({props:{heatmapsData:{default:[]},heatmapPoints:{default:function(e){return e}},heatmapPointLat:{default:function(e){return e[0]}},heatmapPointLng:{default:function(e){return e[1]}},heatmapPointWeight:{default:1},heatmapBandwidth:{default:2.5},heatmapColorFn:{default:function(){return Qy}},heatmapColorSaturation:{default:1.5},heatmapBaseAltitude:{default:.01},heatmapTopAltitude:{},heatmapsTransitionDuration:{default:0,triggerUpdate:!1}},init:function(e,t,n){var r=n.tweenGroup;ry(e),t.scene=e,t.tweenGroup=r,t.dataMapper=new by(e,{objBindAttr:"__threeObjHeatmap"}).onCreateObj((function(){var e=new Gy.Mesh(new Gy.SphereGeometry(sy),Ry(new Gy.MeshLambertMaterial({vertexColors:!0,transparent:!0}),Cy));return e.__globeObjType="heatmap",e}))},update:function(e){var t=Pp(e.heatmapPoints),n=Pp(e.heatmapPointLat),r=Pp(e.heatmapPointLng),i=Pp(e.heatmapPointWeight),s=Pp(e.heatmapBandwidth),a=Pp(e.heatmapColorFn),o=Pp(e.heatmapColorSaturation),l=Pp(e.heatmapBaseAltitude),u=Pp(e.heatmapTopAltitude);e.dataMapper.onUpdateObj((function(c,A){var h=s(A),d=a(A),p=o(A),f=l(A),m=u(A),g=t(A).map((function(e){var t=n(e),s=r(e),a=oy(t,s);return{x:a.x,y:a.y,z:a.z,lat:t,lng:s,weight:i(e)}})),v=Math.max(.1,h/3.5),_=Math.ceil(360/(v||-1));c.geometry.parameters.widthSegments!==_&&(c.geometry.dispose(),c.geometry=new Gy.SphereGeometry(sy,_,_/2));var y=function(e){for(var t=e.itemSize,n=[],r=0;r<e.count;r++)n.push(e.array.slice(r*t,(r+1)*t));return n}(c.geometry.getAttribute("position")),x=y.map((function(e){var t=$_(e,3),n=ly({x:t[0],y:t[1],z:t[2]});return[n.lng,n.lat]})),b=new Wy(g,3.5*h),S=x.map((function(e,t){var n=$_(y[t],3),r=n[0],i=n[1],s=n[2];return qy(e,b.getNearPoints(r,i,s),{latAccessor:function(e){return e.lat},lngAccessor:function(e){return e.lng},weightAccessor:function(e){return e.weight},bandwidth:h})})),T=Z_(new Array(100)).map((function(e,t){return my(d(t/99))})),w=function(e){var t=c.__currentTargetD=e,n=t.kdeVals,r=t.topAlt,i=t.saturation,s=function(e){let t;for(const n of e)null!=n&&(t<n||void 0===t&&n>=n)&&(t=n);return t}(n.map(Math.abs))||1e-15,a=ig([0,s/i],T);c.geometry.setAttribute("color",vy(n.map((function(e){return a(Math.abs(e))})),4));var o=rg([0,s],[sy*(1+f),sy*(1+(r||f))]);c.geometry.setAttribute("r",vy(n.map(o)))},M={kdeVals:S,topAlt:m,saturation:p},E=c.__currentTargetD||Object.assign({},M,{kdeVals:S.map((function(){return 0})),topAlt:m?f:m,saturation:.5});E.kdeVals.length!==S.length&&(E.kdeVals=S.slice()),Object.keys(M).some((function(e){return E[e]!==M[e]}))&&(!e.heatmapsTransitionDuration||e.heatmapsTransitionDuration<0?w(M):e.tweenGroup.add(new Rc(E).to(M,e.heatmapsTransitionDuration).easing(Sc.Quadratic.InOut).onUpdate(w).start()))})).digest(e.heatmapsData)}}),$y=window.THREE?window.THREE:{DoubleSide:2,Group:ts,LineBasicMaterial:Gi,LineSegments:Ji,Mesh:ci,MeshBasicMaterial:Lr},Ky=xc({props:{polygonsData:{default:[]},polygonGeoJsonGeometry:{default:"geometry"},polygonSideColor:{default:function(){return"#ffffaa"}},polygonSideMaterial:{},polygonCapColor:{default:function(){return"#ffffaa"}},polygonCapMaterial:{},polygonStrokeColor:{},polygonAltitude:{default:.01},polygonCapCurvatureResolution:{default:5},polygonsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(e,t,n){var r=n.tweenGroup;ry(e),t.scene=e,t.tweenGroup=r,t.dataMapper=new by(e,{objBindAttr:"__threeObjPolygon"}).id((function(e){return e.id})).onCreateObj((function(){var e=new $y.Group;return e.__defaultSideMaterial=Ry(new $y.MeshBasicMaterial({side:$y.DoubleSide,depthWrite:!0}),Ey),e.__defaultCapMaterial=new $y.MeshBasicMaterial({side:$y.DoubleSide,depthWrite:!0}),e.add(new $y.Mesh(void 0,[e.__defaultSideMaterial,e.__defaultCapMaterial])),e.add(new $y.LineSegments(void 0,new $y.LineBasicMaterial)),e.__globeObjType="polygon",e}))},update:function(e){var t=Pp(e.polygonGeoJsonGeometry),n=Pp(e.polygonAltitude),r=Pp(e.polygonCapCurvatureResolution),i=Pp(e.polygonCapColor),s=Pp(e.polygonCapMaterial),a=Pp(e.polygonSideColor),o=Pp(e.polygonSideMaterial),l=Pp(e.polygonStrokeColor),u=[];e.polygonsData.forEach((function(e){var c={data:e,capColor:i(e),capMaterial:s(e),sideColor:a(e),sideMaterial:o(e),strokeColor:l(e),altitude:+n(e),capCurvatureResolution:+r(e)},A=t(e),h=e.__id||"".concat(Math.round(1e9*Math.random()));e.__id=h,"Polygon"===A.type?u.push(Q_({id:"".concat(h,"_0"),coords:A.coordinates},c)):"MultiPolygon"===A.type?u.push.apply(u,Z_(A.coordinates.map((function(e,t){return Q_({id:"".concat(h,"_").concat(t),coords:e},c)})))):console.warn("Unsupported GeoJson geometry type: ".concat(A.type,". Skipping geometry..."))})),e.dataMapper.onUpdateObj((function(t,n){var r=n.coords,i=n.capColor,s=n.capMaterial,a=n.sideColor,o=n.sideMaterial,l=n.strokeColor,u=n.altitude,c=n.capCurvatureResolution,A=$_(t.children,2),h=A[0],d=A[1],p=!!l;if(d.visible=p,function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return function(e,t){return e===t}};return Object.entries(t).every((function(t){var r=$_(t,2),i=r[0],s=r[1];return e.hasOwnProperty(i)&&n(i)(e[i],s)}))}(h.geometry.parameters||{},{polygonGeoJson:r,curvatureResolution:c})||(h.geometry&&h.geometry.dispose(),h.geometry=new pv(r,0,sy,!1,!0,!0,c)),!p||d.geometry.parameters&&d.geometry.parameters.geoJson.coordinates===r&&d.geometry.parameters.resolution===c||(d.geometry&&d.geometry.dispose(),d.geometry=new Tp({type:"Polygon",coordinates:r},sy,c)),h.material[0]=o||t.__defaultSideMaterial,h.material[1]=s||t.__defaultCapMaterial,[!o&&a,!s&&i].forEach((function(e,t){if(e){var n=h.material[t],r=fy(e);n.color.set(py(e)),n.transparent=r<1,n.opacity=r}})),p){var f=d.material,m=fy(l);f.color.set(py(l)),f.transparent=m<1,f.opacity=m}var g={alt:u},v=function(e){var n=(t.__currentTargetD=e).alt;h.scale.x=h.scale.y=h.scale.z=1+n,p&&(d.scale.x=d.scale.y=d.scale.z=1+n+1e-4),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e};if(e.userData.shader)t(e.userData.shader.uniforms);else{var n=e.onBeforeCompile;e.onBeforeCompile=function(e){n(e),t(e.uniforms)}}}(t.__defaultSideMaterial,(function(e){return e.surfaceRadius.value=sy/(n+1)}))},_=t.__currentTargetD||Object.assign({},g,{alt:-.001});Object.keys(g).some((function(e){return _[e]!==g[e]}))&&(!e.polygonsTransitionDuration||e.polygonsTransitionDuration<0||_.alt===g.alt?v(g):e.tweenGroup.add(new Rc(_).to(g,e.polygonsTransitionDuration).easing(Sc.Quadratic.InOut).onUpdate(v).start()))})).digest(u)}});var Zy=window.THREE?window.THREE:{BufferGeometry:Zr,CircleGeometry:Ss,DoubleSide:2,Mesh:ci,MeshLambertMaterial:da,Vector3:on},Jy=Object.assign({},Np),ex=Jy.BufferGeometryUtils||Jy,tx=xc({props:{hexPolygonsData:{default:[]},hexPolygonGeoJsonGeometry:{default:"geometry"},hexPolygonColor:{default:function(){return"#ffffaa"}},hexPolygonAltitude:{default:.001},hexPolygonResolution:{default:3},hexPolygonMargin:{default:.2},hexPolygonUseDots:{default:!1},hexPolygonCurvatureResolution:{default:5},hexPolygonDotResolution:{default:12},hexPolygonsTransitionDuration:{default:0,triggerUpdate:!1}},init:function(e,t,n){var r=n.tweenGroup;ry(e),t.scene=e,t.tweenGroup=r,t.dataMapper=new by(e,{objBindAttr:"__threeObjHexPolygon"}).onCreateObj((function(){var e=new Zy.Mesh(void 0,new Zy.MeshLambertMaterial({side:Zy.DoubleSide}));return e.__globeObjType="hexPolygon",e}))},update:function(e){var t=Pp(e.hexPolygonGeoJsonGeometry),n=Pp(e.hexPolygonColor),r=Pp(e.hexPolygonAltitude),i=Pp(e.hexPolygonResolution),s=Pp(e.hexPolygonMargin),a=Pp(e.hexPolygonUseDots),o=Pp(e.hexPolygonCurvatureResolution),l=Pp(e.hexPolygonDotResolution);e.dataMapper.onUpdateObj((function(u,c){var A=t(c),h=i(c),d=r(c),p=Math.max(0,Math.min(1,+s(c))),f=a(c),m=o(c),g=l(c),v=n(c),_=fy(v);u.material.color.set(py(v)),u.material.transparent=_<1,u.material.opacity=_;var y={alt:d,margin:p,curvatureResolution:m},x={geoJson:A,h3Res:h},b=u.__currentTargetD||Object.assign({},y,{alt:-.001}),S=u.__currentMemD||x;if(Object.keys(y).some((function(e){return b[e]!==y[e]}))||Object.keys(x).some((function(e){return S[e]!==x[e]}))){u.__currentMemD=x;var T=[];"Polygon"===A.type?n_(A.coordinates,h,!0).forEach((function(e){return T.push(e)})):"MultiPolygon"===A.type?A.coordinates.forEach((function(e){return n_(e,h,!0).forEach((function(e){return T.push(e)}))})):console.warn("Unsupported GeoJson geometry type: ".concat(A.type,". Skipping geometry..."));var w=T.map((function(e){var t=e_(e),n=t_(e).reverse(),r=t[1];return n.forEach((function(e){var t=e[0];Math.abs(r-t)>170&&(e[0]+=r>t?360:-360)})),{h3Idx:e,hexCenter:t,hexGeoJson:n}})),M=function(e){var t=u.__currentTargetD=e,n=t.alt,r=t.margin,i=t.curvatureResolution;u.geometry&&u.geometry.dispose(),u.geometry=w.length?(ex.mergeGeometries||ex.mergeBufferGeometries)(w.map((function(e){var t=$_(e.hexCenter,2),s=t[0],a=t[1];if(f){var o=oy(s,a,n),l=oy(e.hexGeoJson[0][1],e.hexGeoJson[0][0],n),u=.85*(1-r)*new Zy.Vector3(o.x,o.y,o.z).distanceTo(new Zy.Vector3(l.x,l.y,l.z)),c=new Ss(u,g);return c.rotateX(uy(-s)),c.rotateY(uy(a)),c.translate(o.x,o.y,o.z),c}var A=0===r?e.hexGeoJson:e.hexGeoJson.map((function(e){var t=$_(e,2),n=t[0],i=t[1];return[[n,a],[i,s]].map((function(e){var t=$_(e,2);return function(e,t,n){return e-(e-t)*n}(t[0],t[1],r)}))}));return new pv([A],sy,sy*(1+n),!1,!0,!1,i)}))):new Zy.BufferGeometry};!e.hexPolygonsTransitionDuration||e.hexPolygonsTransitionDuration<0?M(y):e.tweenGroup.add(new Rc(b).to(y,e.hexPolygonsTransitionDuration).easing(Sc.Quadratic.InOut).onUpdate(M).start())}})).digest(e.hexPolygonsData)}}),nx=window.THREE?window.THREE:{Vector3:on};function rx(e,t){var n=Math.max(e.length,t.length),r=Sm.apply(void 0,Z_([e,t].map((function(e){return e.map((function(e){return[e.x,e.y,e.z]}))})).map((function(e){return function(e,t){var n=e[e.length-1];return[].concat(Z_(e),Z_(Array(t-e.length).fill(n)))}(e,n)}))));return function(n){return 0===n?e:1===n?t:r(n).map((function(e){var t=$_(e,3),n=t[0],r=t[1],i=t[2];return new nx.Vector3(n,r,i)}))}}var ix=window.THREE?window.THREE:{BufferGeometry:Zr,Color:Rr,Group:ts,Line:Yi,NormalBlending:1,ShaderMaterial:gi,Vector3:on},sx=fm.default||fm,ax=xc({props:{pathsData:{default:[]},pathPoints:{default:function(e){return e}},pathPointLat:{default:function(e){return e[0]}},pathPointLng:{default:function(e){return e[1]}},pathPointAlt:{default:.001},pathResolution:{default:2},pathColor:{default:function(){return"#ffffaa"}},pathStroke:{},pathDashLength:{default:1},pathDashGap:{default:0},pathDashInitialGap:{default:0},pathDashAnimateTime:{default:0},pathTransitionDuration:{default:1e3,triggerUpdate:!1},rendererSize:{}},methods:{pauseAnimation:function(e){var t;null===(t=e.ticker)||void 0===t||t.pause()},resumeAnimation:function(e){var t;null===(t=e.ticker)||void 0===t||t.resume()},_destructor:function(e){var t;null===(t=e.ticker)||void 0===t||t.dispose()}},stateInit:function(e){return{tweenGroup:e.tweenGroup,ticker:new sx,sharedMaterial:new ix.ShaderMaterial(Q_(Q_({},{uniforms:{dashOffset:{value:0},dashSize:{value:1},gapSize:{value:0},dashTranslate:{value:0}},vertexShader:"\n uniform float dashTranslate; \n\n attribute vec4 color;\n varying vec4 vColor;\n \n attribute float relDistance;\n varying float vRelDistance;\n\n void main() {\n // pass through colors and distances\n vColor = color;\n vRelDistance = relDistance + dashTranslate;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",fragmentShader:"\n uniform float dashOffset; \n uniform float dashSize;\n uniform float gapSize; \n \n varying vec4 vColor;\n varying float vRelDistance;\n \n void main() {\n // ignore pixels in the gap\n if (vRelDistance < dashOffset) discard;\n if (mod(vRelDistance - dashOffset, dashSize + gapSize) > dashSize) discard;\n \n // set px color: [r, g, b, a], interpolated between vertices \n gl_FragColor = vColor; \n }\n "}),{},{transparent:!0,blending:ix.NormalBlending}))}},init:function(e,t){ry(e),t.scene=e,t.dataMapper=new by(e,{objBindAttr:"__threeObjPath"}).onCreateObj((function(){var e=new ix.Group;return e.__globeObjType="path",e})),t.ticker.onTick.add((function(e,n){t.dataMapper.entries().map((function(e){return $_(e,2)[1]})).filter((function(e){return e.children.length&&e.children[0].material&&e.children[0].__dashAnimateStep})).forEach((function(e){var t=e.children[0],r=t.__dashAnimateStep*n;if("Line"===t.type){var i=t.material.uniforms.dashTranslate.value%1e9;t.material.uniforms.dashTranslate.value=i+r}else if("Line2"===t.type){for(var s=t.material.dashOffset-r,a=t.material.dashSize+t.material.gapSize;s<=-a;)s+=a;t.material.dashOffset=s}}))}))},update:function(e){var t=Pp(e.pathPoints),n=Pp(e.pathPointLat),r=Pp(e.pathPointLng),i=Pp(e.pathPointAlt),s=Pp(e.pathStroke),a=Pp(e.pathColor),o=Pp(e.pathDashLength),l=Pp(e.pathDashGap),u=Pp(e.pathDashInitialGap),c=Pp(e.pathDashAnimateTime);function A(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=t+1;if(e instanceof Array||e instanceof Function){var a=e instanceof Array?rg().domain(e.map((function(t,n){return n/(e.length-1)}))).range(e):e;n=function(e){return my(a(e),i,!0)}}else{var o=my(e,i,!0);n=function(){return o}}for(var l=[],u=0,c=s;u<c;u++)for(var A=n(u/(c-1)),h=0;h<r;h++)l.push(A);return vy(l,i?4:3)}e.dataMapper.onUpdateObj((function(h,d){var p=s(d),f=null!=p;if(!h.children.length||f===("Line"===h.children[0].type)){ry(h);var m=f?new R_(new C_,new c_):new ix.Line(new ix.BufferGeometry,e.sharedMaterial.clone());h.add(m)}var g,v,_=h.children[0],y=function(e,t,n,r,i){var s=function(e,t,n){for(var r=[],i=1;i<=n;i++)r.push(e+(t-e)*i/(n+1));return r},a=function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,t=[],n=null;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(r){if(n){for(;Math.abs(n[1]-r[1])>180;)n[1]+=360*(n[1]<r[1]?1:-1);var i=Math.sqrt(Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2));if(i>e)for(var a=Math.floor(i/e),o=s(n[0],r[0],a),l=s(n[1],r[1],a),u=s(n[2],r[2],a),c=0,A=o.length;c<A;c++)t.push([o[c],l[c],u[c]])}t.push(n=r)})),t},o=function(e){var t=$_(e,3),n=oy(t[0],t[1],t[2]),r=n.x,i=n.y,s=n.z;return new ix.Vector3(r,i,s)};return a(e.map((function(e){return[t(e),n(e),r(e)]})),i).map(o)}(t(d),n,r,i,e.pathResolution),x=c(d);if(_.__dashAnimateStep=x>0?1e3/x:0,f){_.material.resolution=e.rendererSize;var b=o(d),S=l(d),T=u(d);_.material.dashed=S>0,_.material.dashed?_.material.defines.USE_DASH="":delete _.material.defines.USE_DASH,_.material.dashed&&(_.material.dashScale=1/(v=0,y.forEach((function(e){g&&(v+=g.distanceTo(e)),g=e})),v),_.material.dashSize=b,_.material.gapSize=S,_.material.dashOffset=-T);var w=a(d);if(w instanceof Array){var M=A(a(d),y.length-1,1,!1);_.geometry.setColors(M.array),_.material.vertexColors=!0}else{var E=w,C=fy(E);_.material.color=new ix.Color(py(E)),_.material.transparent=C<1,_.material.opacity=C,_.material.vertexColors=!1}_.material.needsUpdate=!0}else{Object.assign(_.material.uniforms,{dashSize:{value:o(d)},gapSize:{value:l(d)},dashOffset:{value:u(d)}});var R=A(a(d),y.length),N=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[],i=0,s=e+1;i<s;i++)for(var a=i/(s-1),o=0;o<t;o++)r.push(a);return n&&r.reverse(),vy(r,1)}(y.length,1,!0);_.geometry.setAttribute("color",R),_.geometry.setAttribute("relDistance",N)}var P=rx(h.__currentTargetD&&h.__currentTargetD.points||[y[0]],y),D=function(e){var t,n=h.__currentTargetD=e,r=n.stroke,i=n.interpolK,s=h.__currentTargetD.points=P(i);f?(_.geometry.setPositions((t=[]).concat.apply(t,Z_(s.map((function(e){return[e.x,e.y,e.z]}))))),_.material.linewidth=r,_.material.dashed&&_.computeLineDistances()):(_.geometry.setFromPoints(s),_.geometry.computeBoundingSphere())},L={stroke:p,interpolK:1},I=Object.assign({},h.__currentTargetD||L,{interpolK:0});Object.keys(L).some((function(e){return I[e]!==L[e]}))&&(!e.pathTransitionDuration||e.pathTransitionDuration<0?D(L):e.tweenGroup.add(new Rc(I).to(L,e.pathTransitionDuration).easing(Sc.Quadratic.InOut).onUpdate(D).start()))})).digest(e.pathsData)}}),ox=window.THREE?window.THREE:{Euler:Xn,Mesh:ci,MeshLambertMaterial:da,SphereGeometry:ra},lx=xc({props:{tilesData:{default:[]},tileLat:{default:"lat"},tileLng:{default:"lng"},tileAltitude:{default:.01},tileWidth:{default:1},tileHeight:{default:1},tileUseGlobeProjection:{default:!0},tileMaterial:{default:function(){return new ox.MeshLambertMaterial({color:"#ffbb88",opacity:.4,transparent:!0})}},tileCurvatureResolution:{default:5},tilesTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(e,t,n){var r=n.tweenGroup;ry(e),t.scene=e,t.tweenGroup=r,t.dataMapper=new by(e,{objBindAttr:"__threeObjTile"}).onCreateObj((function(){var e=new ox.Mesh;return e.__globeObjType="tile",e}))},update:function(e){var t=Pp(e.tileLat),n=Pp(e.tileLng),r=Pp(e.tileAltitude),i=Pp(e.tileWidth),s=Pp(e.tileHeight),a=Pp(e.tileUseGlobeProjection),o=Pp(e.tileMaterial),l=Pp(e.tileCurvatureResolution);e.dataMapper.onUpdateObj((function(u,c){u.material=o(c);var A=a(c),h=l(c),d=function(e){var t=u.__currentTargetD=e,n=t.lat,r=t.lng,i=t.alt,s=t.width,a=t.height,o=ux(r),l=ux(-n);u.geometry&&u.geometry.dispose(),u.geometry=new ox.SphereGeometry(sy*(1+i),Math.ceil(s/(h||-1)),Math.ceil(a/(h||-1)),ux(90-s/2)+(A?o:0),ux(s),ux(90-a/2)+(A?l:0),ux(a)),A||u.setRotationFromEuler(new ox.Euler(l,o,0,"YXZ"))},p={lat:+t(c),lng:+n(c),alt:+r(c),width:+i(c),height:+s(c)},f=u.__currentTargetD||Object.assign({},p,{width:0,height:0});Object.keys(p).some((function(e){return f[e]!==p[e]}))&&(!e.tilesTransitionDuration||e.tilesTransitionDuration<0?d(p):e.tweenGroup.add(new Rc(f).to(p,e.tilesTransitionDuration).easing(Sc.Quadratic.InOut).onUpdate(d).start()))})).digest(e.tilesData)}}),ux=function(e){return e*Math.PI/180},cx={glyphs:{0:{x_min:73,x_max:715,ha:792,o:"m 394 -29 q 153 129 242 -29 q 73 479 73 272 q 152 829 73 687 q 394 989 241 989 q 634 829 545 989 q 715 479 715 684 q 635 129 715 270 q 394 -29 546 -29 m 394 89 q 546 211 489 89 q 598 479 598 322 q 548 748 598 640 q 394 871 491 871 q 241 748 298 871 q 190 479 190 637 q 239 211 190 319 q 394 89 296 89 "},1:{x_min:215.671875,x_max:574,ha:792,o:"m 574 0 l 442 0 l 442 697 l 215 697 l 215 796 q 386 833 330 796 q 475 986 447 875 l 574 986 l 574 0 "},2:{x_min:59,x_max:731,ha:792,o:"m 731 0 l 59 0 q 197 314 59 188 q 457 487 199 315 q 598 691 598 580 q 543 819 598 772 q 411 867 488 867 q 272 811 328 867 q 209 630 209 747 l 81 630 q 182 901 81 805 q 408 986 271 986 q 629 909 536 986 q 731 694 731 826 q 613 449 731 541 q 378 316 495 383 q 201 122 235 234 l 731 122 l 731 0 "},3:{x_min:54,x_max:737,ha:792,o:"m 737 284 q 635 55 737 141 q 399 -25 541 -25 q 156 52 248 -25 q 54 308 54 140 l 185 308 q 245 147 185 202 q 395 96 302 96 q 539 140 484 96 q 602 280 602 190 q 510 429 602 390 q 324 454 451 454 l 324 565 q 487 584 441 565 q 565 719 565 617 q 515 835 565 791 q 395 879 466 879 q 255 824 307 879 q 203 661 203 769 l 78 661 q 166 909 78 822 q 387 992 250 992 q 603 921 513 992 q 701 723 701 844 q 669 607 701 656 q 578 524 637 558 q 696 434 655 499 q 737 284 737 369 "},4:{x_min:48,x_max:742.453125,ha:792,o:"m 742 243 l 602 243 l 602 0 l 476 0 l 476 243 l 48 243 l 48 368 l 476 958 l 602 958 l 602 354 l 742 354 l 742 243 m 476 354 l 476 792 l 162 354 l 476 354 "},5:{x_min:54.171875,x_max:738,ha:792,o:"m 738 314 q 626 60 738 153 q 382 -23 526 -23 q 155 47 248 -23 q 54 256 54 125 l 183 256 q 259 132 204 174 q 382 91 314 91 q 533 149 471 91 q 602 314 602 213 q 538 469 602 411 q 386 528 475 528 q 284 506 332 528 q 197 439 237 484 l 81 439 l 159 958 l 684 958 l 684 840 l 254 840 l 214 579 q 306 627 258 612 q 407 643 354 643 q 636 552 540 643 q 738 314 738 457 "},6:{x_min:53,x_max:739,ha:792,o:"m 739 312 q 633 62 739 162 q 400 -31 534 -31 q 162 78 257 -31 q 53 439 53 206 q 178 859 53 712 q 441 986 284 986 q 643 912 559 986 q 732 713 732 833 l 601 713 q 544 830 594 786 q 426 875 494 875 q 268 793 331 875 q 193 517 193 697 q 301 597 240 570 q 427 624 362 624 q 643 540 552 624 q 739 312 739 451 m 603 298 q 540 461 603 400 q 404 516 484 516 q 268 461 323 516 q 207 300 207 401 q 269 137 207 198 q 405 83 325 83 q 541 137 486 83 q 603 298 603 197 "},7:{x_min:58.71875,x_max:730.953125,ha:792,o:"m 730 839 q 469 448 560 641 q 335 0 378 255 l 192 0 q 328 441 235 252 q 593 830 421 630 l 58 830 l 58 958 l 730 958 l 730 839 "},8:{x_min:55,x_max:736,ha:792,o:"m 571 527 q 694 424 652 491 q 736 280 736 358 q 648 71 736 158 q 395 -26 551 -26 q 142 69 238 -26 q 55 279 55 157 q 96 425 55 359 q 220 527 138 491 q 120 615 153 562 q 88 726 88 668 q 171 904 88 827 q 395 986 261 986 q 618 905 529 986 q 702 727 702 830 q 670 616 702 667 q 571 527 638 565 m 394 565 q 519 610 475 565 q 563 717 563 655 q 521 823 563 781 q 392 872 474 872 q 265 824 312 872 q 224 720 224 783 q 265 613 224 656 q 394 565 312 565 m 395 91 q 545 150 488 91 q 597 280 597 204 q 546 408 597 355 q 395 465 492 465 q 244 408 299 465 q 194 280 194 356 q 244 150 194 203 q 395 91 299 91 "},9:{x_min:53,x_max:739,ha:792,o:"m 739 524 q 619 94 739 241 q 362 -32 516 -32 q 150 47 242 -32 q 59 244 59 126 l 191 244 q 246 129 191 176 q 373 82 301 82 q 526 161 466 82 q 597 440 597 255 q 363 334 501 334 q 130 432 216 334 q 53 650 53 521 q 134 880 53 786 q 383 986 226 986 q 659 841 566 986 q 739 524 739 719 m 388 449 q 535 514 480 449 q 585 658 585 573 q 535 805 585 744 q 388 873 480 873 q 242 809 294 873 q 191 658 191 745 q 239 514 191 572 q 388 449 292 449 "},"ο":{x_min:0,x_max:712,ha:815,o:"m 356 -25 q 96 88 192 -25 q 0 368 0 201 q 92 642 0 533 q 356 761 192 761 q 617 644 517 761 q 712 368 712 533 q 619 91 712 201 q 356 -25 520 -25 m 356 85 q 527 175 465 85 q 583 369 583 255 q 528 562 583 484 q 356 651 466 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 356 85 250 85 "},S:{x_min:0,x_max:788,ha:890,o:"m 788 291 q 662 54 788 144 q 397 -26 550 -26 q 116 68 226 -26 q 0 337 0 168 l 131 337 q 200 152 131 220 q 384 85 269 85 q 557 129 479 85 q 650 270 650 183 q 490 429 650 379 q 194 513 341 470 q 33 739 33 584 q 142 964 33 881 q 388 1041 242 1041 q 644 957 543 1041 q 756 716 756 867 l 625 716 q 561 874 625 816 q 395 933 497 933 q 243 891 309 933 q 164 759 164 841 q 325 609 164 656 q 625 526 475 568 q 788 291 788 454 "},"¦":{x_min:343,x_max:449,ha:792,o:"m 449 462 l 343 462 l 343 986 l 449 986 l 449 462 m 449 -242 l 343 -242 l 343 280 l 449 280 l 449 -242 "},"/":{x_min:183.25,x_max:608.328125,ha:792,o:"m 608 1041 l 266 -129 l 183 -129 l 520 1041 l 608 1041 "},"Τ":{x_min:-.4375,x_max:777.453125,ha:839,o:"m 777 893 l 458 893 l 458 0 l 319 0 l 319 892 l 0 892 l 0 1013 l 777 1013 l 777 893 "},y:{x_min:0,x_max:684.78125,ha:771,o:"m 684 738 l 388 -83 q 311 -216 356 -167 q 173 -279 252 -279 q 97 -266 133 -279 l 97 -149 q 132 -155 109 -151 q 168 -160 155 -160 q 240 -114 213 -160 q 274 -26 248 -98 l 0 738 l 137 737 l 341 139 l 548 737 l 684 738 "},"Π":{x_min:0,x_max:803,ha:917,o:"m 803 0 l 667 0 l 667 886 l 140 886 l 140 0 l 0 0 l 0 1012 l 803 1012 l 803 0 "},"ΐ":{x_min:-111,x_max:339,ha:361,o:"m 339 800 l 229 800 l 229 925 l 339 925 l 339 800 m -1 800 l -111 800 l -111 925 l -1 925 l -1 800 m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 737 l 167 737 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 103 239 101 q 284 112 257 104 l 284 3 m 302 1040 l 113 819 l 30 819 l 165 1040 l 302 1040 "},g:{x_min:0,x_max:686,ha:838,o:"m 686 34 q 586 -213 686 -121 q 331 -306 487 -306 q 131 -252 216 -306 q 31 -84 31 -190 l 155 -84 q 228 -174 166 -138 q 345 -207 284 -207 q 514 -109 454 -207 q 564 89 564 -27 q 461 6 521 36 q 335 -23 401 -23 q 88 100 184 -23 q 0 370 0 215 q 87 634 0 522 q 330 758 183 758 q 457 728 398 758 q 564 644 515 699 l 564 737 l 686 737 l 686 34 m 582 367 q 529 560 582 481 q 358 652 468 652 q 189 561 250 652 q 135 369 135 482 q 189 176 135 255 q 361 85 251 85 q 529 176 468 85 q 582 367 582 255 "},"²":{x_min:0,x_max:442,ha:539,o:"m 442 383 l 0 383 q 91 566 0 492 q 260 668 176 617 q 354 798 354 727 q 315 875 354 845 q 227 905 277 905 q 136 869 173 905 q 99 761 99 833 l 14 761 q 82 922 14 864 q 232 974 141 974 q 379 926 316 974 q 442 797 442 878 q 351 635 442 704 q 183 539 321 611 q 92 455 92 491 l 442 455 l 442 383 "},"–":{x_min:0,x_max:705.5625,ha:803,o:"m 705 334 l 0 334 l 0 410 l 705 410 l 705 334 "},"Κ":{x_min:0,x_max:819.5625,ha:893,o:"m 819 0 l 650 0 l 294 509 l 139 356 l 139 0 l 0 0 l 0 1013 l 139 1013 l 139 526 l 626 1013 l 809 1013 l 395 600 l 819 0 "},"ƒ":{x_min:-46.265625,x_max:392,ha:513,o:"m 392 651 l 259 651 l 79 -279 l -46 -278 l 134 651 l 14 651 l 14 751 l 135 751 q 151 948 135 900 q 304 1041 185 1041 q 334 1040 319 1041 q 392 1034 348 1039 l 392 922 q 337 931 360 931 q 271 883 287 931 q 260 793 260 853 l 260 751 l 392 751 l 392 651 "},e:{x_min:0,x_max:714,ha:813,o:"m 714 326 l 140 326 q 200 157 140 227 q 359 87 260 87 q 488 130 431 87 q 561 245 545 174 l 697 245 q 577 48 670 123 q 358 -26 484 -26 q 97 85 195 -26 q 0 363 0 197 q 94 642 0 529 q 358 765 195 765 q 626 627 529 765 q 714 326 714 503 m 576 429 q 507 583 564 522 q 355 650 445 650 q 206 583 266 650 q 140 429 152 522 l 576 429 "},"ό":{x_min:0,x_max:712,ha:815,o:"m 356 -25 q 94 91 194 -25 q 0 368 0 202 q 92 642 0 533 q 356 761 192 761 q 617 644 517 761 q 712 368 712 533 q 619 91 712 201 q 356 -25 520 -25 m 356 85 q 527 175 465 85 q 583 369 583 255 q 528 562 583 484 q 356 651 466 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 356 85 250 85 m 576 1040 l 387 819 l 303 819 l 438 1040 l 576 1040 "},J:{x_min:0,x_max:588,ha:699,o:"m 588 279 q 287 -26 588 -26 q 58 73 126 -26 q 0 327 0 158 l 133 327 q 160 172 133 227 q 288 96 198 96 q 426 171 391 96 q 449 336 449 219 l 449 1013 l 588 1013 l 588 279 "},"»":{x_min:-1,x_max:503,ha:601,o:"m 503 302 l 280 136 l 281 256 l 429 373 l 281 486 l 280 608 l 503 440 l 503 302 m 221 302 l 0 136 l 0 255 l 145 372 l 0 486 l -1 608 l 221 440 l 221 302 "},"©":{x_min:-3,x_max:1008,ha:1106,o:"m 502 -7 q 123 151 263 -7 q -3 501 -3 294 q 123 851 -3 706 q 502 1011 263 1011 q 881 851 739 1011 q 1008 501 1008 708 q 883 151 1008 292 q 502 -7 744 -7 m 502 60 q 830 197 709 60 q 940 501 940 322 q 831 805 940 681 q 502 944 709 944 q 174 805 296 944 q 65 501 65 680 q 173 197 65 320 q 502 60 294 60 m 741 394 q 661 246 731 302 q 496 190 591 190 q 294 285 369 190 q 228 497 228 370 q 295 714 228 625 q 499 813 370 813 q 656 762 588 813 q 733 625 724 711 l 634 625 q 589 704 629 673 q 498 735 550 735 q 377 666 421 735 q 334 504 334 597 q 374 340 334 408 q 490 272 415 272 q 589 304 549 272 q 638 394 628 337 l 741 394 "},"ώ":{x_min:0,x_max:922,ha:1030,o:"m 687 1040 l 498 819 l 415 819 l 549 1040 l 687 1040 m 922 339 q 856 97 922 203 q 650 -26 780 -26 q 538 9 587 -26 q 461 103 489 44 q 387 12 436 46 q 277 -22 339 -22 q 69 97 147 -22 q 0 338 0 202 q 45 551 0 444 q 161 737 84 643 l 302 737 q 175 552 219 647 q 124 336 124 446 q 155 179 124 248 q 275 88 197 88 q 375 163 341 88 q 400 294 400 219 l 400 572 l 524 572 l 524 294 q 561 135 524 192 q 643 88 591 88 q 762 182 719 88 q 797 341 797 257 q 745 555 797 450 q 619 737 705 637 l 760 737 q 874 551 835 640 q 922 339 922 444 "},"^":{x_min:193.0625,x_max:598.609375,ha:792,o:"m 598 772 l 515 772 l 395 931 l 277 772 l 193 772 l 326 1013 l 462 1013 l 598 772 "},"«":{x_min:0,x_max:507.203125,ha:604,o:"m 506 136 l 284 302 l 284 440 l 506 608 l 507 485 l 360 371 l 506 255 l 506 136 m 222 136 l 0 302 l 0 440 l 222 608 l 221 486 l 73 373 l 222 256 l 222 136 "},D:{x_min:0,x_max:828,ha:935,o:"m 389 1013 q 714 867 593 1013 q 828 521 828 729 q 712 161 828 309 q 382 0 587 0 l 0 0 l 0 1013 l 389 1013 m 376 124 q 607 247 523 124 q 681 510 681 355 q 607 771 681 662 q 376 896 522 896 l 139 896 l 139 124 l 376 124 "},"∙":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 "},"ÿ":{x_min:0,x_max:47,ha:125,o:"m 47 3 q 37 -7 47 -7 q 28 0 30 -7 q 39 -4 32 -4 q 45 3 45 -1 l 37 0 q 28 9 28 0 q 39 19 28 19 l 47 16 l 47 19 l 47 3 m 37 1 q 44 8 44 1 q 37 16 44 16 q 30 8 30 16 q 37 1 30 1 m 26 1 l 23 22 l 14 0 l 3 22 l 3 3 l 0 25 l 13 1 l 22 25 l 26 1 "},w:{x_min:0,x_max:1009.71875,ha:1100,o:"m 1009 738 l 783 0 l 658 0 l 501 567 l 345 0 l 222 0 l 0 738 l 130 738 l 284 174 l 432 737 l 576 738 l 721 173 l 881 737 l 1009 738 "},$:{x_min:0,x_max:700,ha:793,o:"m 664 717 l 542 717 q 490 825 531 785 q 381 872 450 865 l 381 551 q 620 446 540 522 q 700 241 700 370 q 618 45 700 116 q 381 -25 536 -25 l 381 -152 l 307 -152 l 307 -25 q 81 62 162 -25 q 0 297 0 149 l 124 297 q 169 146 124 204 q 307 81 215 89 l 307 441 q 80 536 148 469 q 13 725 13 603 q 96 910 13 839 q 307 982 180 982 l 307 1077 l 381 1077 l 381 982 q 574 917 494 982 q 664 717 664 845 m 307 565 l 307 872 q 187 831 233 872 q 142 724 142 791 q 180 618 142 656 q 307 565 218 580 m 381 76 q 562 237 562 96 q 517 361 562 313 q 381 423 472 409 l 381 76 "},"\\":{x_min:-.015625,x_max:425.0625,ha:522,o:"m 425 -129 l 337 -129 l 0 1041 l 83 1041 l 425 -129 "},"µ":{x_min:0,x_max:697.21875,ha:747,o:"m 697 -4 q 629 -14 658 -14 q 498 97 513 -14 q 422 9 470 41 q 313 -23 374 -23 q 207 4 258 -23 q 119 81 156 32 l 119 -278 l 0 -278 l 0 738 l 124 738 l 124 343 q 165 173 124 246 q 308 83 216 83 q 452 178 402 83 q 493 359 493 255 l 493 738 l 617 738 l 617 214 q 623 136 617 160 q 673 92 637 92 q 697 96 684 92 l 697 -4 "},"Ι":{x_min:42,x_max:181,ha:297,o:"m 181 0 l 42 0 l 42 1013 l 181 1013 l 181 0 "},"Ύ":{x_min:0,x_max:1144.5,ha:1214,o:"m 1144 1012 l 807 416 l 807 0 l 667 0 l 667 416 l 325 1012 l 465 1012 l 736 533 l 1004 1012 l 1144 1012 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"’":{x_min:0,x_max:139,ha:236,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 "},"Ν":{x_min:0,x_max:801,ha:915,o:"m 801 0 l 651 0 l 131 822 l 131 0 l 0 0 l 0 1013 l 151 1013 l 670 191 l 670 1013 l 801 1013 l 801 0 "},"-":{x_min:8.71875,x_max:350.390625,ha:478,o:"m 350 317 l 8 317 l 8 428 l 350 428 l 350 317 "},Q:{x_min:0,x_max:968,ha:1072,o:"m 954 5 l 887 -79 l 744 35 q 622 -11 687 2 q 483 -26 556 -26 q 127 130 262 -26 q 0 504 0 279 q 127 880 0 728 q 484 1041 262 1041 q 841 884 708 1041 q 968 507 968 735 q 933 293 968 398 q 832 104 899 188 l 954 5 m 723 191 q 802 330 777 248 q 828 499 828 412 q 744 790 828 673 q 483 922 650 922 q 228 791 322 922 q 142 505 142 673 q 227 221 142 337 q 487 91 323 91 q 632 123 566 91 l 520 215 l 587 301 l 723 191 "},"ς":{x_min:1,x_max:676.28125,ha:740,o:"m 676 460 l 551 460 q 498 595 542 546 q 365 651 448 651 q 199 578 263 651 q 136 401 136 505 q 266 178 136 241 q 508 106 387 142 q 640 -50 640 62 q 625 -158 640 -105 q 583 -278 611 -211 l 465 -278 q 498 -182 490 -211 q 515 -80 515 -126 q 381 12 515 -15 q 134 91 197 51 q 1 388 1 179 q 100 651 1 542 q 354 761 199 761 q 587 680 498 761 q 676 460 676 599 "},M:{x_min:0,x_max:954,ha:1067,o:"m 954 0 l 819 0 l 819 869 l 537 0 l 405 0 l 128 866 l 128 0 l 0 0 l 0 1013 l 200 1013 l 472 160 l 757 1013 l 954 1013 l 954 0 "},"Ψ":{x_min:0,x_max:1006,ha:1094,o:"m 1006 678 q 914 319 1006 429 q 571 200 814 200 l 571 0 l 433 0 l 433 200 q 92 319 194 200 q 0 678 0 429 l 0 1013 l 139 1013 l 139 679 q 191 417 139 492 q 433 326 255 326 l 433 1013 l 571 1013 l 571 326 l 580 326 q 813 423 747 326 q 868 679 868 502 l 868 1013 l 1006 1013 l 1006 678 "},C:{x_min:0,x_max:886,ha:944,o:"m 886 379 q 760 87 886 201 q 455 -26 634 -26 q 112 136 236 -26 q 0 509 0 283 q 118 882 0 737 q 469 1041 245 1041 q 748 955 630 1041 q 879 708 879 859 l 745 708 q 649 862 724 805 q 473 920 573 920 q 219 791 312 920 q 136 509 136 675 q 217 229 136 344 q 470 99 311 99 q 672 179 591 99 q 753 379 753 259 l 886 379 "},"!":{x_min:0,x_max:138,ha:236,o:"m 138 684 q 116 409 138 629 q 105 244 105 299 l 33 244 q 16 465 33 313 q 0 684 0 616 l 0 1013 l 138 1013 l 138 684 m 138 0 l 0 0 l 0 151 l 138 151 l 138 0 "},"{":{x_min:0,x_max:480.5625,ha:578,o:"m 480 -286 q 237 -213 303 -286 q 187 -45 187 -159 q 194 48 187 -15 q 201 141 201 112 q 164 264 201 225 q 0 314 118 314 l 0 417 q 164 471 119 417 q 201 605 201 514 q 199 665 201 644 q 193 772 193 769 q 241 941 193 887 q 480 1015 308 1015 l 480 915 q 336 866 375 915 q 306 742 306 828 q 310 662 306 717 q 314 577 314 606 q 288 452 314 500 q 176 365 256 391 q 289 275 257 337 q 314 143 314 226 q 313 84 314 107 q 310 -11 310 -5 q 339 -131 310 -94 q 480 -182 377 -182 l 480 -286 "},X:{x_min:-.015625,x_max:854.15625,ha:940,o:"m 854 0 l 683 0 l 423 409 l 166 0 l 0 0 l 347 519 l 18 1013 l 186 1013 l 428 637 l 675 1013 l 836 1013 l 504 520 l 854 0 "},"#":{x_min:0,x_max:963.890625,ha:1061,o:"m 963 690 l 927 590 l 719 590 l 655 410 l 876 410 l 840 310 l 618 310 l 508 -3 l 393 -2 l 506 309 l 329 310 l 215 -2 l 102 -3 l 212 310 l 0 310 l 36 410 l 248 409 l 312 590 l 86 590 l 120 690 l 347 690 l 459 1006 l 573 1006 l 462 690 l 640 690 l 751 1006 l 865 1006 l 754 690 l 963 690 m 606 590 l 425 590 l 362 410 l 543 410 l 606 590 "},"ι":{x_min:42,x_max:284,ha:361,o:"m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 738 l 167 738 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 103 239 101 q 284 112 257 104 l 284 3 "},"Ά":{x_min:0,x_max:906.953125,ha:982,o:"m 283 1040 l 88 799 l 5 799 l 145 1040 l 283 1040 m 906 0 l 756 0 l 650 303 l 251 303 l 143 0 l 0 0 l 376 1012 l 529 1012 l 906 0 m 609 421 l 452 866 l 293 421 l 609 421 "},")":{x_min:0,x_max:318,ha:415,o:"m 318 365 q 257 25 318 191 q 87 -290 197 -141 l 0 -290 q 140 21 93 -128 q 193 360 193 189 q 141 704 193 537 q 0 1024 97 850 l 87 1024 q 257 706 197 871 q 318 365 318 542 "},"ε":{x_min:0,x_max:634.71875,ha:714,o:"m 634 234 q 527 38 634 110 q 300 -25 433 -25 q 98 29 183 -25 q 0 204 0 93 q 37 314 0 265 q 128 390 67 353 q 56 460 82 419 q 26 555 26 505 q 114 712 26 654 q 295 763 191 763 q 499 700 416 763 q 589 515 589 631 l 478 515 q 419 618 464 580 q 307 657 374 657 q 207 630 253 657 q 151 547 151 598 q 238 445 151 469 q 389 434 280 434 l 389 331 l 349 331 q 206 315 255 331 q 125 210 125 287 q 183 107 125 145 q 302 76 233 76 q 436 117 379 76 q 509 234 493 159 l 634 234 "},"Δ":{x_min:0,x_max:952.78125,ha:1028,o:"m 952 0 l 0 0 l 400 1013 l 551 1013 l 952 0 m 762 124 l 476 867 l 187 124 l 762 124 "},"}":{x_min:0,x_max:481,ha:578,o:"m 481 314 q 318 262 364 314 q 282 136 282 222 q 284 65 282 97 q 293 -58 293 -48 q 241 -217 293 -166 q 0 -286 174 -286 l 0 -182 q 143 -130 105 -182 q 171 -2 171 -93 q 168 81 171 22 q 165 144 165 140 q 188 275 165 229 q 306 365 220 339 q 191 455 224 391 q 165 588 165 505 q 168 681 165 624 q 171 742 171 737 q 141 865 171 827 q 0 915 102 915 l 0 1015 q 243 942 176 1015 q 293 773 293 888 q 287 675 293 741 q 282 590 282 608 q 318 466 282 505 q 481 417 364 417 l 481 314 "},"‰":{x_min:-3,x_max:1672,ha:1821,o:"m 846 0 q 664 76 732 0 q 603 244 603 145 q 662 412 603 344 q 846 489 729 489 q 1027 412 959 489 q 1089 244 1089 343 q 1029 76 1089 144 q 846 0 962 0 m 845 103 q 945 143 910 103 q 981 243 981 184 q 947 340 981 301 q 845 385 910 385 q 745 342 782 385 q 709 243 709 300 q 742 147 709 186 q 845 103 781 103 m 888 986 l 284 -25 l 199 -25 l 803 986 l 888 986 m 241 468 q 58 545 126 468 q -3 715 -3 615 q 56 881 -3 813 q 238 958 124 958 q 421 881 353 958 q 483 712 483 813 q 423 544 483 612 q 241 468 356 468 m 241 855 q 137 811 175 855 q 100 710 100 768 q 136 612 100 653 q 240 572 172 572 q 344 614 306 572 q 382 713 382 656 q 347 810 382 771 q 241 855 308 855 m 1428 0 q 1246 76 1314 0 q 1185 244 1185 145 q 1244 412 1185 344 q 1428 489 1311 489 q 1610 412 1542 489 q 1672 244 1672 343 q 1612 76 1672 144 q 1428 0 1545 0 m 1427 103 q 1528 143 1492 103 q 1564 243 1564 184 q 1530 340 1564 301 q 1427 385 1492 385 q 1327 342 1364 385 q 1291 243 1291 300 q 1324 147 1291 186 q 1427 103 1363 103 "},a:{x_min:0,x_max:698.609375,ha:794,o:"m 698 0 q 661 -12 679 -7 q 615 -17 643 -17 q 536 12 564 -17 q 500 96 508 41 q 384 6 456 37 q 236 -25 312 -25 q 65 31 130 -25 q 0 194 0 88 q 118 390 0 334 q 328 435 180 420 q 488 483 476 451 q 495 523 495 504 q 442 619 495 584 q 325 654 389 654 q 209 617 257 654 q 152 513 161 580 l 33 513 q 123 705 33 633 q 332 772 207 772 q 528 712 448 772 q 617 531 617 645 l 617 163 q 624 108 617 126 q 664 90 632 90 l 698 94 l 698 0 m 491 262 l 491 372 q 272 329 350 347 q 128 201 128 294 q 166 113 128 144 q 264 83 205 83 q 414 130 346 83 q 491 262 491 183 "},"—":{x_min:0,x_max:941.671875,ha:1039,o:"m 941 334 l 0 334 l 0 410 l 941 410 l 941 334 "},"=":{x_min:8.71875,x_max:780.953125,ha:792,o:"m 780 510 l 8 510 l 8 606 l 780 606 l 780 510 m 780 235 l 8 235 l 8 332 l 780 332 l 780 235 "},N:{x_min:0,x_max:801,ha:914,o:"m 801 0 l 651 0 l 131 823 l 131 0 l 0 0 l 0 1013 l 151 1013 l 670 193 l 670 1013 l 801 1013 l 801 0 "},"ρ":{x_min:0,x_max:712,ha:797,o:"m 712 369 q 620 94 712 207 q 362 -26 521 -26 q 230 2 292 -26 q 119 83 167 30 l 119 -278 l 0 -278 l 0 362 q 91 643 0 531 q 355 764 190 764 q 617 647 517 764 q 712 369 712 536 m 583 366 q 530 559 583 480 q 359 651 469 651 q 190 562 252 651 q 135 370 135 483 q 189 176 135 257 q 359 85 250 85 q 528 175 466 85 q 583 366 583 254 "},"¯":{x_min:0,x_max:941.671875,ha:938,o:"m 941 1033 l 0 1033 l 0 1109 l 941 1109 l 941 1033 "},Z:{x_min:0,x_max:779,ha:849,o:"m 779 0 l 0 0 l 0 113 l 621 896 l 40 896 l 40 1013 l 779 1013 l 778 887 l 171 124 l 779 124 l 779 0 "},u:{x_min:0,x_max:617,ha:729,o:"m 617 0 l 499 0 l 499 110 q 391 10 460 45 q 246 -25 322 -25 q 61 58 127 -25 q 0 258 0 136 l 0 738 l 125 738 l 125 284 q 156 148 125 202 q 273 82 197 82 q 433 165 369 82 q 493 340 493 243 l 493 738 l 617 738 l 617 0 "},k:{x_min:0,x_max:612.484375,ha:697,o:"m 612 738 l 338 465 l 608 0 l 469 0 l 251 382 l 121 251 l 121 0 l 0 0 l 0 1013 l 121 1013 l 121 402 l 456 738 l 612 738 "},"Η":{x_min:0,x_max:803,ha:917,o:"m 803 0 l 667 0 l 667 475 l 140 475 l 140 0 l 0 0 l 0 1013 l 140 1013 l 140 599 l 667 599 l 667 1013 l 803 1013 l 803 0 "},"Α":{x_min:0,x_max:906.953125,ha:985,o:"m 906 0 l 756 0 l 650 303 l 251 303 l 143 0 l 0 0 l 376 1013 l 529 1013 l 906 0 m 609 421 l 452 866 l 293 421 l 609 421 "},s:{x_min:0,x_max:604,ha:697,o:"m 604 217 q 501 36 604 104 q 292 -23 411 -23 q 86 43 166 -23 q 0 238 0 114 l 121 237 q 175 122 121 164 q 300 85 223 85 q 415 112 363 85 q 479 207 479 147 q 361 309 479 276 q 140 372 141 370 q 21 544 21 426 q 111 708 21 647 q 298 761 190 761 q 492 705 413 761 q 583 531 583 643 l 462 531 q 412 625 462 594 q 298 657 363 657 q 199 636 242 657 q 143 558 143 608 q 262 454 143 486 q 484 394 479 397 q 604 217 604 341 "},B:{x_min:0,x_max:778,ha:876,o:"m 580 546 q 724 469 670 535 q 778 311 778 403 q 673 83 778 171 q 432 0 575 0 l 0 0 l 0 1013 l 411 1013 q 629 957 541 1013 q 732 768 732 892 q 691 633 732 693 q 580 546 650 572 m 393 899 l 139 899 l 139 588 l 379 588 q 521 624 462 588 q 592 744 592 667 q 531 859 592 819 q 393 899 471 899 m 419 124 q 566 169 504 124 q 635 303 635 219 q 559 436 635 389 q 402 477 494 477 l 139 477 l 139 124 l 419 124 "},"…":{x_min:0,x_max:614,ha:708,o:"m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 m 378 0 l 236 0 l 236 151 l 378 151 l 378 0 m 614 0 l 472 0 l 472 151 l 614 151 l 614 0 "},"?":{x_min:0,x_max:607,ha:704,o:"m 607 777 q 543 599 607 674 q 422 474 482 537 q 357 272 357 391 l 236 272 q 297 487 236 395 q 411 619 298 490 q 474 762 474 691 q 422 885 474 838 q 301 933 371 933 q 179 880 228 933 q 124 706 124 819 l 0 706 q 94 963 0 872 q 302 1044 177 1044 q 511 973 423 1044 q 607 777 607 895 m 370 0 l 230 0 l 230 151 l 370 151 l 370 0 "},H:{x_min:0,x_max:803,ha:915,o:"m 803 0 l 667 0 l 667 475 l 140 475 l 140 0 l 0 0 l 0 1013 l 140 1013 l 140 599 l 667 599 l 667 1013 l 803 1013 l 803 0 "},"ν":{x_min:0,x_max:675,ha:761,o:"m 675 738 l 404 0 l 272 0 l 0 738 l 133 738 l 340 147 l 541 738 l 675 738 "},c:{x_min:1,x_max:701.390625,ha:775,o:"m 701 264 q 584 53 681 133 q 353 -26 487 -26 q 91 91 188 -26 q 1 370 1 201 q 92 645 1 537 q 353 761 190 761 q 572 688 479 761 q 690 493 666 615 l 556 493 q 487 606 545 562 q 356 650 428 650 q 186 563 246 650 q 134 372 134 487 q 188 179 134 258 q 359 88 250 88 q 492 136 437 88 q 566 264 548 185 l 701 264 "},"¶":{x_min:0,x_max:566.671875,ha:678,o:"m 21 892 l 52 892 l 98 761 l 145 892 l 176 892 l 178 741 l 157 741 l 157 867 l 108 741 l 88 741 l 40 871 l 40 741 l 21 741 l 21 892 m 308 854 l 308 731 q 252 691 308 691 q 227 691 240 691 q 207 696 213 695 l 207 712 l 253 706 q 288 733 288 706 l 288 763 q 244 741 279 741 q 193 797 193 741 q 261 860 193 860 q 287 860 273 860 q 308 854 302 855 m 288 842 l 263 843 q 213 796 213 843 q 248 756 213 756 q 288 796 288 756 l 288 842 m 566 988 l 502 988 l 502 -1 l 439 -1 l 439 988 l 317 988 l 317 -1 l 252 -1 l 252 602 q 81 653 155 602 q 0 805 0 711 q 101 989 0 918 q 309 1053 194 1053 l 566 1053 l 566 988 "},"β":{x_min:0,x_max:660,ha:745,o:"m 471 550 q 610 450 561 522 q 660 280 660 378 q 578 64 660 151 q 367 -22 497 -22 q 239 5 299 -22 q 126 82 178 32 l 126 -278 l 0 -278 l 0 593 q 54 903 0 801 q 318 1042 127 1042 q 519 964 436 1042 q 603 771 603 887 q 567 644 603 701 q 471 550 532 586 m 337 79 q 476 138 418 79 q 535 279 535 198 q 427 437 535 386 q 226 477 344 477 l 226 583 q 398 620 329 583 q 486 762 486 668 q 435 884 486 833 q 312 935 384 935 q 169 861 219 935 q 126 698 126 797 l 126 362 q 170 169 126 242 q 337 79 224 79 "},"Μ":{x_min:0,x_max:954,ha:1068,o:"m 954 0 l 819 0 l 819 868 l 537 0 l 405 0 l 128 865 l 128 0 l 0 0 l 0 1013 l 199 1013 l 472 158 l 758 1013 l 954 1013 l 954 0 "},"Ό":{x_min:.109375,x_max:1120,ha:1217,o:"m 1120 505 q 994 132 1120 282 q 642 -29 861 -29 q 290 130 422 -29 q 167 505 167 280 q 294 883 167 730 q 650 1046 430 1046 q 999 882 868 1046 q 1120 505 1120 730 m 977 504 q 896 784 977 669 q 644 915 804 915 q 391 785 484 915 q 307 504 307 669 q 391 224 307 339 q 644 95 486 95 q 894 224 803 95 q 977 504 977 339 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"Ή":{x_min:0,x_max:1158,ha:1275,o:"m 1158 0 l 1022 0 l 1022 475 l 496 475 l 496 0 l 356 0 l 356 1012 l 496 1012 l 496 599 l 1022 599 l 1022 1012 l 1158 1012 l 1158 0 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"•":{x_min:0,x_max:663.890625,ha:775,o:"m 663 529 q 566 293 663 391 q 331 196 469 196 q 97 294 194 196 q 0 529 0 393 q 96 763 0 665 q 331 861 193 861 q 566 763 469 861 q 663 529 663 665 "},"¥":{x_min:.1875,x_max:819.546875,ha:886,o:"m 563 561 l 697 561 l 696 487 l 520 487 l 482 416 l 482 380 l 697 380 l 695 308 l 482 308 l 482 0 l 342 0 l 342 308 l 125 308 l 125 380 l 342 380 l 342 417 l 303 487 l 125 487 l 125 561 l 258 561 l 0 1013 l 140 1013 l 411 533 l 679 1013 l 819 1013 l 563 561 "},"(":{x_min:0,x_max:318.0625,ha:415,o:"m 318 -290 l 230 -290 q 61 23 122 -142 q 0 365 0 190 q 62 712 0 540 q 230 1024 119 869 l 318 1024 q 175 705 219 853 q 125 360 125 542 q 176 22 125 187 q 318 -290 223 -127 "},U:{x_min:0,x_max:796,ha:904,o:"m 796 393 q 681 93 796 212 q 386 -25 566 -25 q 101 95 208 -25 q 0 393 0 211 l 0 1013 l 138 1013 l 138 391 q 204 191 138 270 q 394 107 276 107 q 586 191 512 107 q 656 391 656 270 l 656 1013 l 796 1013 l 796 393 "},"γ":{x_min:.5,x_max:744.953125,ha:822,o:"m 744 737 l 463 54 l 463 -278 l 338 -278 l 338 54 l 154 495 q 104 597 124 569 q 13 651 67 651 l 0 651 l 0 751 l 39 753 q 168 711 121 753 q 242 594 207 676 l 403 208 l 617 737 l 744 737 "},"α":{x_min:0,x_max:765.5625,ha:809,o:"m 765 -4 q 698 -14 726 -14 q 564 97 586 -14 q 466 7 525 40 q 337 -26 407 -26 q 88 98 186 -26 q 0 369 0 212 q 88 637 0 525 q 337 760 184 760 q 465 728 407 760 q 563 637 524 696 l 563 739 l 685 739 l 685 222 q 693 141 685 168 q 748 94 708 94 q 765 96 760 94 l 765 -4 m 584 371 q 531 562 584 485 q 360 653 470 653 q 192 566 254 653 q 135 379 135 489 q 186 181 135 261 q 358 84 247 84 q 528 176 465 84 q 584 371 584 260 "},F:{x_min:0,x_max:683.328125,ha:717,o:"m 683 888 l 140 888 l 140 583 l 613 583 l 613 458 l 140 458 l 140 0 l 0 0 l 0 1013 l 683 1013 l 683 888 "},"":{x_min:0,x_max:705.5625,ha:803,o:"m 705 334 l 0 334 l 0 410 l 705 410 l 705 334 "},":":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 "},"Χ":{x_min:0,x_max:854.171875,ha:935,o:"m 854 0 l 683 0 l 423 409 l 166 0 l 0 0 l 347 519 l 18 1013 l 186 1013 l 427 637 l 675 1013 l 836 1013 l 504 521 l 854 0 "},"*":{x_min:116,x_max:674,ha:792,o:"m 674 768 l 475 713 l 610 544 l 517 477 l 394 652 l 272 478 l 178 544 l 314 713 l 116 766 l 153 876 l 341 812 l 342 1013 l 446 1013 l 446 811 l 635 874 l 674 768 "},"†":{x_min:0,x_max:777,ha:835,o:"m 458 804 l 777 804 l 777 683 l 458 683 l 458 0 l 319 0 l 319 681 l 0 683 l 0 804 l 319 804 l 319 1015 l 458 1013 l 458 804 "},"°":{x_min:0,x_max:347,ha:444,o:"m 173 802 q 43 856 91 802 q 0 977 0 905 q 45 1101 0 1049 q 173 1153 90 1153 q 303 1098 255 1153 q 347 977 347 1049 q 303 856 347 905 q 173 802 256 802 m 173 884 q 238 910 214 884 q 262 973 262 937 q 239 1038 262 1012 q 173 1064 217 1064 q 108 1037 132 1064 q 85 973 85 1010 q 108 910 85 937 q 173 884 132 884 "},V:{x_min:0,x_max:862.71875,ha:940,o:"m 862 1013 l 505 0 l 361 0 l 0 1013 l 143 1013 l 434 165 l 718 1012 l 862 1013 "},"Ξ":{x_min:0,x_max:734.71875,ha:763,o:"m 723 889 l 9 889 l 9 1013 l 723 1013 l 723 889 m 673 463 l 61 463 l 61 589 l 673 589 l 673 463 m 734 0 l 0 0 l 0 124 l 734 124 l 734 0 "}," ":{x_min:0,x_max:0,ha:853},"Ϋ":{x_min:.328125,x_max:819.515625,ha:889,o:"m 588 1046 l 460 1046 l 460 1189 l 588 1189 l 588 1046 m 360 1046 l 232 1046 l 232 1189 l 360 1189 l 360 1046 m 819 1012 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1012 l 140 1012 l 411 533 l 679 1012 l 819 1012 "},"”":{x_min:0,x_max:347,ha:454,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 m 347 851 q 310 737 347 784 q 208 669 273 690 l 208 734 q 267 787 250 741 q 280 873 280 821 l 208 873 l 208 1013 l 347 1013 l 347 851 "},"@":{x_min:0,x_max:1260,ha:1357,o:"m 1098 -45 q 877 -160 1001 -117 q 633 -203 752 -203 q 155 -29 327 -203 q 0 360 0 127 q 176 802 0 616 q 687 1008 372 1008 q 1123 854 969 1008 q 1260 517 1260 718 q 1155 216 1260 341 q 868 82 1044 82 q 772 106 801 82 q 737 202 737 135 q 647 113 700 144 q 527 82 594 82 q 367 147 420 82 q 314 312 314 212 q 401 565 314 452 q 639 690 498 690 q 810 588 760 690 l 849 668 l 938 668 q 877 441 900 532 q 833 226 833 268 q 853 182 833 198 q 902 167 873 167 q 1088 272 1012 167 q 1159 512 1159 372 q 1051 793 1159 681 q 687 925 925 925 q 248 747 415 925 q 97 361 97 586 q 226 26 97 159 q 627 -122 370 -122 q 856 -87 737 -122 q 1061 8 976 -53 l 1098 -45 m 786 488 q 738 580 777 545 q 643 615 700 615 q 483 517 548 615 q 425 322 425 430 q 457 203 425 250 q 552 156 490 156 q 722 273 665 156 q 786 488 738 309 "},"Ί":{x_min:0,x_max:499,ha:613,o:"m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 m 499 0 l 360 0 l 360 1012 l 499 1012 l 499 0 "},i:{x_min:14,x_max:136,ha:275,o:"m 136 873 l 14 873 l 14 1013 l 136 1013 l 136 873 m 136 0 l 14 0 l 14 737 l 136 737 l 136 0 "},"Β":{x_min:0,x_max:778,ha:877,o:"m 580 545 q 724 468 671 534 q 778 310 778 402 q 673 83 778 170 q 432 0 575 0 l 0 0 l 0 1013 l 411 1013 q 629 957 541 1013 q 732 768 732 891 q 691 632 732 692 q 580 545 650 571 m 393 899 l 139 899 l 139 587 l 379 587 q 521 623 462 587 q 592 744 592 666 q 531 859 592 819 q 393 899 471 899 m 419 124 q 566 169 504 124 q 635 302 635 219 q 559 435 635 388 q 402 476 494 476 l 139 476 l 139 124 l 419 124 "},"υ":{x_min:0,x_max:617,ha:725,o:"m 617 352 q 540 94 617 199 q 308 -24 455 -24 q 76 94 161 -24 q 0 352 0 199 l 0 739 l 126 739 l 126 355 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 355 492 257 l 492 739 l 617 739 l 617 352 "},"]":{x_min:0,x_max:275,ha:372,o:"m 275 -281 l 0 -281 l 0 -187 l 151 -187 l 151 920 l 0 920 l 0 1013 l 275 1013 l 275 -281 "},m:{x_min:0,x_max:1019,ha:1128,o:"m 1019 0 l 897 0 l 897 454 q 860 591 897 536 q 739 660 816 660 q 613 586 659 660 q 573 436 573 522 l 573 0 l 447 0 l 447 455 q 412 591 447 535 q 294 657 372 657 q 165 586 213 657 q 122 437 122 521 l 122 0 l 0 0 l 0 738 l 117 738 l 117 640 q 202 730 150 697 q 316 763 254 763 q 437 730 381 763 q 525 642 494 697 q 621 731 559 700 q 753 763 682 763 q 943 694 867 763 q 1019 512 1019 625 l 1019 0 "},"χ":{x_min:8.328125,x_max:780.5625,ha:815,o:"m 780 -278 q 715 -294 747 -294 q 616 -257 663 -294 q 548 -175 576 -227 l 379 133 l 143 -277 l 9 -277 l 313 254 l 163 522 q 127 586 131 580 q 36 640 91 640 q 8 637 27 640 l 8 752 l 52 757 q 162 719 113 757 q 236 627 200 690 l 383 372 l 594 737 l 726 737 l 448 250 l 625 -69 q 670 -153 647 -110 q 743 -188 695 -188 q 780 -184 759 -188 l 780 -278 "},"ί":{x_min:42,x_max:326.71875,ha:361,o:"m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 737 l 167 737 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 102 239 101 q 284 112 257 104 l 284 3 m 326 1040 l 137 819 l 54 819 l 189 1040 l 326 1040 "},"Ζ":{x_min:0,x_max:779.171875,ha:850,o:"m 779 0 l 0 0 l 0 113 l 620 896 l 40 896 l 40 1013 l 779 1013 l 779 887 l 170 124 l 779 124 l 779 0 "},R:{x_min:0,x_max:781.953125,ha:907,o:"m 781 0 l 623 0 q 587 242 590 52 q 407 433 585 433 l 138 433 l 138 0 l 0 0 l 0 1013 l 396 1013 q 636 946 539 1013 q 749 731 749 868 q 711 597 749 659 q 608 502 674 534 q 718 370 696 474 q 729 207 722 352 q 781 26 736 62 l 781 0 m 373 551 q 533 594 465 551 q 614 731 614 645 q 532 859 614 815 q 373 896 465 896 l 138 896 l 138 551 l 373 551 "},o:{x_min:0,x_max:713,ha:821,o:"m 357 -25 q 94 91 194 -25 q 0 368 0 202 q 93 642 0 533 q 357 761 193 761 q 618 644 518 761 q 713 368 713 533 q 619 91 713 201 q 357 -25 521 -25 m 357 85 q 528 175 465 85 q 584 369 584 255 q 529 562 584 484 q 357 651 467 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 357 85 250 85 "},K:{x_min:0,x_max:819.46875,ha:906,o:"m 819 0 l 649 0 l 294 509 l 139 355 l 139 0 l 0 0 l 0 1013 l 139 1013 l 139 526 l 626 1013 l 809 1013 l 395 600 l 819 0 "},",":{x_min:0,x_max:142,ha:239,o:"m 142 -12 q 105 -132 142 -82 q 0 -205 68 -182 l 0 -138 q 57 -82 40 -124 q 70 0 70 -51 l 0 0 l 0 151 l 142 151 l 142 -12 "},d:{x_min:0,x_max:683,ha:796,o:"m 683 0 l 564 0 l 564 93 q 456 6 516 38 q 327 -25 395 -25 q 87 100 181 -25 q 0 365 0 215 q 90 639 0 525 q 343 763 187 763 q 564 647 486 763 l 564 1013 l 683 1013 l 683 0 m 582 373 q 529 562 582 484 q 361 653 468 653 q 190 561 253 653 q 135 365 135 479 q 189 175 135 254 q 358 85 251 85 q 529 178 468 85 q 582 373 582 258 "},"¨":{x_min:-109,x_max:247,ha:232,o:"m 247 1046 l 119 1046 l 119 1189 l 247 1189 l 247 1046 m 19 1046 l -109 1046 l -109 1189 l 19 1189 l 19 1046 "},E:{x_min:0,x_max:736.109375,ha:789,o:"m 736 0 l 0 0 l 0 1013 l 725 1013 l 725 889 l 139 889 l 139 585 l 677 585 l 677 467 l 139 467 l 139 125 l 736 125 l 736 0 "},Y:{x_min:0,x_max:820,ha:886,o:"m 820 1013 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1013 l 140 1013 l 411 534 l 679 1012 l 820 1013 "},'"':{x_min:0,x_max:299,ha:396,o:"m 299 606 l 203 606 l 203 988 l 299 988 l 299 606 m 96 606 l 0 606 l 0 988 l 96 988 l 96 606 "},"‹":{x_min:17.984375,x_max:773.609375,ha:792,o:"m 773 40 l 18 376 l 17 465 l 773 799 l 773 692 l 159 420 l 773 149 l 773 40 "},"„":{x_min:0,x_max:364,ha:467,o:"m 141 -12 q 104 -132 141 -82 q 0 -205 67 -182 l 0 -138 q 56 -82 40 -124 q 69 0 69 -51 l 0 0 l 0 151 l 141 151 l 141 -12 m 364 -12 q 327 -132 364 -82 q 222 -205 290 -182 l 222 -138 q 279 -82 262 -124 q 292 0 292 -51 l 222 0 l 222 151 l 364 151 l 364 -12 "},"δ":{x_min:1,x_max:710,ha:810,o:"m 710 360 q 616 87 710 196 q 356 -28 518 -28 q 99 82 197 -28 q 1 356 1 192 q 100 606 1 509 q 355 703 199 703 q 180 829 288 754 q 70 903 124 866 l 70 1012 l 643 1012 l 643 901 l 258 901 q 462 763 422 794 q 636 592 577 677 q 710 360 710 485 m 584 365 q 552 501 584 447 q 451 602 521 555 q 372 611 411 611 q 197 541 258 611 q 136 355 136 472 q 190 171 136 245 q 358 85 252 85 q 528 173 465 85 q 584 365 584 252 "},"έ":{x_min:0,x_max:634.71875,ha:714,o:"m 634 234 q 527 38 634 110 q 300 -25 433 -25 q 98 29 183 -25 q 0 204 0 93 q 37 313 0 265 q 128 390 67 352 q 56 459 82 419 q 26 555 26 505 q 114 712 26 654 q 295 763 191 763 q 499 700 416 763 q 589 515 589 631 l 478 515 q 419 618 464 580 q 307 657 374 657 q 207 630 253 657 q 151 547 151 598 q 238 445 151 469 q 389 434 280 434 l 389 331 l 349 331 q 206 315 255 331 q 125 210 125 287 q 183 107 125 145 q 302 76 233 76 q 436 117 379 76 q 509 234 493 159 l 634 234 m 520 1040 l 331 819 l 248 819 l 383 1040 l 520 1040 "},"ω":{x_min:0,x_max:922,ha:1031,o:"m 922 339 q 856 97 922 203 q 650 -26 780 -26 q 538 9 587 -26 q 461 103 489 44 q 387 12 436 46 q 277 -22 339 -22 q 69 97 147 -22 q 0 339 0 203 q 45 551 0 444 q 161 738 84 643 l 302 738 q 175 553 219 647 q 124 336 124 446 q 155 179 124 249 q 275 88 197 88 q 375 163 341 88 q 400 294 400 219 l 400 572 l 524 572 l 524 294 q 561 135 524 192 q 643 88 591 88 q 762 182 719 88 q 797 342 797 257 q 745 556 797 450 q 619 738 705 638 l 760 738 q 874 551 835 640 q 922 339 922 444 "},"´":{x_min:0,x_max:96,ha:251,o:"m 96 606 l 0 606 l 0 988 l 96 988 l 96 606 "},"±":{x_min:11,x_max:781,ha:792,o:"m 781 490 l 446 490 l 446 255 l 349 255 l 349 490 l 11 490 l 11 586 l 349 586 l 349 819 l 446 819 l 446 586 l 781 586 l 781 490 m 781 21 l 11 21 l 11 115 l 781 115 l 781 21 "},"|":{x_min:343,x_max:449,ha:792,o:"m 449 462 l 343 462 l 343 986 l 449 986 l 449 462 m 449 -242 l 343 -242 l 343 280 l 449 280 l 449 -242 "},"ϋ":{x_min:0,x_max:617,ha:725,o:"m 482 800 l 372 800 l 372 925 l 482 925 l 482 800 m 239 800 l 129 800 l 129 925 l 239 925 l 239 800 m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 "},"§":{x_min:0,x_max:593,ha:690,o:"m 593 425 q 554 312 593 369 q 467 233 516 254 q 537 83 537 172 q 459 -74 537 -12 q 288 -133 387 -133 q 115 -69 184 -133 q 47 96 47 -6 l 166 96 q 199 7 166 40 q 288 -26 232 -26 q 371 -5 332 -26 q 420 60 420 21 q 311 201 420 139 q 108 309 210 255 q 0 490 0 383 q 33 602 0 551 q 124 687 66 654 q 75 743 93 712 q 58 812 58 773 q 133 984 58 920 q 300 1043 201 1043 q 458 987 394 1043 q 529 814 529 925 l 411 814 q 370 908 404 877 q 289 939 336 939 q 213 911 246 939 q 180 841 180 883 q 286 720 180 779 q 484 612 480 615 q 593 425 593 534 m 467 409 q 355 544 467 473 q 196 630 228 612 q 146 587 162 609 q 124 525 124 558 q 239 387 124 462 q 398 298 369 315 q 448 345 429 316 q 467 409 467 375 "},b:{x_min:0,x_max:685,ha:783,o:"m 685 372 q 597 99 685 213 q 347 -25 501 -25 q 219 5 277 -25 q 121 93 161 36 l 121 0 l 0 0 l 0 1013 l 121 1013 l 121 634 q 214 723 157 692 q 341 754 272 754 q 591 637 493 754 q 685 372 685 526 m 554 356 q 499 550 554 470 q 328 644 437 644 q 162 556 223 644 q 108 369 108 478 q 160 176 108 256 q 330 83 221 83 q 498 169 435 83 q 554 356 554 245 "},q:{x_min:0,x_max:683,ha:876,o:"m 683 -278 l 564 -278 l 564 97 q 474 8 533 39 q 345 -23 415 -23 q 91 93 188 -23 q 0 364 0 203 q 87 635 0 522 q 337 760 184 760 q 466 727 408 760 q 564 637 523 695 l 564 737 l 683 737 l 683 -278 m 582 375 q 527 564 582 488 q 358 652 466 652 q 190 565 253 652 q 135 377 135 488 q 189 179 135 261 q 361 84 251 84 q 530 179 469 84 q 582 375 582 260 "},"Ω":{x_min:-.171875,x_max:969.5625,ha:1068,o:"m 969 0 l 555 0 l 555 123 q 744 308 675 194 q 814 558 814 423 q 726 812 814 709 q 484 922 633 922 q 244 820 334 922 q 154 567 154 719 q 223 316 154 433 q 412 123 292 199 l 412 0 l 0 0 l 0 124 l 217 124 q 68 327 122 210 q 15 572 15 444 q 144 911 15 781 q 484 1041 274 1041 q 822 909 691 1041 q 953 569 953 777 q 899 326 953 443 q 750 124 846 210 l 969 124 l 969 0 "},"ύ":{x_min:0,x_max:617,ha:725,o:"m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 m 535 1040 l 346 819 l 262 819 l 397 1040 l 535 1040 "},z:{x_min:-.015625,x_max:613.890625,ha:697,o:"m 613 0 l 0 0 l 0 100 l 433 630 l 20 630 l 20 738 l 594 738 l 593 636 l 163 110 l 613 110 l 613 0 "},"™":{x_min:0,x_max:894,ha:1e3,o:"m 389 951 l 229 951 l 229 503 l 160 503 l 160 951 l 0 951 l 0 1011 l 389 1011 l 389 951 m 894 503 l 827 503 l 827 939 l 685 503 l 620 503 l 481 937 l 481 503 l 417 503 l 417 1011 l 517 1011 l 653 580 l 796 1010 l 894 1011 l 894 503 "},"ή":{x_min:.78125,x_max:697,ha:810,o:"m 697 -278 l 572 -278 l 572 454 q 540 587 572 536 q 425 650 501 650 q 271 579 337 650 q 206 420 206 509 l 206 0 l 81 0 l 81 489 q 73 588 81 562 q 0 644 56 644 l 0 741 q 68 755 38 755 q 158 721 124 755 q 200 630 193 687 q 297 726 234 692 q 434 761 359 761 q 620 692 544 761 q 697 516 697 624 l 697 -278 m 479 1040 l 290 819 l 207 819 l 341 1040 l 479 1040 "},"Θ":{x_min:0,x_max:960,ha:1056,o:"m 960 507 q 833 129 960 280 q 476 -32 698 -32 q 123 129 255 -32 q 0 507 0 280 q 123 883 0 732 q 476 1045 255 1045 q 832 883 696 1045 q 960 507 960 732 m 817 500 q 733 789 817 669 q 476 924 639 924 q 223 792 317 924 q 142 507 142 675 q 222 222 142 339 q 476 89 315 89 q 730 218 636 89 q 817 500 817 334 m 716 449 l 243 449 l 243 571 l 716 571 l 716 449 "},"®":{x_min:-3,x_max:1008,ha:1106,o:"m 503 532 q 614 562 566 532 q 672 658 672 598 q 614 747 672 716 q 503 772 569 772 l 338 772 l 338 532 l 503 532 m 502 -7 q 123 151 263 -7 q -3 501 -3 294 q 123 851 -3 706 q 502 1011 263 1011 q 881 851 739 1011 q 1008 501 1008 708 q 883 151 1008 292 q 502 -7 744 -7 m 502 60 q 830 197 709 60 q 940 501 940 322 q 831 805 940 681 q 502 944 709 944 q 174 805 296 944 q 65 501 65 680 q 173 197 65 320 q 502 60 294 60 m 788 146 l 678 146 q 653 316 655 183 q 527 449 652 449 l 338 449 l 338 146 l 241 146 l 241 854 l 518 854 q 688 808 621 854 q 766 658 766 755 q 739 563 766 607 q 668 497 713 519 q 751 331 747 472 q 788 164 756 190 l 788 146 "},"~":{x_min:0,x_max:833,ha:931,o:"m 833 958 q 778 753 833 831 q 594 665 716 665 q 402 761 502 665 q 240 857 302 857 q 131 795 166 857 q 104 665 104 745 l 0 665 q 54 867 0 789 q 237 958 116 958 q 429 861 331 958 q 594 765 527 765 q 704 827 670 765 q 729 958 729 874 l 833 958 "},"Ε":{x_min:0,x_max:736.21875,ha:778,o:"m 736 0 l 0 0 l 0 1013 l 725 1013 l 725 889 l 139 889 l 139 585 l 677 585 l 677 467 l 139 467 l 139 125 l 736 125 l 736 0 "},"³":{x_min:0,x_max:450,ha:547,o:"m 450 552 q 379 413 450 464 q 220 366 313 366 q 69 414 130 366 q 0 567 0 470 l 85 567 q 126 470 85 504 q 225 437 168 437 q 320 467 280 437 q 360 552 360 498 q 318 632 360 608 q 213 657 276 657 q 195 657 203 657 q 176 657 181 657 l 176 722 q 279 733 249 722 q 334 815 334 752 q 300 881 334 856 q 220 907 267 907 q 133 875 169 907 q 97 781 97 844 l 15 781 q 78 926 15 875 q 220 972 135 972 q 364 930 303 972 q 426 817 426 888 q 344 697 426 733 q 421 642 392 681 q 450 552 450 603 "},"[":{x_min:0,x_max:273.609375,ha:371,o:"m 273 -281 l 0 -281 l 0 1013 l 273 1013 l 273 920 l 124 920 l 124 -187 l 273 -187 l 273 -281 "},L:{x_min:0,x_max:645.828125,ha:696,o:"m 645 0 l 0 0 l 0 1013 l 140 1013 l 140 126 l 645 126 l 645 0 "},"σ":{x_min:0,x_max:803.390625,ha:894,o:"m 803 628 l 633 628 q 713 368 713 512 q 618 93 713 204 q 357 -25 518 -25 q 94 91 194 -25 q 0 368 0 201 q 94 644 0 533 q 356 761 194 761 q 481 750 398 761 q 608 739 564 739 l 803 739 l 803 628 m 360 85 q 529 180 467 85 q 584 374 584 262 q 527 566 584 490 q 352 651 463 651 q 187 559 247 651 q 135 368 135 478 q 189 175 135 254 q 360 85 251 85 "},"ζ":{x_min:0,x_max:573,ha:642,o:"m 573 -40 q 553 -162 573 -97 q 510 -278 543 -193 l 400 -278 q 441 -187 428 -219 q 462 -90 462 -132 q 378 -14 462 -14 q 108 45 197 -14 q 0 290 0 117 q 108 631 0 462 q 353 901 194 767 l 55 901 l 55 1012 l 561 1012 l 561 924 q 261 669 382 831 q 128 301 128 489 q 243 117 128 149 q 458 98 350 108 q 573 -40 573 80 "},"θ":{x_min:0,x_max:674,ha:778,o:"m 674 496 q 601 160 674 304 q 336 -26 508 -26 q 73 153 165 -26 q 0 485 0 296 q 72 840 0 683 q 343 1045 166 1045 q 605 844 516 1045 q 674 496 674 692 m 546 579 q 498 798 546 691 q 336 935 437 935 q 178 798 237 935 q 126 579 137 701 l 546 579 m 546 475 l 126 475 q 170 233 126 348 q 338 80 230 80 q 504 233 447 80 q 546 475 546 346 "},"Ο":{x_min:0,x_max:958,ha:1054,o:"m 485 1042 q 834 883 703 1042 q 958 511 958 735 q 834 136 958 287 q 481 -26 701 -26 q 126 130 261 -26 q 0 504 0 279 q 127 880 0 729 q 485 1042 263 1042 m 480 98 q 731 225 638 98 q 815 504 815 340 q 733 783 815 670 q 480 913 640 913 q 226 785 321 913 q 142 504 142 671 q 226 224 142 339 q 480 98 319 98 "},"Γ":{x_min:0,x_max:705.28125,ha:749,o:"m 705 886 l 140 886 l 140 0 l 0 0 l 0 1012 l 705 1012 l 705 886 "}," ":{x_min:0,x_max:0,ha:375},"%":{x_min:-3,x_max:1089,ha:1186,o:"m 845 0 q 663 76 731 0 q 602 244 602 145 q 661 412 602 344 q 845 489 728 489 q 1027 412 959 489 q 1089 244 1089 343 q 1029 76 1089 144 q 845 0 962 0 m 844 103 q 945 143 909 103 q 981 243 981 184 q 947 340 981 301 q 844 385 909 385 q 744 342 781 385 q 708 243 708 300 q 741 147 708 186 q 844 103 780 103 m 888 986 l 284 -25 l 199 -25 l 803 986 l 888 986 m 241 468 q 58 545 126 468 q -3 715 -3 615 q 56 881 -3 813 q 238 958 124 958 q 421 881 353 958 q 483 712 483 813 q 423 544 483 612 q 241 468 356 468 m 241 855 q 137 811 175 855 q 100 710 100 768 q 136 612 100 653 q 240 572 172 572 q 344 614 306 572 q 382 713 382 656 q 347 810 382 771 q 241 855 308 855 "},P:{x_min:0,x_max:726,ha:806,o:"m 424 1013 q 640 931 555 1013 q 726 719 726 850 q 637 506 726 587 q 413 426 548 426 l 140 426 l 140 0 l 0 0 l 0 1013 l 424 1013 m 379 889 l 140 889 l 140 548 l 372 548 q 522 589 459 548 q 593 720 593 637 q 528 845 593 801 q 379 889 463 889 "},"Έ":{x_min:0,x_max:1078.21875,ha:1118,o:"m 1078 0 l 342 0 l 342 1013 l 1067 1013 l 1067 889 l 481 889 l 481 585 l 1019 585 l 1019 467 l 481 467 l 481 125 l 1078 125 l 1078 0 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"Ώ":{x_min:.125,x_max:1136.546875,ha:1235,o:"m 1136 0 l 722 0 l 722 123 q 911 309 842 194 q 981 558 981 423 q 893 813 981 710 q 651 923 800 923 q 411 821 501 923 q 321 568 321 720 q 390 316 321 433 q 579 123 459 200 l 579 0 l 166 0 l 166 124 l 384 124 q 235 327 289 210 q 182 572 182 444 q 311 912 182 782 q 651 1042 441 1042 q 989 910 858 1042 q 1120 569 1120 778 q 1066 326 1120 443 q 917 124 1013 210 l 1136 124 l 1136 0 m 277 1040 l 83 800 l 0 800 l 140 1041 l 277 1040 "},_:{x_min:0,x_max:705.5625,ha:803,o:"m 705 -334 l 0 -334 l 0 -234 l 705 -234 l 705 -334 "},"Ϊ":{x_min:-110,x_max:246,ha:275,o:"m 246 1046 l 118 1046 l 118 1189 l 246 1189 l 246 1046 m 18 1046 l -110 1046 l -110 1189 l 18 1189 l 18 1046 m 136 0 l 0 0 l 0 1012 l 136 1012 l 136 0 "},"+":{x_min:23,x_max:768,ha:792,o:"m 768 372 l 444 372 l 444 0 l 347 0 l 347 372 l 23 372 l 23 468 l 347 468 l 347 840 l 444 840 l 444 468 l 768 468 l 768 372 "},"½":{x_min:0,x_max:1050,ha:1149,o:"m 1050 0 l 625 0 q 712 178 625 108 q 878 277 722 187 q 967 385 967 328 q 932 456 967 429 q 850 484 897 484 q 759 450 798 484 q 721 352 721 416 l 640 352 q 706 502 640 448 q 851 551 766 551 q 987 509 931 551 q 1050 385 1050 462 q 976 251 1050 301 q 829 179 902 215 q 717 68 740 133 l 1050 68 l 1050 0 m 834 985 l 215 -28 l 130 -28 l 750 984 l 834 985 m 224 422 l 142 422 l 142 811 l 0 811 l 0 867 q 104 889 62 867 q 164 973 157 916 l 224 973 l 224 422 "},"Ρ":{x_min:0,x_max:720,ha:783,o:"m 424 1013 q 637 933 554 1013 q 720 723 720 853 q 633 508 720 591 q 413 426 546 426 l 140 426 l 140 0 l 0 0 l 0 1013 l 424 1013 m 378 889 l 140 889 l 140 548 l 371 548 q 521 589 458 548 q 592 720 592 637 q 527 845 592 801 q 378 889 463 889 "},"'":{x_min:0,x_max:139,ha:236,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 "},"ª":{x_min:0,x_max:350,ha:397,o:"m 350 625 q 307 616 328 616 q 266 631 281 616 q 247 673 251 645 q 190 628 225 644 q 116 613 156 613 q 32 641 64 613 q 0 722 0 669 q 72 826 0 800 q 247 866 159 846 l 247 887 q 220 934 247 916 q 162 953 194 953 q 104 934 129 953 q 76 882 80 915 l 16 882 q 60 976 16 941 q 166 1011 104 1011 q 266 979 224 1011 q 308 891 308 948 l 308 706 q 311 679 308 688 q 331 670 315 670 l 350 672 l 350 625 m 247 757 l 247 811 q 136 790 175 798 q 64 726 64 773 q 83 682 64 697 q 132 667 103 667 q 207 690 174 667 q 247 757 247 718 "},"΅":{x_min:0,x_max:450,ha:553,o:"m 450 800 l 340 800 l 340 925 l 450 925 l 450 800 m 406 1040 l 212 800 l 129 800 l 269 1040 l 406 1040 m 110 800 l 0 800 l 0 925 l 110 925 l 110 800 "},T:{x_min:0,x_max:777,ha:835,o:"m 777 894 l 458 894 l 458 0 l 319 0 l 319 894 l 0 894 l 0 1013 l 777 1013 l 777 894 "},"Φ":{x_min:0,x_max:915,ha:997,o:"m 527 0 l 389 0 l 389 122 q 110 231 220 122 q 0 509 0 340 q 110 785 0 677 q 389 893 220 893 l 389 1013 l 527 1013 l 527 893 q 804 786 693 893 q 915 509 915 679 q 805 231 915 341 q 527 122 696 122 l 527 0 m 527 226 q 712 310 641 226 q 779 507 779 389 q 712 705 779 627 q 527 787 641 787 l 527 226 m 389 226 l 389 787 q 205 698 275 775 q 136 505 136 620 q 206 308 136 391 q 389 226 276 226 "},"⁋":{x_min:0,x_max:0,ha:694},j:{x_min:-77.78125,x_max:167,ha:349,o:"m 167 871 l 42 871 l 42 1013 l 167 1013 l 167 871 m 167 -80 q 121 -231 167 -184 q -26 -278 76 -278 l -77 -278 l -77 -164 l -41 -164 q 26 -143 11 -164 q 42 -65 42 -122 l 42 737 l 167 737 l 167 -80 "},"Σ":{x_min:0,x_max:756.953125,ha:819,o:"m 756 0 l 0 0 l 0 107 l 395 523 l 22 904 l 22 1013 l 745 1013 l 745 889 l 209 889 l 566 523 l 187 125 l 756 125 l 756 0 "},"›":{x_min:18.0625,x_max:774,ha:792,o:"m 774 376 l 18 40 l 18 149 l 631 421 l 18 692 l 18 799 l 774 465 l 774 376 "},"<":{x_min:17.984375,x_max:773.609375,ha:792,o:"m 773 40 l 18 376 l 17 465 l 773 799 l 773 692 l 159 420 l 773 149 l 773 40 "},"£":{x_min:0,x_max:704.484375,ha:801,o:"m 704 41 q 623 -10 664 5 q 543 -26 583 -26 q 359 15 501 -26 q 243 36 288 36 q 158 23 197 36 q 73 -21 119 10 l 6 76 q 125 195 90 150 q 175 331 175 262 q 147 443 175 383 l 0 443 l 0 512 l 108 512 q 43 734 43 623 q 120 929 43 854 q 358 1010 204 1010 q 579 936 487 1010 q 678 729 678 857 l 678 684 l 552 684 q 504 838 552 780 q 362 896 457 896 q 216 852 263 896 q 176 747 176 815 q 199 627 176 697 q 248 512 217 574 l 468 512 l 468 443 l 279 443 q 297 356 297 398 q 230 194 297 279 q 153 107 211 170 q 227 133 190 125 q 293 142 264 142 q 410 119 339 142 q 516 96 482 96 q 579 105 550 96 q 648 142 608 115 l 704 41 "},t:{x_min:0,x_max:367,ha:458,o:"m 367 0 q 312 -5 339 -2 q 262 -8 284 -8 q 145 28 183 -8 q 108 143 108 64 l 108 638 l 0 638 l 0 738 l 108 738 l 108 944 l 232 944 l 232 738 l 367 738 l 367 638 l 232 638 l 232 185 q 248 121 232 140 q 307 102 264 102 q 345 104 330 102 q 367 107 360 107 l 367 0 "},"¬":{x_min:0,x_max:706,ha:803,o:"m 706 411 l 706 158 l 630 158 l 630 335 l 0 335 l 0 411 l 706 411 "},"λ":{x_min:0,x_max:750,ha:803,o:"m 750 -7 q 679 -15 716 -15 q 538 59 591 -15 q 466 214 512 97 l 336 551 l 126 0 l 0 0 l 270 705 q 223 837 247 770 q 116 899 190 899 q 90 898 100 899 l 90 1004 q 152 1011 125 1011 q 298 938 244 1011 q 373 783 326 901 l 605 192 q 649 115 629 136 q 716 95 669 95 l 736 95 q 750 97 745 97 l 750 -7 "},W:{x_min:0,x_max:1263.890625,ha:1351,o:"m 1263 1013 l 995 0 l 859 0 l 627 837 l 405 0 l 265 0 l 0 1013 l 136 1013 l 342 202 l 556 1013 l 701 1013 l 921 207 l 1133 1012 l 1263 1013 "},">":{x_min:18.0625,x_max:774,ha:792,o:"m 774 376 l 18 40 l 18 149 l 631 421 l 18 692 l 18 799 l 774 465 l 774 376 "},v:{x_min:0,x_max:675.15625,ha:761,o:"m 675 738 l 404 0 l 272 0 l 0 738 l 133 737 l 340 147 l 541 737 l 675 738 "},"τ":{x_min:.28125,x_max:644.5,ha:703,o:"m 644 628 l 382 628 l 382 179 q 388 120 382 137 q 436 91 401 91 q 474 94 447 91 q 504 97 501 97 l 504 0 q 454 -9 482 -5 q 401 -14 426 -14 q 278 67 308 -14 q 260 233 260 118 l 260 628 l 0 628 l 0 739 l 644 739 l 644 628 "},"ξ":{x_min:0,x_max:624.9375,ha:699,o:"m 624 -37 q 608 -153 624 -96 q 563 -278 593 -211 l 454 -278 q 491 -183 486 -200 q 511 -83 511 -126 q 484 -23 511 -44 q 370 1 452 1 q 323 0 354 1 q 283 -1 293 -1 q 84 76 169 -1 q 0 266 0 154 q 56 431 0 358 q 197 538 108 498 q 94 613 134 562 q 54 730 54 665 q 77 823 54 780 q 143 901 101 867 l 27 901 l 27 1012 l 576 1012 l 576 901 l 380 901 q 244 863 303 901 q 178 745 178 820 q 312 600 178 636 q 532 582 380 582 l 532 479 q 276 455 361 479 q 118 281 118 410 q 165 173 118 217 q 274 120 208 133 q 494 101 384 110 q 624 -37 624 76 "},"&":{x_min:-3,x_max:894.25,ha:992,o:"m 894 0 l 725 0 l 624 123 q 471 0 553 40 q 306 -41 390 -41 q 168 -7 231 -41 q 62 92 105 26 q 14 187 31 139 q -3 276 -3 235 q 55 433 -3 358 q 248 581 114 508 q 170 689 196 640 q 137 817 137 751 q 214 985 137 922 q 384 1041 284 1041 q 548 988 483 1041 q 622 824 622 928 q 563 666 622 739 q 431 556 516 608 l 621 326 q 649 407 639 361 q 663 493 653 426 l 781 493 q 703 229 781 352 l 894 0 m 504 818 q 468 908 504 877 q 384 940 433 940 q 293 907 331 940 q 255 818 255 875 q 289 714 255 767 q 363 628 313 678 q 477 729 446 682 q 504 818 504 771 m 556 209 l 314 499 q 179 395 223 449 q 135 283 135 341 q 146 222 135 253 q 183 158 158 192 q 333 80 241 80 q 556 209 448 80 "},"Λ":{x_min:0,x_max:862.5,ha:942,o:"m 862 0 l 719 0 l 426 847 l 143 0 l 0 0 l 356 1013 l 501 1013 l 862 0 "},I:{x_min:41,x_max:180,ha:293,o:"m 180 0 l 41 0 l 41 1013 l 180 1013 l 180 0 "},G:{x_min:0,x_max:921,ha:1011,o:"m 921 0 l 832 0 l 801 136 q 655 15 741 58 q 470 -28 568 -28 q 126 133 259 -28 q 0 499 0 284 q 125 881 0 731 q 486 1043 259 1043 q 763 957 647 1043 q 905 709 890 864 l 772 709 q 668 866 747 807 q 486 926 589 926 q 228 795 322 926 q 142 507 142 677 q 228 224 142 342 q 483 94 323 94 q 712 195 625 94 q 796 435 796 291 l 477 435 l 477 549 l 921 549 l 921 0 "},"ΰ":{x_min:0,x_max:617,ha:725,o:"m 524 800 l 414 800 l 414 925 l 524 925 l 524 800 m 183 800 l 73 800 l 73 925 l 183 925 l 183 800 m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 m 489 1040 l 300 819 l 216 819 l 351 1040 l 489 1040 "},"`":{x_min:0,x_max:138.890625,ha:236,o:"m 138 699 l 0 699 l 0 861 q 36 974 0 929 q 138 1041 72 1020 l 138 977 q 82 931 95 969 q 69 839 69 893 l 138 839 l 138 699 "},"·":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 "},"Υ":{x_min:.328125,x_max:819.515625,ha:889,o:"m 819 1013 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1013 l 140 1013 l 411 533 l 679 1013 l 819 1013 "},r:{x_min:0,x_max:355.5625,ha:432,o:"m 355 621 l 343 621 q 179 569 236 621 q 122 411 122 518 l 122 0 l 0 0 l 0 737 l 117 737 l 117 604 q 204 719 146 686 q 355 753 262 753 l 355 621 "},x:{x_min:0,x_max:675,ha:764,o:"m 675 0 l 525 0 l 331 286 l 144 0 l 0 0 l 256 379 l 12 738 l 157 737 l 336 473 l 516 738 l 661 738 l 412 380 l 675 0 "},"μ":{x_min:0,x_max:696.609375,ha:747,o:"m 696 -4 q 628 -14 657 -14 q 498 97 513 -14 q 422 8 470 41 q 313 -24 374 -24 q 207 3 258 -24 q 120 80 157 31 l 120 -278 l 0 -278 l 0 738 l 124 738 l 124 343 q 165 172 124 246 q 308 82 216 82 q 451 177 402 82 q 492 358 492 254 l 492 738 l 616 738 l 616 214 q 623 136 616 160 q 673 92 636 92 q 696 95 684 92 l 696 -4 "},h:{x_min:0,x_max:615,ha:724,o:"m 615 472 l 615 0 l 490 0 l 490 454 q 456 590 490 535 q 338 654 416 654 q 186 588 251 654 q 122 436 122 522 l 122 0 l 0 0 l 0 1013 l 122 1013 l 122 633 q 218 727 149 694 q 362 760 287 760 q 552 676 484 760 q 615 472 615 600 "},".":{x_min:0,x_max:142,ha:239,o:"m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 "},"φ":{x_min:-2,x_max:878,ha:974,o:"m 496 -279 l 378 -279 l 378 -17 q 101 88 204 -17 q -2 367 -2 194 q 68 626 -2 510 q 283 758 151 758 l 283 646 q 167 537 209 626 q 133 373 133 462 q 192 177 133 254 q 378 93 259 93 l 378 758 q 445 764 426 763 q 476 765 464 765 q 765 659 653 765 q 878 377 878 553 q 771 96 878 209 q 496 -17 665 -17 l 496 -279 m 496 93 l 514 93 q 687 183 623 93 q 746 380 746 265 q 691 569 746 491 q 522 658 629 658 l 496 656 l 496 93 "},";":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 m 142 -12 q 105 -132 142 -82 q 0 -206 68 -182 l 0 -138 q 58 -82 43 -123 q 68 0 68 -56 l 0 0 l 0 151 l 142 151 l 142 -12 "},f:{x_min:0,x_max:378,ha:472,o:"m 378 638 l 246 638 l 246 0 l 121 0 l 121 638 l 0 638 l 0 738 l 121 738 q 137 935 121 887 q 290 1028 171 1028 q 320 1027 305 1028 q 378 1021 334 1026 l 378 908 q 323 918 346 918 q 257 870 273 918 q 246 780 246 840 l 246 738 l 378 738 l 378 638 "},"“":{x_min:1,x_max:348.21875,ha:454,o:"m 140 670 l 1 670 l 1 830 q 37 943 1 897 q 140 1011 74 990 l 140 947 q 82 900 97 940 q 68 810 68 861 l 140 810 l 140 670 m 348 670 l 209 670 l 209 830 q 245 943 209 897 q 348 1011 282 990 l 348 947 q 290 900 305 940 q 276 810 276 861 l 348 810 l 348 670 "},A:{x_min:.03125,x_max:906.953125,ha:1008,o:"m 906 0 l 756 0 l 648 303 l 251 303 l 142 0 l 0 0 l 376 1013 l 529 1013 l 906 0 m 610 421 l 452 867 l 293 421 l 610 421 "},"‘":{x_min:1,x_max:139.890625,ha:236,o:"m 139 670 l 1 670 l 1 830 q 37 943 1 897 q 139 1011 74 990 l 139 947 q 82 900 97 940 q 68 810 68 861 l 139 810 l 139 670 "},"ϊ":{x_min:-70,x_max:283,ha:361,o:"m 283 800 l 173 800 l 173 925 l 283 925 l 283 800 m 40 800 l -70 800 l -70 925 l 40 925 l 40 800 m 283 3 q 232 -10 257 -5 q 181 -15 206 -15 q 84 26 118 -15 q 41 200 41 79 l 41 737 l 166 737 l 167 215 q 171 141 167 157 q 225 101 182 101 q 247 103 238 101 q 283 112 256 104 l 283 3 "},"π":{x_min:-.21875,x_max:773.21875,ha:857,o:"m 773 -7 l 707 -11 q 575 40 607 -11 q 552 174 552 77 l 552 226 l 552 626 l 222 626 l 222 0 l 97 0 l 97 626 l 0 626 l 0 737 l 773 737 l 773 626 l 676 626 l 676 171 q 695 103 676 117 q 773 90 714 90 l 773 -7 "},"ά":{x_min:0,x_max:765.5625,ha:809,o:"m 765 -4 q 698 -14 726 -14 q 564 97 586 -14 q 466 7 525 40 q 337 -26 407 -26 q 88 98 186 -26 q 0 369 0 212 q 88 637 0 525 q 337 760 184 760 q 465 727 407 760 q 563 637 524 695 l 563 738 l 685 738 l 685 222 q 693 141 685 168 q 748 94 708 94 q 765 95 760 94 l 765 -4 m 584 371 q 531 562 584 485 q 360 653 470 653 q 192 566 254 653 q 135 379 135 489 q 186 181 135 261 q 358 84 247 84 q 528 176 465 84 q 584 371 584 260 m 604 1040 l 415 819 l 332 819 l 466 1040 l 604 1040 "},O:{x_min:0,x_max:958,ha:1057,o:"m 485 1041 q 834 882 702 1041 q 958 512 958 734 q 834 136 958 287 q 481 -26 702 -26 q 126 130 261 -26 q 0 504 0 279 q 127 880 0 728 q 485 1041 263 1041 m 480 98 q 731 225 638 98 q 815 504 815 340 q 733 783 815 669 q 480 912 640 912 q 226 784 321 912 q 142 504 142 670 q 226 224 142 339 q 480 98 319 98 "},n:{x_min:0,x_max:615,ha:724,o:"m 615 463 l 615 0 l 490 0 l 490 454 q 453 592 490 537 q 331 656 410 656 q 178 585 240 656 q 117 421 117 514 l 117 0 l 0 0 l 0 738 l 117 738 l 117 630 q 218 728 150 693 q 359 764 286 764 q 552 675 484 764 q 615 463 615 593 "},l:{x_min:41,x_max:166,ha:279,o:"m 166 0 l 41 0 l 41 1013 l 166 1013 l 166 0 "},"¤":{x_min:40.09375,x_max:728.796875,ha:825,o:"m 728 304 l 649 224 l 512 363 q 383 331 458 331 q 256 363 310 331 l 119 224 l 40 304 l 177 441 q 150 553 150 493 q 184 673 150 621 l 40 818 l 119 898 l 267 749 q 321 766 291 759 q 384 773 351 773 q 447 766 417 773 q 501 749 477 759 l 649 898 l 728 818 l 585 675 q 612 618 604 648 q 621 553 621 587 q 591 441 621 491 l 728 304 m 384 682 q 280 643 318 682 q 243 551 243 604 q 279 461 243 499 q 383 423 316 423 q 487 461 449 423 q 525 553 525 500 q 490 641 525 605 q 384 682 451 682 "},"κ":{x_min:0,x_max:632.328125,ha:679,o:"m 632 0 l 482 0 l 225 384 l 124 288 l 124 0 l 0 0 l 0 738 l 124 738 l 124 446 l 433 738 l 596 738 l 312 466 l 632 0 "},p:{x_min:0,x_max:685,ha:786,o:"m 685 364 q 598 96 685 205 q 350 -23 504 -23 q 121 89 205 -23 l 121 -278 l 0 -278 l 0 738 l 121 738 l 121 633 q 220 726 159 691 q 351 761 280 761 q 598 636 504 761 q 685 364 685 522 m 557 371 q 501 560 557 481 q 330 651 437 651 q 162 559 223 651 q 108 366 108 479 q 162 177 108 254 q 333 87 224 87 q 502 178 441 87 q 557 371 557 258 "},"‡":{x_min:0,x_max:777,ha:835,o:"m 458 238 l 458 0 l 319 0 l 319 238 l 0 238 l 0 360 l 319 360 l 319 681 l 0 683 l 0 804 l 319 804 l 319 1015 l 458 1013 l 458 804 l 777 804 l 777 683 l 458 683 l 458 360 l 777 360 l 777 238 l 458 238 "},"ψ":{x_min:0,x_max:808,ha:907,o:"m 465 -278 l 341 -278 l 341 -15 q 87 102 180 -15 q 0 378 0 210 l 0 739 l 133 739 l 133 379 q 182 195 133 275 q 341 98 242 98 l 341 922 l 465 922 l 465 98 q 623 195 563 98 q 675 382 675 278 l 675 742 l 808 742 l 808 381 q 720 104 808 213 q 466 -13 627 -13 l 465 -278 "},"η":{x_min:.78125,x_max:697,ha:810,o:"m 697 -278 l 572 -278 l 572 454 q 540 587 572 536 q 425 650 501 650 q 271 579 337 650 q 206 420 206 509 l 206 0 l 81 0 l 81 489 q 73 588 81 562 q 0 644 56 644 l 0 741 q 68 755 38 755 q 158 720 124 755 q 200 630 193 686 q 297 726 234 692 q 434 761 359 761 q 620 692 544 761 q 697 516 697 624 l 697 -278 "}},cssFontWeight:"normal",ascender:1189,underlinePosition:-100,cssFontStyle:"normal",boundingBox:{yMin:-334,xMin:-111,yMax:1189,xMax:1672},resolution:1e3,original_font_information:{postscript_name:"Helvetiker-Regular",version_string:"Version 1.00 2004 initial release",vendor_url:"http://www.magenta.gr/",full_font_name:"Helvetiker",font_family_name:"Helvetiker",copyright:"Copyright (c) Μagenta ltd, 2004",description:"",trademark:"",designer:"",designer_url:"",unique_font_identifier:"Μagenta ltd:Helvetiker:22-10-104",license_url:"http://www.ellak.gr/fonts/MgOpen/license.html",license_description:'Copyright (c) 2004 by MAGENTA Ltd. All Rights Reserved.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: \r\n\r\nThe above copyright and this permission notice shall be included in all copies of one or more of the Font Software typefaces.\r\n\r\nThe Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing the word "MgOpen", or if the modifications are accepted for inclusion in the Font Software itself by the each appointed Administrator.\r\n\r\nThis License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "MgOpen" name.\r\n\r\nThe Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. \r\n\r\nTHE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL MAGENTA OR PERSONS OR BODIES IN CHARGE OF ADMINISTRATION AND MAINTENANCE OF THE FONT SOFTWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.',manufacturer_name:"Μagenta ltd",font_sub_family_name:"Regular"},descender:-334,familyName:"Helvetiker",lineHeight:1522,underlineThickness:50},Ax=Q_(Q_({},window.THREE?window.THREE:{BoxGeometry:hi,CircleGeometry:Ss,DoubleSide:2,Group:ts,Mesh:ci,MeshLambertMaterial:da,TextGeometry:N_,Vector3:on}),{},{Font:class{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100){const n=[],r=function(e,t,n){const r=Array.from(e),i=t/n.resolution,s=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,a=[];let o=0,l=0;for(let e=0;e<r.length;e++){const t=r[e];if("\n"===t)o=0,l-=s;else{const e=P_(t,i,o,l,n);o+=e.offsetX,a.push(e.path)}}return a}(e,t,this.data);for(let e=0,t=r.length;e<t;e++)n.push(...r[e].toShapes());return n}},TextGeometry:N_}),hx=xc({props:{labelsData:{default:[]},labelLat:{default:"lat"},labelLng:{default:"lng"},labelAltitude:{default:0},labelText:{default:"text"},labelSize:{default:.5},labelTypeFace:{default:cx,onChange:function(e,t){t.font=new Ax.Font(e)}},labelColor:{default:function(){return"lightgrey"}},labelRotation:{default:0},labelResolution:{default:3},labelIncludeDot:{default:!0},labelDotRadius:{default:.1},labelDotOrientation:{default:function(){return"bottom"}},labelsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(e,t,n){var r=n.tweenGroup;ry(e),t.scene=e,t.tweenGroup=r;var i=new Ax.CircleGeometry(1,32);t.dataMapper=new by(e,{objBindAttr:"__threeObjLabel"}).onCreateObj((function(){var e=new Ax.MeshLambertMaterial;e.side=2;var t=new Ax.Group;t.add(new Ax.Mesh(i,e));var n=new Ax.Mesh(void 0,e);t.add(n);var r=new Ax.Mesh;return r.visible=!1,n.add(r),t.__globeObjType="label",t}))},update:function(e){var t=Pp(e.labelLat),n=Pp(e.labelLng),r=Pp(e.labelAltitude),i=Pp(e.labelText),s=Pp(e.labelSize),a=Pp(e.labelRotation),o=Pp(e.labelColor),l=Pp(e.labelIncludeDot),u=Pp(e.labelDotRadius),c=Pp(e.labelDotOrientation),A=new Set(["right","top","bottom"]),h=2*Math.PI*sy/360;e.dataMapper.onUpdateObj((function(d,p){var f=$_(d.children,2),m=f[0],g=f[1],v=$_(g.children,1)[0],_=o(p),y=fy(_);g.material.color.set(py(_)),g.material.transparent=y<1,g.material.opacity=y;var x=l(p),b=c(p);!x||!A.has(b)&&(b="bottom");var S=x?+u(p)*h:1e-12;m.scale.x=m.scale.y=S;var T=+s(p)*h;if(g.geometry&&g.geometry.dispose(),g.geometry=new Ax.TextGeometry(i(p),{font:e.font,size:T,depth:0,height:0,curveSegments:e.labelResolution}),v.geometry&&v.geometry.dispose(),g.geometry.computeBoundingBox(),v.geometry=q_(Ax.BoxGeometry,Z_((new Ax.Vector3).subVectors(g.geometry.boundingBox.max,g.geometry.boundingBox.min).toArray())),"right"!==b&&g.geometry.center(),x){var w=S+T/2;"right"===b&&(g.position.x=w),g.position.y={right:-T/2,top:w+T/2,bottom:-w-T/2}[b]}var M=function(t){var n=d.__currentTargetD=t,r=n.lat,i=n.lng,s=n.alt,a=n.rot,o=n.scale;Object.assign(d.position,oy(r,i,s)),d.lookAt(e.scene.localToWorld(new Ax.Vector3(0,0,0))),d.rotateY(Math.PI),d.rotateZ(-a*Math.PI/180),d.scale.x=d.scale.y=d.scale.z=o},E={lat:+t(p),lng:+n(p),alt:+r(p),rot:+a(p),scale:1},C=d.__currentTargetD||Object.assign({},E,{scale:1e-12});Object.keys(E).some((function(e){return C[e]!==E[e]}))&&(!e.labelsTransitionDuration||e.labelsTransitionDuration<0?M(E):e.tweenGroup.add(new Rc(C).to(E,e.labelsTransitionDuration).easing(Sc.Quadratic.InOut).onUpdate(M).start()))})).digest(e.labelsData)}}),dx=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32;B_(this,t),(e=I_(this,t)).type="CircleLineGeometry",e.parameters={radius:n,segmentCount:r};for(var i=[],s=0;s<=r;s++){var a=(s/r-.25)*Math.PI*2;i.push({x:Math.cos(a)*n,y:Math.sin(a)*n,z:0})}return e.setFromPoints(i),e}return j_(t,e),G_(t)}((window.THREE?window.THREE:{BufferGeometry:Zr}).BufferGeometry),px=window.THREE?window.THREE:{Color:Rr,Group:ts,Line:Yi,LineBasicMaterial:Gi,Vector3:on},fx=fm.default||fm,mx=xc({props:{ringsData:{default:[]},ringLat:{default:"lat"},ringLng:{default:"lng"},ringAltitude:{default:.0015},ringColor:{default:function(){return"#ffffaa"},triggerUpdate:!1},ringResolution:{default:64,triggerUpdate:!1},ringMaxRadius:{default:2,triggerUpdate:!1},ringPropagationSpeed:{default:1,triggerUpdate:!1},ringRepeatPeriod:{default:700,triggerUpdate:!1}},methods:{pauseAnimation:function(e){var t;null===(t=e.ticker)||void 0===t||t.pause()},resumeAnimation:function(e){var t;null===(t=e.ticker)||void 0===t||t.resume()},_destructor:function(e){var t;null===(t=e.ticker)||void 0===t||t.dispose()}},init:function(e,t,n){var r=n.tweenGroup;ry(e),t.scene=e,t.tweenGroup=r,t.dataMapper=new by(e,{objBindAttr:"__threeObjRing",removeDelay:3e4}).onCreateObj((function(){var e=new px.Group;return e.__globeObjType="ring",e})),t.ticker=new fx,t.ticker.onTick.add((function(e){if(t.ringsData.length){var n=Pp(t.ringColor),r=Pp(t.ringAltitude),i=Pp(t.ringMaxRadius),s=Pp(t.ringPropagationSpeed),a=Pp(t.ringRepeatPeriod);t.dataMapper.entries().filter((function(e){return $_(e,2)[1]})).forEach((function(o){var l,u,c=$_(o,2),A=c[0],h=c[1];if((h.__nextRingTime||0)<=e){var d=a(A)/1e3;h.__nextRingTime=e+(d<=0?1/0:d);var p,f=new px.Line(new dx(1,t.ringResolution),new px.LineBasicMaterial),m=n(A),g=m instanceof Array||m instanceof Function;g?m instanceof Array?(p=rg().domain(m.map((function(e,t){return t/(m.length-1)}))).range(m),f.material.transparent=m.some((function(e){return fy(e)<1}))):(p=m,f.material.transparent=!0):(f.material.color=new px.Color(py(m)),l=f.material,u=fy(m),l.opacity=u,l.transparent=u<1,l.depthWrite=u>=1);var v=sy*(1+r(A)),_=i(A),y=_*Math.PI/180,x=s(A),b=x<=0,S=function(e){var t=e.t,n=(b?1-t:t)*y;if(f.scale.x=f.scale.y=v*Math.sin(n),f.position.z=v*(1-Math.cos(n)),g){var r=p(t);f.material.color=new px.Color(py(r)),f.material.transparent&&(f.material.opacity=fy(r))}};if(0===x)S({t:0}),h.add(f);else{var T=1e3*Math.abs(_/x);t.tweenGroup.add(new Rc({t:0}).to({t:1},T).onUpdate(S).onStart((function(){return h.add(f)})).onComplete((function(){h.remove(f),ny(f)})).start())}}}))}}))},update:function(e){var t=Pp(e.ringLat),n=Pp(e.ringLng),r=Pp(e.ringAltitude),i=e.scene.localToWorld(new px.Vector3(0,0,0));e.dataMapper.onUpdateObj((function(e,s){var a=t(s),o=n(s),l=r(s);Object.assign(e.position,oy(a,o,l)),e.lookAt(i)})).digest(e.ringsData)}}),gx=Q_(Q_({},window.THREE?window.THREE:{}),{},{CSS2DObject:class extends cr{constructor(e=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new Lt(.5,.5),this.addEventListener("removed",(function(){this.traverse((function(e){e.element instanceof e.element.ownerDocument.defaultView.Element&&null!==e.element.parentNode&&e.element.remove()}))}))}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this.center=e.center,this}}}),vx=xc({props:{htmlElementsData:{default:[]},htmlLat:{default:"lat"},htmlLng:{default:"lng"},htmlAltitude:{default:0},htmlElement:{},htmlTransitionDuration:{default:1e3,triggerUpdate:!1},isBehindGlobe:{onChange:function(){this.updateObjVisibility()},triggerUpdate:!1}},methods:{updateObjVisibility:function(e,t){e.dataMapper&&(t?[t]:e.dataMapper.entries().map((function(e){return $_(e,2)[1]})).filter((function(e){return e}))).forEach((function(t){return t.visible=!e.isBehindGlobe||!e.isBehindGlobe(t.position)}))}},init:function(e,t,n){var r=n.tweenGroup;ry(e),t.scene=e,t.tweenGroup=r,t.dataMapper=new by(e,{objBindAttr:"__threeObjHtml"}).onCreateObj((function(e){var n=Pp(t.htmlElement)(e),r=new gx.CSS2DObject(n);return r.__globeObjType="html",r}))},update:function(e,t){var n=this,r=Pp(e.htmlLat),i=Pp(e.htmlLng),s=Pp(e.htmlAltitude);t.hasOwnProperty("htmlElement")&&e.dataMapper.clear(),e.dataMapper.onUpdateObj((function(t,a){var o=function(e){var r=t.__currentTargetD=e,i=r.alt,s=r.lat,a=r.lng;Object.assign(t.position,oy(s,a,i)),n.updateObjVisibility(t)},l={lat:+r(a),lng:+i(a),alt:+s(a)};!e.htmlTransitionDuration||e.htmlTransitionDuration<0||!t.__currentTargetD?o(l):e.tweenGroup.add(new Rc(t.__currentTargetD).to(l,e.htmlTransitionDuration).easing(Sc.Quadratic.InOut).onUpdate(o).start())})).digest(e.htmlElementsData)}}),_x=window.THREE?window.THREE:{Euler:Xn,Group:ts,Mesh:ci,MeshLambertMaterial:da,SphereGeometry:ra},yx=xc({props:{objectsData:{default:[]},objectLat:{default:"lat"},objectLng:{default:"lng"},objectAltitude:{default:.01},objectFacesSurface:{default:!0},objectRotation:{},objectThreeObject:{default:new _x.Mesh(new _x.SphereGeometry(1,16,8),new _x.MeshLambertMaterial({color:"#ffffaa",transparent:!0,opacity:.7}))}},init:function(e,t){ry(e),t.scene=e,t.dataMapper=new by(e,{objBindAttr:"__threeObjObject"}).onCreateObj((function(e){var n=Pp(t.objectThreeObject)(e);t.objectThreeObject===n&&(n=n.clone());var r=new _x.Group;return r.add(n),r.__globeObjType="object",r}))},update:function(e,t){var n=Pp(e.objectLat),r=Pp(e.objectLng),i=Pp(e.objectAltitude),s=Pp(e.objectFacesSurface),a=Pp(e.objectRotation);t.hasOwnProperty("objectThreeObject")&&e.dataMapper.clear(),e.dataMapper.onUpdateObj((function(e,t){var o=+n(t),l=+r(t),u=+i(t);Object.assign(e.position,oy(o,l,u)),s(t)?e.setRotationFromEuler(new Xn(uy(-o),uy(l),0,"YXZ")):e.rotation.set(0,0,0);var c=e.children[0],A=a(t);A&&c.setRotationFromEuler(new Xn(uy(A.x||0),uy(A.y||0),uy(A.z||0)))})).digest(e.objectsData)}}),xx=xc({props:{customLayerData:{default:[]},customThreeObject:{},customThreeObjectUpdate:{triggerUpdate:!1}},init:function(e,t){ry(e),t.scene=e,t.dataMapper=new by(e,{objBindAttr:"__threeObjCustom"}).onCreateObj((function(e){var n=Pp(t.customThreeObject)(e,sy);return n&&(t.customThreeObject===n&&(n=n.clone()),n.__globeObjType="custom"),n}))},update:function(e,t){e.customThreeObjectUpdate||ry(e.scene);var n=Pp(e.customThreeObjectUpdate);t.hasOwnProperty("customThreeObject")&&e.dataMapper.clear(),e.dataMapper.onUpdateObj((function(e,t){return n(e,t,sy)})).digest(e.customLayerData)}}),bx=window.THREE?window.THREE:{Camera:vi,Group:ts,Vector2:Lt,Vector3:on},Sx=["globeLayer","pointsLayer","arcsLayer","hexBinLayer","heatmapsLayer","polygonsLayer","hexedPolygonsLayer","pathsLayer","tilesLayer","labelsLayer","ringsLayer","htmlElementsLayer","objectsLayer","customLayer"],Tx=iy("globeLayer",dy),wx=Object.assign.apply(Object,Z_(["globeImageUrl","bumpImageUrl","showGlobe","showGraticules","showAtmosphere","atmosphereColor","atmosphereAltitude"].map((function(e){return z_({},e,Tx.linkProp(e))})))),Mx=Object.assign.apply(Object,Z_(["globeMaterial"].map((function(e){return z_({},e,Tx.linkMethod(e))})))),Ex=iy("pointsLayer",My),Cx=Object.assign.apply(Object,Z_(["pointsData","pointLat","pointLng","pointColor","pointAltitude","pointRadius","pointResolution","pointsMerge","pointsTransitionDuration"].map((function(e){return z_({},e,Ex.linkProp(e))})))),Rx=iy("arcsLayer",Ly),Nx=Object.assign.apply(Object,Z_(["arcsData","arcStartLat","arcStartLng","arcEndLat","arcEndLng","arcColor","arcAltitude","arcAltitudeAutoScale","arcStroke","arcCurveResolution","arcCircularResolution","arcDashLength","arcDashGap","arcDashInitialGap","arcDashAnimateTime","arcsTransitionDuration"].map((function(e){return z_({},e,Rx.linkProp(e))})))),Px=iy("hexBinLayer",Oy),Dx=Object.assign.apply(Object,Z_(["hexBinPointsData","hexBinPointLat","hexBinPointLng","hexBinPointWeight","hexBinResolution","hexMargin","hexTopCurvatureResolution","hexTopColor","hexSideColor","hexAltitude","hexBinMerge","hexTransitionDuration"].map((function(e){return z_({},e,Px.linkProp(e))})))),Lx=iy("heatmapsLayer",Yy),Ix=Object.assign.apply(Object,Z_(["heatmapsData","heatmapPoints","heatmapPointLat","heatmapPointLng","heatmapPointWeight","heatmapBandwidth","heatmapColorFn","heatmapColorSaturation","heatmapBaseAltitude","heatmapTopAltitude","heatmapsTransitionDuration"].map((function(e){return z_({},e,Lx.linkProp(e))})))),Ux=iy("hexedPolygonsLayer",tx),Bx=Object.assign.apply(Object,Z_(["hexPolygonsData","hexPolygonGeoJsonGeometry","hexPolygonColor","hexPolygonAltitude","hexPolygonResolution","hexPolygonMargin","hexPolygonUseDots","hexPolygonCurvatureResolution","hexPolygonDotResolution","hexPolygonsTransitionDuration"].map((function(e){return z_({},e,Ux.linkProp(e))})))),Ox=iy("polygonsLayer",Ky),Fx=Object.assign.apply(Object,Z_(["polygonsData","polygonGeoJsonGeometry","polygonCapColor","polygonCapMaterial","polygonSideColor","polygonSideMaterial","polygonStrokeColor","polygonAltitude","polygonCapCurvatureResolution","polygonsTransitionDuration"].map((function(e){return z_({},e,Ox.linkProp(e))})))),kx=iy("pathsLayer",ax),qx=Object.assign.apply(Object,Z_(["pathsData","pathPoints","pathPointLat","pathPointLng","pathPointAlt","pathResolution","pathColor","pathStroke","pathDashLength","pathDashGap","pathDashInitialGap","pathDashAnimateTime","pathTransitionDuration"].map((function(e){return z_({},e,kx.linkProp(e))})))),Gx=iy("tilesLayer",lx),zx=Object.assign.apply(Object,Z_(["tilesData","tileLat","tileLng","tileAltitude","tileWidth","tileHeight","tileUseGlobeProjection","tileMaterial","tileCurvatureResolution","tilesTransitionDuration"].map((function(e){return z_({},e,Gx.linkProp(e))})))),Vx=iy("labelsLayer",hx),Hx=Object.assign.apply(Object,Z_(["labelsData","labelLat","labelLng","labelAltitude","labelRotation","labelText","labelSize","labelTypeFace","labelColor","labelResolution","labelIncludeDot","labelDotRadius","labelDotOrientation","labelsTransitionDuration"].map((function(e){return z_({},e,Vx.linkProp(e))})))),jx=iy("ringsLayer",mx),Wx=Object.assign.apply(Object,Z_(["ringsData","ringLat","ringLng","ringAltitude","ringColor","ringResolution","ringMaxRadius","ringPropagationSpeed","ringRepeatPeriod"].map((function(e){return z_({},e,jx.linkProp(e))})))),Xx=iy("htmlElementsLayer",vx),Qx=Object.assign.apply(Object,Z_(["htmlElementsData","htmlLat","htmlLng","htmlAltitude","htmlElement","htmlTransitionDuration"].map((function(e){return z_({},e,Xx.linkProp(e))})))),Yx=iy("objectsLayer",yx),$x=Object.assign.apply(Object,Z_(["objectsData","objectLat","objectLng","objectAltitude","objectRotation","objectFacesSurface","objectThreeObject"].map((function(e){return z_({},e,Yx.linkProp(e))})))),Kx=iy("customLayer",xx),Zx=Object.assign.apply(Object,Z_(["customLayerData","customThreeObject","customThreeObjectUpdate"].map((function(e){return z_({},e,Kx.linkProp(e))})))),Jx=xc({props:Q_(Q_(Q_(Q_(Q_(Q_(Q_(Q_(Q_(Q_(Q_(Q_(Q_(Q_({onGlobeReady:{triggerUpdate:!1},rendererSize:{default:new bx.Vector2(window.innerWidth,window.innerHeight),onChange:function(e,t){t.pathsLayer.rendererSize(e)},triggerUpdate:!1}},wx),Cx),Nx),Dx),Ix),Fx),Bx),qx),zx),Hx),Wx),Qx),$x),Zx),methods:Q_({getGlobeRadius:ay,getCoords:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return oy.apply(void 0,n)},toGeoCoords:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return ly.apply(void 0,n)},setPointOfView:function(e,t){var n=void 0;if(e.scene&&t){var r=t instanceof bx.Camera?t.position:t,i=ay(),s=new bx.Vector3;e.scene.getWorldPosition(s);var a,o,l,u=s?r.clone().sub(s):r;n=function(e){void 0===a&&(a=u.length()),void 0===o&&(o=Math.sqrt(Math.pow(a,2)-Math.pow(i,2))),void 0===l&&(l=Math.acos(o/a));var t=u.distanceTo(e);if(t<o)return!1;var n=e.length();return Math.acos((Math.pow(a,2)+Math.pow(t,2)-Math.pow(n,2))/(2*a*t))<l}}e.layersThatNeedBehindGlobeChecker.forEach((function(e){return e.isBehindGlobe(n)}))},pauseAnimation:function(e){return null!==e.animationFrameRequestId&&(cancelAnimationFrame(e.animationFrameRequestId),e.animationFrameRequestId=null),e.pausableLayers.forEach((function(e){var t;return null===(t=e.pauseAnimation)||void 0===t?void 0:t.call(e)})),this},resumeAnimation:function(e){return null===e.animationFrameRequestId&&this._animationCycle(),e.pausableLayers.forEach((function(e){var t;return null===(t=e.resumeAnimation)||void 0===t?void 0:t.call(e)})),this},_animationCycle:function(e){e.animationFrameRequestId=requestAnimationFrame(this._animationCycle),e.tweenGroup.update()},_destructor:function(e){this.pauseAnimation(),e.destructableLayers.forEach((function(e){return e._destructor()}))}},Mx),stateInit:function(){var e=new wc,t={tweenGroup:e},n={globeLayer:dy(t),pointsLayer:My(t),arcsLayer:Ly(t),hexBinLayer:Oy(t),heatmapsLayer:Yy(t),polygonsLayer:Ky(t),hexedPolygonsLayer:tx(t),pathsLayer:ax(t),tilesLayer:lx(t),labelsLayer:hx(t),ringsLayer:mx(t),htmlElementsLayer:vx(t),objectsLayer:yx(t),customLayer:xx(t)};return Q_(Q_({tweenGroup:e},n),{},{layersThatNeedBehindGlobeChecker:Object.values(n).filter((function(e){return e.hasOwnProperty("isBehindGlobe")})),destructableLayers:Object.values(n).filter((function(e){return e.hasOwnProperty("_destructor")})),pausableLayers:Object.values(n).filter((function(e){return e.hasOwnProperty("pauseAnimation")}))})},init:function(e,t,n){var r=n.animateIn,i=void 0===r||r,s=n.waitForGlobeReady,a=void 0===s||s;ry(e),t.scene=e,t.scene.visible=!1,Sx.forEach((function(e){var n=new bx.Group;t.scene.add(n),t[e](n)}));var o=function(){if(i){t.scene.scale.set(1e-6,1e-6,1e-6),t.tweenGroup.add(new Rc({k:1e-6}).to({k:1},600).easing(Sc.Quadratic.Out).onUpdate((function(e){var n=e.k;return t.scene.scale.set(n,n,n)})).start());var e=new bx.Vector3(0,1,0);t.tweenGroup.add(new Rc({rot:2*Math.PI}).to({rot:0},1200).easing(Sc.Quintic.Out).onUpdate((function(n){var r=n.rot;return t.scene.setRotationFromAxisAngle(e,r)})).start())}t.scene.visible=!0,t.onGlobeReady&&t.onGlobeReady()};a?t.globeLayer.onReady(o):o(),this._animationCycle()},update:function(e){}});var eb=function(e){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=function(n){function r(){var n;B_(this,r);for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return(n=I_(this,r,[].concat(s))).__kapsuleInstance=q_(e,[].concat(Z_(t?[n]:[]),s)),n}return j_(r,n),G_(r)}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object);return Object.keys(e()).forEach((function(e){return n.prototype[e]=function(){var t,n=(t=this.__kapsuleInstance)[e].apply(t,arguments);return n===this.__kapsuleInstance?this:n}})),n}(Jx,(window.THREE?window.THREE:{Group:ts}).Group,!0);const tb=["alphaMap","alphaTest","anisotropy","anisotropyMap","anisotropyRotation","aoMap","attenuationColor","attenuationDistance","bumpMap","clearcoat","clearcoatMap","clearcoatNormalMap","clearcoatNormalScale","clearcoatRoughness","color","dispersion","displacementMap","emissive","emissiveMap","envMap","gradientMap","ior","iridescence","iridescenceIOR","iridescenceMap","iridescenceThicknessMap","lightMap","map","matcap","metalness","metalnessMap","normalMap","normalScale","opacity","roughness","roughnessMap","sheen","sheenColor","sheenColorMap","sheenRoughnessMap","shininess","specular","specularColor","specularColorMap","specularIntensity","specularIntensityMap","specularMap","thickness","transmission","transmissionMap"];class nb{constructor(e){this.renderObjects=new WeakMap,this.hasNode=this.containsNode(e),this.hasAnimation=!0===e.object.isSkinnedMesh,this.refreshUniforms=tb,this.renderId=0}firstInitialization(e){return!1===this.renderObjects.has(e)&&(this.getRenderObjectData(e),!0)}getRenderObjectData(e){let t=this.renderObjects.get(e);if(void 0===t){const{geometry:n,material:r,object:i}=e;if(t={material:this.getMaterialData(r),geometry:{attributes:this.getAttributesData(n.attributes),indexVersion:n.index?n.index.version:null,drawRange:{start:n.drawRange.start,count:n.drawRange.count}},worldMatrix:i.matrixWorld.clone()},i.center&&(t.center=i.center.clone()),i.morphTargetInfluences&&(t.morphTargetInfluences=i.morphTargetInfluences.slice()),null!==e.bundle&&(t.version=e.bundle.version),t.material.transmission>0){const{width:n,height:r}=e.context;t.bufferWidth=n,t.bufferHeight=r}this.renderObjects.set(e,t)}return t}getAttributesData(e){const t={};for(const n in e){const r=e[n];t[n]={version:r.version}}return t}containsNode(e){const t=e.material;for(const e in t)if(t[e]&&t[e].isNode)return!0;return null!==e.renderer.nodes.modelViewMatrix||null!==e.renderer.nodes.modelNormalViewMatrix}getMaterialData(e){const t={};for(const n of this.refreshUniforms){const r=e[n];null!=r&&("object"==typeof r&&void 0!==r.clone?!0===r.isTexture?t[n]={id:r.id,version:r.version}:t[n]=r.clone():t[n]=r)}return t}equals(e){const{object:t,material:n,geometry:r}=e,i=this.getRenderObjectData(e);if(!0!==i.worldMatrix.equals(t.matrixWorld))return i.worldMatrix.copy(t.matrixWorld),!1;const s=i.material;for(const e in s){const t=s[e],r=n[e];if(void 0!==t.equals){if(!1===t.equals(r))return t.copy(r),!1}else if(!0===r.isTexture){if(t.id!==r.id||t.version!==r.version)return t.id=r.id,t.version=r.version,!1}else if(t!==r)return s[e]=r,!1}if(s.transmission>0){const{width:t,height:n}=e.context;if(i.bufferWidth!==t||i.bufferHeight!==n)return i.bufferWidth=t,i.bufferHeight=n,!1}const a=i.geometry,o=r.attributes,l=a.attributes,u=Object.keys(l),c=Object.keys(o);if(u.length!==c.length)return i.geometry.attributes=this.getAttributesData(o),!1;for(const e of u){const t=l[e],n=o[e];if(void 0===n)return delete l[e],!1;if(t.version!==n.version)return t.version=n.version,!1}const A=r.index,h=a.indexVersion,d=A?A.version:null;if(h!==d)return a.indexVersion=d,!1;if(a.drawRange.start!==r.drawRange.start||a.drawRange.count!==r.drawRange.count)return a.drawRange.start=r.drawRange.start,a.drawRange.count=r.drawRange.count,!1;if(i.morphTargetInfluences){let e=!1;for(let n=0;n<i.morphTargetInfluences.length;n++)i.morphTargetInfluences[n]!==t.morphTargetInfluences[n]&&(e=!0);if(e)return!0}return i.center&&!1===i.center.equals(t.center)?(i.center.copy(t.center),!0):(null!==e.bundle&&(i.version=e.bundle.version),!0)}needsRefresh(e,t){if(this.hasNode||this.hasAnimation||this.firstInitialization(e))return!0;const{renderId:n}=t;if(this.renderId!==n)return this.renderId=n,!0;const r=!0===e.object.static,i=null!==e.bundle&&!0===e.bundle.static&&this.getRenderObjectData(e).version===e.bundle.version;if(r||i)return!1;return!0!==this.equals(e)}}function rb(e,t=0){let n=3735928559^t,r=1103547991^t;if(e instanceof Array)for(let t,i=0;i<e.length;i++)t=e[i],n=Math.imul(n^t,2654435761),r=Math.imul(r^t,1597334677);else for(let t,i=0;i<e.length;i++)t=e.charCodeAt(i),n=Math.imul(n^t,2654435761),r=Math.imul(r^t,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),4294967296*(2097151&r)+(n>>>0)}const ib=e=>rb(e),sb=(...e)=>rb(e);function ab(e,t=!1){const n=[];!0===e.isNode&&(n.push(e.id),e=e.getSelf());for(const{property:r,childNode:i}of ob(e))n.push(n,rb(r.slice(0,-4)),i.getCacheKey(t));return rb(n)}function*ob(e,t=!1){for(const n in e){if(!0===n.startsWith("_"))continue;const r=e[n];if(!0===Array.isArray(r))for(let e=0;e<r.length;e++){const i=r[e];i&&(!0===i.isNode||t&&"function"==typeof i.toJSON)&&(yield{property:n,index:e,childNode:i})}else if(r&&!0===r.isNode)yield{property:n,childNode:r};else if("object"==typeof r)for(const e in r){const i=r[e];i&&(!0===i.isNode||t&&"function"==typeof i.toJSON)&&(yield{property:n,index:e,childNode:i})}}}const lb=new Map([[1,"float"],[2,"vec2"],[3,"vec3"],[4,"vec4"],[9,"mat3"],[16,"mat4"]]);function ub(e){if(null==e)return null;const t=typeof e;return!0===e.isNode?"node":"number"===t?"float":"boolean"===t?"bool":"string"===t?"string":"function"===t?"shader":!0===e.isVector2?"vec2":!0===e.isVector3?"vec3":!0===e.isVector4?"vec4":!0===e.isMatrix3?"mat3":!0===e.isMatrix4?"mat4":!0===e.isColor?"color":e instanceof ArrayBuffer?"ArrayBuffer":null}function cb(e,...t){const n=e?e.slice(-4):void 0;return 1===t.length&&("vec2"===n?t=[t[0],t[0]]:"vec3"===n?t=[t[0],t[0],t[0]]:"vec4"===n&&(t=[t[0],t[0],t[0],t[0]])),"color"===e?new Rr(...t):"vec2"===n?new Lt(...t):"vec3"===n?new on(...t):"vec4"===n?new en(...t):"mat3"===n?new It(...t):"mat4"===n?new On(...t):"bool"===e?t[0]||!1:"float"===e||"int"===e||"uint"===e?t[0]||0:"string"===e?t[0]||"":"ArrayBuffer"===e?(r=t[0],Uint8Array.from(atob(r),(e=>e.charCodeAt(0))).buffer):null;var r}const Ab="vertex",hb="none",db="frame",pb="render",fb="object",mb="readOnly",gb="writeOnly",vb="readWrite",_b=["setup","analyze","generate"],yb=["fragment","vertex","compute"],xb=["x","y","z","w"];let bb=0;class Sb extends xt{static get type(){return"Node"}constructor(e=null){super(),this.nodeType=e,this.updateType=hb,this.updateBeforeType=hb,this.updateAfterType=hb,this.uuid=Dt.generateUUID(),this.version=0,this._cacheKey=null,this._cacheKeyVersion=0,this.global=!1,this.isNode=!0,Object.defineProperty(this,"id",{value:bb++})}set needsUpdate(e){!0===e&&this.version++}get type(){return this.constructor.type}onUpdate(e,t){return this.updateType=t,this.update=e.bind(this.getSelf()),this}onFrameUpdate(e){return this.onUpdate(e,db)}onRenderUpdate(e){return this.onUpdate(e,pb)}onObjectUpdate(e){return this.onUpdate(e,fb)}onReference(e){return this.updateReference=e.bind(this.getSelf()),this}getSelf(){return this.self||this}updateReference(){return this}isGlobal(){return this.global}*getChildren(){for(const{childNode:e}of ob(this))yield e}dispose(){this.dispatchEvent({type:"dispose"})}traverse(e){e(this);for(const t of this.getChildren())t.traverse(e)}getCacheKey(e=!1){return!0!==(e=e||this.version!==this._cacheKeyVersion)&&null!==this._cacheKey||(this._cacheKey=ab(this,e),this._cacheKeyVersion=this.version),this._cacheKey}getScope(){return this}getHash(){return this.uuid}getUpdateType(){return this.updateType}getUpdateBeforeType(){return this.updateBeforeType}getUpdateAfterType(){return this.updateAfterType}getElementType(e){const t=this.getNodeType(e);return e.getElementType(t)}getNodeType(e){const t=e.getNodeProperties(this);return t.outputNode?t.outputNode.getNodeType(e):this.nodeType}getShared(e){const t=this.getHash(e);return e.getNodeFromHash(t)||this}setup(e){const t=e.getNodeProperties(this);let n=0;for(const e of this.getChildren())t["node"+n++]=e;return null}analyze(e){if(1===e.increaseUsage(this)){const t=e.getNodeProperties(this);for(const n of Object.values(t))n&&!0===n.isNode&&n.build(e)}}generate(e,t){const{outputNode:n}=e.getNodeProperties(this);if(n&&!0===n.isNode)return n.build(e,t)}updateBefore(){console.warn("Abstract function.")}updateAfter(){console.warn("Abstract function.")}update(){console.warn("Abstract function.")}build(e,t=null){const n=this.getShared(e);if(this!==n)return n.build(e,t);e.addNode(this),e.addChain(this);let r=null;const i=e.getBuildStage();if("setup"===i){this.updateReference(e);const t=e.getNodeProperties(this);if(!0!==t.initialized){e.stack.nodes.length;t.initialized=!0,t.outputNode=this.setup(e),null!==t.outputNode&&e.stack.nodes.length;for(const n of Object.values(t))n&&!0===n.isNode&&n.build(e)}}else if("analyze"===i)this.analyze(e);else if("generate"===i){if(1===this.generate.length){const n=this.getNodeType(e),i=e.getDataFromNode(this);r=i.snippet,void 0===r?(r=this.generate(e)||"",i.snippet=r):void 0!==i.flowCodes&&void 0!==e.context.nodeBlock&&e.addFlowCodeHierarchy(this,e.context.nodeBlock),r=e.format(r,n,t)}else r=this.generate(e,t)||""}return e.removeChain(this),e.addSequentialNode(this),r}getSerializeChildren(){return ob(this)}serialize(e){const t=this.getSerializeChildren(),n={};for(const{property:r,index:i,childNode:s}of t)void 0!==i?(void 0===n[r]&&(n[r]=Number.isInteger(i)?[]:{}),n[r][i]=s.toJSON(e.meta).uuid):n[r]=s.toJSON(e.meta).uuid;Object.keys(n).length>0&&(e.inputNodes=n)}deserialize(e){if(void 0!==e.inputNodes){const t=e.meta.nodes;for(const n in e.inputNodes)if(Array.isArray(e.inputNodes[n])){const r=[];for(const i of e.inputNodes[n])r.push(t[i]);this[n]=r}else if("object"==typeof e.inputNodes[n]){const r={};for(const i in e.inputNodes[n]){const s=e.inputNodes[n][i];r[i]=t[s]}this[n]=r}else{const r=e.inputNodes[n];this[n]=t[r]}}}toJSON(e){const{uuid:t,type:n}=this,r=void 0===e||"string"==typeof e;r&&(e={textures:{},images:{},nodes:{}});let i=e.nodes[t];function s(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}if(void 0===i&&(i={uuid:t,type:n,meta:e,metadata:{version:4.6,type:"Node",generator:"Node.toJSON"}},!0!==r&&(e.nodes[i.uuid]=i),this.serialize(i),delete i.meta),r){const t=s(e.textures),n=s(e.images),r=s(e.nodes);t.length>0&&(i.textures=t),n.length>0&&(i.images=n),r.length>0&&(i.nodes=r)}return i}}class Tb extends Sb{static get type(){return"ArrayElementNode"}constructor(e,t){super(),this.node=e,this.indexNode=t,this.isArrayElementNode=!0}getNodeType(e){return this.node.getElementType(e)}generate(e){return`${this.node.build(e)}[ ${this.indexNode.build(e,"uint")} ]`}}class wb extends Sb{static get type(){return"ConvertNode"}constructor(e,t){super(),this.node=e,this.convertTo=t}getNodeType(e){const t=this.node.getNodeType(e);let n=null;for(const r of this.convertTo.split("|"))null!==n&&e.getTypeLength(t)!==e.getTypeLength(r)||(n=r);return n}serialize(e){super.serialize(e),e.convertTo=this.convertTo}deserialize(e){super.deserialize(e),this.convertTo=e.convertTo}generate(e,t){const n=this.node,r=this.getNodeType(e),i=n.build(e,r);return e.format(i,r,t)}}class Mb extends Sb{static get type(){return"TempNode"}constructor(e){super(e),this.isTempNode=!0}hasDependencies(e){return e.getDataFromNode(this).usageCount>1}build(e,t){if("generate"===e.getBuildStage()){const n=e.getVectorType(this.getNodeType(e,t)),r=e.getDataFromNode(this);if(void 0!==r.propertyName)return e.format(r.propertyName,n,t);if("void"!==n&&"void"!==t&&this.hasDependencies(e)){const i=super.build(e,n),s=e.getVarFromNode(this,null,n),a=e.getPropertyName(s);return e.addLineFlowCode(`${a} = ${i}`,this),r.snippet=i,r.propertyName=a,e.format(r.propertyName,n,t)}}return super.build(e,t)}}class Eb extends Mb{static get type(){return"JoinNode"}constructor(e=[],t=null){super(t),this.nodes=e}getNodeType(e){return null!==this.nodeType?e.getVectorType(this.nodeType):e.getTypeFromLength(this.nodes.reduce(((t,n)=>t+e.getTypeLength(n.getNodeType(e))),0))}generate(e,t){const n=this.getNodeType(e),r=this.nodes,i=e.getComponentType(n),s=[];for(const t of r){let n=t.build(e);const r=e.getComponentType(t.getNodeType(e));r!==i&&(n=e.format(n,r,i)),s.push(n)}const a=`${e.getType(n)}( ${s.join(", ")} )`;return e.format(a,n,t)}}const Cb=xb.join("");class Rb extends Sb{static get type(){return"SplitNode"}constructor(e,t="x"){super(),this.node=e,this.components=t,this.isSplitNode=!0}getVectorLength(){let e=this.components.length;for(const t of this.components)e=Math.max(xb.indexOf(t)+1,e);return e}getComponentType(e){return e.getComponentType(this.node.getNodeType(e))}getNodeType(e){return e.getTypeFromLength(this.components.length,this.getComponentType(e))}generate(e,t){const n=this.node,r=e.getTypeLength(n.getNodeType(e));let i=null;if(r>1){let s=null;this.getVectorLength()>=r&&(s=e.getTypeFromLength(this.getVectorLength(),this.getComponentType(e)));const a=n.build(e,s);i=this.components.length===r&&this.components===Cb.slice(0,this.components.length)?e.format(a,s,t):e.format(`${a}.${this.components}`,this.getNodeType(e),t)}else i=n.build(e,t);return i}serialize(e){super.serialize(e),e.components=this.components}deserialize(e){super.deserialize(e),this.components=e.components}}class Nb extends Mb{static get type(){return"SetNode"}constructor(e,t,n){super(),this.sourceNode=e,this.components=t,this.targetNode=n}getNodeType(e){return this.sourceNode.getNodeType(e)}generate(e){const{sourceNode:t,components:n,targetNode:r}=this,i=this.getNodeType(e),s=e.getTypeFromLength(n.length,r.getNodeType(e)),a=r.build(e,s),o=t.build(e,i),l=e.getTypeLength(i),u=[];for(let e=0;e<l;e++){const t=xb[e];t===n[0]?(u.push(a),e+=n.length-1):u.push(o+"."+t)}return`${e.getType(i)}( ${u.join(", ")} )`}}class Pb extends Mb{static get type(){return"FlipNode"}constructor(e,t){super(),this.sourceNode=e,this.components=t}getNodeType(e){return this.sourceNode.getNodeType(e)}generate(e){const{components:t,sourceNode:n}=this,r=this.getNodeType(e),i=n.build(e),s=e.getVarFromNode(this),a=e.getPropertyName(s);e.addLineFlowCode(a+" = "+i,this);const o=e.getTypeLength(r),l=[];let u=0;for(let e=0;e<o;e++){const n=xb[e];n===t[u]?(l.push("1.0 - "+a+"."+n),u++):l.push(a+"."+n)}return`${e.getType(r)}( ${l.join(", ")} )`}}class Db extends Sb{static get type(){return"InputNode"}constructor(e,t=null){super(t),this.isInputNode=!0,this.value=e,this.precision=null}getNodeType(){return null===this.nodeType?ub(this.value):this.nodeType}getInputType(e){return this.getNodeType(e)}setPrecision(e){return this.precision=e,this}serialize(e){super.serialize(e),e.value=this.value,this.value&&this.value.toArray&&(e.value=this.value.toArray()),e.valueType=ub(this.value),e.nodeType=this.nodeType,"ArrayBuffer"===e.valueType&&(e.value=function(e){let t="";const n=new Uint8Array(e);for(let e=0;e<n.length;e++)t+=String.fromCharCode(n[e]);return btoa(t)}(e.value)),e.precision=this.precision}deserialize(e){super.deserialize(e),this.nodeType=e.nodeType,this.value=Array.isArray(e.value)?cb(e.valueType,...e.value):e.value,this.precision=e.precision||null,this.value&&this.value.fromArray&&(this.value=this.value.fromArray(e.value))}generate(){console.warn("Abstract function.")}}class Lb extends Db{static get type(){return"ConstNode"}constructor(e,t=null){super(e,t),this.isConstNode=!0}generateConst(e){return e.generateConst(this.getNodeType(e),this.value)}generate(e,t){const n=this.getNodeType(e);return e.format(this.generateConst(e),n,t)}}let Ib=null;const Ub=new Map;function Bb(e,t){if(Ub.has(e))console.warn(`Redefinition of method chaining ${e}`);else{if("function"!=typeof t)throw new Error(`Node element ${e} is not a function`);Ub.set(e,t)}}const Ob=e=>e.replace(/r|s/g,"x").replace(/g|t/g,"y").replace(/b|p/g,"z").replace(/a|q/g,"w"),Fb=e=>Ob(e).split("").sort().join(""),kb={setup(e,t){const n=t.shift();return e(uS(n),...t)},get(e,t,n){if("string"==typeof t&&void 0===e[t]){if(!0!==e.isStackNode&&"assign"===t)return(...e)=>(Ib.assign(n,...e),n);if(Ub.has(t)){const r=Ub.get(t);return e.isStackNode?(...e)=>n.add(r(...e)):(...e)=>r(n,...e)}if("self"===t)return e;if(t.endsWith("Assign")&&Ub.has(t.slice(0,t.length-6))){const r=Ub.get(t.slice(0,t.length-6));return e.isStackNode?(...e)=>n.assign(e[0],r(...e)):(...e)=>n.assign(r(n,...e))}if(!0===/^[xyzwrgbastpq]{1,4}$/.test(t))return t=Ob(t),lS(new Rb(n,t));if(!0===/^set[XYZWRGBASTPQ]{1,4}$/.test(t))return t=Fb(t.slice(3).toLowerCase()),n=>lS(new Nb(e,t,n));if(!0===/^flip[XYZWRGBASTPQ]{1,4}$/.test(t))return t=Fb(t.slice(4).toLowerCase()),()=>lS(new Pb(lS(e),t));if("width"===t||"height"===t||"depth"===t)return"width"===t?t="x":"height"===t?t="y":"depth"===t&&(t="z"),lS(new Rb(e,t));if(!0===/^\d+$/.test(t))return lS(new Tb(n,new Lb(Number(t),"uint")))}return Reflect.get(e,t,n)},set:(e,t,n,r)=>"string"!=typeof t||void 0!==e[t]||!0!==/^[xyzwrgbastpq]{1,4}$/.test(t)&&"width"!==t&&"height"!==t&&"depth"!==t&&!0!==/^\d+$/.test(t)?Reflect.set(e,t,n,r):(r[t].assign(n),!0)},qb=new WeakMap,Gb=new WeakMap,zb=function(e,t=null){for(const n in e)e[n]=lS(e[n],t);return e},Vb=function(e,t=null){const n=e.length;for(let r=0;r<n;r++)e[r]=lS(e[r],t);return e},Hb=function(e,t=null,n=null,r=null){const i=e=>lS(null!==r?Object.assign(e,r):e);return null===t?(...t)=>i(new e(...cS(t))):null!==n?(n=lS(n),(...r)=>i(new e(t,...cS(r),n))):(...n)=>i(new e(t,...cS(n)))},jb=function(e,...t){return lS(new e(...cS(t)))};class Wb extends Sb{constructor(e,t){super(),this.shaderNode=e,this.inputNodes=t}getNodeType(e){return this.shaderNode.nodeType||this.getOutputNode(e).getNodeType(e)}call(e){const{shaderNode:t,inputNodes:n}=this,r=e.getNodeProperties(t);if(r.onceOutput)return r.onceOutput;let i=null;if(t.layout){let r=Gb.get(e.constructor);void 0===r&&(r=new WeakMap,Gb.set(e.constructor,r));let s=r.get(t);void 0===s&&(s=lS(e.buildFunctionNode(t)),r.set(t,s)),null!==e.currentFunctionNode&&e.currentFunctionNode.includes.push(s),i=lS(s.call(n))}else{const r=t.jsFunc,s=null!==n?r(n,e):r(e);i=lS(s)}return t.once&&(r.onceOutput=i),i}getOutputNode(e){const t=e.getNodeProperties(this);return null===t.outputNode&&(t.outputNode=this.setupOutput(e)),t.outputNode}setup(e){return this.getOutputNode(e)}setupOutput(e){return e.addStack(),e.stack.outputNode=this.call(e),e.removeStack()}generate(e,t){return this.getOutputNode(e).build(e,t)}}class Xb extends Sb{constructor(e,t){super(t),this.jsFunc=e,this.layout=null,this.global=!0,this.once=!1}setLayout(e){return this.layout=e,this}call(e=null){return uS(e),lS(new Wb(this,e))}setup(){return this.call()}}const Qb=[!1,!0],Yb=[0,1,2,3],$b=[-1,-2],Kb=[.5,1.5,1/3,1e-6,1e6,Math.PI,2*Math.PI,1/Math.PI,2/Math.PI,1/(2*Math.PI),Math.PI/2],Zb=new Map;for(const e of Qb)Zb.set(e,new Lb(e));const Jb=new Map;for(const e of Yb)Jb.set(e,new Lb(e,"uint"));const eS=new Map([...Jb].map((e=>new Lb(e.value,"int"))));for(const e of $b)eS.set(e,new Lb(e,"int"));const tS=new Map([...eS].map((e=>new Lb(e.value))));for(const e of Kb)tS.set(e,new Lb(e));for(const e of Kb)tS.set(-e,new Lb(-e));const nS={bool:Zb,uint:Jb,ints:eS,float:tS},rS=new Map([...Zb,...tS]),iS=(e,t)=>rS.has(e)?rS.get(e):!0===e.isNode?e:new Lb(e,t),sS=function(e,t=null){return(...n)=>{if((0===n.length||!["bool","float","int","uint"].includes(e)&&n.every((e=>"object"!=typeof e)))&&(n=[cb(e,...n)]),1===n.length&&null!==t&&t.has(n[0]))return lS(t.get(n[0]));if(1===n.length){const t=iS(n[0],e);return(e=>{try{return e.getNodeType()}catch(e){return}})(t)===e?lS(t):lS(new wb(t,e))}const r=n.map((e=>iS(e)));return lS(new Eb(r,e))}},aS=e=>"object"==typeof e&&null!==e?e.value:e;function oS(e,t){return new Proxy(new Xb(e,t),kb)}const lS=(e,t=null)=>function(e,t=null){const n=ub(e);if("node"===n){let t=qb.get(e);return void 0===t&&(t=new Proxy(e,kb),qb.set(e,t),qb.set(t,t)),t}return null===t&&("float"===n||"boolean"===n)||n&&"shader"!==n&&"string"!==n?lS(iS(e,t)):"shader"===n?dS(e):e}(e,t),uS=(e,t=null)=>new zb(e,t),cS=(e,t=null)=>new Vb(e,t),AS=(...e)=>new Hb(...e),hS=(...e)=>new jb(...e),dS=(e,t)=>{const n=new oS(e,t),r=(...e)=>{let t;return uS(e),t=e[0]&&e[0].isNode?[...e]:e[0],n.call(t)};return r.shaderNode=n,r.setLayout=e=>(n.setLayout(e),r),r.once=()=>(n.once=!0,r),r};Bb("toGlobal",(e=>(e.global=!0,e)));const pS=e=>{Ib=e},fS=()=>Ib,mS=(...e)=>Ib.If(...e);Bb("append",(function(e){return Ib&&Ib.add(e),e}));const gS=new sS("color"),vS=new sS("float",nS.float),_S=new sS("int",nS.ints),yS=new sS("uint",nS.uint),xS=new sS("bool",nS.bool),bS=new sS("vec2"),SS=new sS("ivec2"),TS=new sS("uvec2"),wS=new sS("bvec2"),MS=new sS("vec3"),ES=new sS("ivec3"),CS=new sS("uvec3"),RS=new sS("bvec3"),NS=new sS("vec4"),PS=new sS("ivec4"),DS=new sS("uvec4"),LS=new sS("bvec4"),IS=new sS("mat2"),US=new sS("mat3"),BS=new sS("mat4");Bb("toColor",gS),Bb("toFloat",vS),Bb("toInt",_S),Bb("toUint",yS),Bb("toBool",xS),Bb("toVec2",bS),Bb("toIVec2",SS),Bb("toUVec2",TS),Bb("toBVec2",wS),Bb("toVec3",MS),Bb("toIVec3",ES),Bb("toUVec3",CS),Bb("toBVec3",RS),Bb("toVec4",NS),Bb("toIVec4",PS),Bb("toUVec4",DS),Bb("toBVec4",LS),Bb("toMat2",IS),Bb("toMat3",US),Bb("toMat4",BS);Bb("element",AS(Tb)),Bb("convert",((e,t)=>lS(new wb(lS(e),t))));class OS extends Sb{static get type(){return"UniformGroupNode"}constructor(e,t=!1,n=1){super("string"),this.name=e,this.version=0,this.shared=t,this.order=n,this.isUniformGroup=!0}set needsUpdate(e){!0===e&&this.version++}serialize(e){super.serialize(e),e.name=this.name,e.version=this.version,e.shared=this.shared}deserialize(e){super.deserialize(e),this.name=e.name,this.version=e.version,this.shared=e.shared}}const FS=e=>new OS(e),kS=(e,t=0)=>new OS(e,!0,t),qS=kS("frame"),GS=kS("render"),zS=FS("object");class VS extends Db{static get type(){return"UniformNode"}constructor(e,t=null){super(e,t),this.isUniformNode=!0,this.name="",this.groupNode=zS}label(e){return this.name=e,this}setGroup(e){return this.groupNode=e,this}getGroup(){return this.groupNode}getUniformHash(e){return this.getHash(e)}onUpdate(e,t){const n=this.getSelf();return e=e.bind(n),super.onUpdate((t=>{const r=e(t,n);void 0!==r&&(this.value=r)}),t)}generate(e,t){const n=this.getNodeType(e),r=this.getUniformHash(e);let i=e.getNodeFromHash(r);void 0===i&&(e.setHashNode(this,r),i=this);const s=i.getInputType(e),a=e.getUniformFromNode(i,s,e.shaderStage,this.name||e.context.label),o=e.getPropertyName(a);return void 0!==e.context.label&&delete e.context.label,e.format(o,n,t)}}const HS=(e,t)=>{const n=(e=>null!=e?e.nodeType||e.convertTo||("string"==typeof e?e:null):null)(t||e),r=e&&!0===e.isNode?e.node&&e.node.value||e.value:e;return lS(new VS(r,n))};class jS extends Sb{static get type(){return"PropertyNode"}constructor(e,t=null,n=!1){super(e),this.name=t,this.varying=n,this.isPropertyNode=!0}getHash(e){return this.name||super.getHash(e)}isGlobal(){return!0}generate(e){let t;return!0===this.varying?(t=e.getVaryingFromNode(this,this.name),t.needsInterpolation=!0):t=e.getVarFromNode(this,this.name),e.getPropertyName(t)}}const WS=(e,t)=>lS(new jS(e,t,!0)),XS=hS(jS,"vec4","DiffuseColor"),QS=hS(jS,"vec3","EmissiveColor"),YS=hS(jS,"float","Roughness"),$S=hS(jS,"float","Metalness"),KS=hS(jS,"float","Clearcoat"),ZS=hS(jS,"float","ClearcoatRoughness"),JS=hS(jS,"vec3","Sheen"),eT=hS(jS,"float","SheenRoughness"),tT=hS(jS,"float","Iridescence"),nT=hS(jS,"float","IridescenceIOR"),rT=hS(jS,"float","IridescenceThickness"),iT=hS(jS,"float","AlphaT"),sT=hS(jS,"float","Anisotropy"),aT=hS(jS,"vec3","AnisotropyT"),oT=hS(jS,"vec3","AnisotropyB"),lT=hS(jS,"color","SpecularColor"),uT=hS(jS,"float","SpecularF90"),cT=hS(jS,"float","Shininess"),AT=hS(jS,"vec4","Output"),hT=hS(jS,"float","dashSize"),dT=hS(jS,"float","gapSize"),pT=hS(jS,"float","IOR"),fT=hS(jS,"float","Transmission"),mT=hS(jS,"float","Thickness"),gT=hS(jS,"float","AttenuationDistance"),vT=hS(jS,"color","AttenuationColor"),_T=hS(jS,"float","Dispersion");class yT extends Mb{static get type(){return"AssignNode"}constructor(e,t){super(),this.targetNode=e,this.sourceNode=t}hasDependencies(){return!1}getNodeType(e,t){return"void"!==t?this.targetNode.getNodeType(e):"void"}needsSplitAssign(e){const{targetNode:t}=this;if(!1===e.isAvailable("swizzleAssign")&&t.isSplitNode&&t.components.length>1){const n=e.getTypeLength(t.node.getNodeType(e));return xb.join("").slice(0,n)!==t.components}return!1}generate(e,t){const{targetNode:n,sourceNode:r}=this,i=this.needsSplitAssign(e),s=n.getNodeType(e),a=n.context({assign:!0}).build(e),o=r.build(e,s),l=r.getNodeType(e),u=e.getDataFromNode(this);let c;if(!0===u.initialized)"void"!==t&&(c=a);else if(i){const r=e.getVarFromNode(this,null,s),i=e.getPropertyName(r);e.addLineFlowCode(`${i} = ${o}`,this);const l=n.node.context({assign:!0}).build(e);for(let t=0;t<n.components.length;t++){const r=n.components[t];e.addLineFlowCode(`${l}.${r} = ${i}[ ${t} ]`,this)}"void"!==t&&(c=a)}else c=`${a} = ${o}`,"void"!==t&&"void"!==l||(e.addLineFlowCode(c,this),"void"!==t&&(c=a));return u.initialized=!0,e.format(c,s,t)}}Bb("assign",AS(yT));class xT extends Mb{static get type(){return"FunctionCallNode"}constructor(e=null,t={}){super(),this.functionNode=e,this.parameters=t}setParameters(e){return this.parameters=e,this}getParameters(){return this.parameters}getNodeType(e){return this.functionNode.getNodeType(e)}generate(e){const t=[],n=this.functionNode,r=n.getInputs(e),i=this.parameters,s=(t,n)=>{const r=n.type;let i;return i="pointer"===r?"&"+t.build(e):t.build(e,r),i};if(Array.isArray(i))for(let e=0;e<i.length;e++)t.push(s(i[e],r[e]));else for(const e of r){const n=i[e.name];if(void 0===n)throw new Error(`FunctionCallNode: Input '${e.name}' not found in FunctionNode.`);t.push(s(n,e))}return`${n.build(e,"property")}( ${t.join(", ")} )`}}Bb("call",((e,...t)=>(t=t.length>1||t[0]&&!0===t[0].isNode?cS(t):uS(t[0]),lS(new xT(lS(e),t)))));class bT extends Mb{static get type(){return"OperatorNode"}constructor(e,t,n,...r){if(super(),r.length>0){let i=new bT(e,t,n);for(let t=0;t<r.length-1;t++)i=new bT(e,i,r[t]);t=i,n=r[r.length-1]}this.op=e,this.aNode=t,this.bNode=n}getNodeType(e,t){const n=this.op,r=this.aNode,i=this.bNode,s=r.getNodeType(e),a=void 0!==i?i.getNodeType(e):null;if("void"===s||"void"===a)return"void";if("%"===n)return s;if("~"===n||"&"===n||"|"===n||"^"===n||">>"===n||"<<"===n)return e.getIntegerType(s);if("!"===n||"=="===n||"&&"===n||"||"===n||"^^"===n)return"bool";if("<"===n||">"===n||"<="===n||">="===n){const n=t?e.getTypeLength(t):Math.max(e.getTypeLength(s),e.getTypeLength(a));return n>1?`bvec${n}`:"bool"}return"float"===s&&e.isMatrix(a)?a:e.isMatrix(s)&&e.isVector(a)?e.getVectorFromMatrix(s):e.isVector(s)&&e.isMatrix(a)?e.getVectorFromMatrix(a):e.getTypeLength(a)>e.getTypeLength(s)?a:s}generate(e,t){const n=this.op,r=this.aNode,i=this.bNode,s=this.getNodeType(e,t);let a=null,o=null;"void"!==s?(a=r.getNodeType(e),o=void 0!==i?i.getNodeType(e):null,"<"===n||">"===n||"<="===n||">="===n||"=="===n?e.isVector(a)?o=a:a!==o&&(a=o="float"):">>"===n||"<<"===n?(a=s,o=e.changeComponentType(o,"uint")):e.isMatrix(a)&&e.isVector(o)?o=e.getVectorFromMatrix(a):a=e.isVector(a)&&e.isMatrix(o)?e.getVectorFromMatrix(o):o=s):a=o=s;const l=r.build(e,a),u=void 0!==i?i.build(e,o):null,c=e.getTypeLength(t),A=e.getFunctionOperator(n);return"void"!==t?"<"===n&&c>1?e.useComparisonMethod?e.format(`${e.getMethod("lessThan",t)}( ${l}, ${u} )`,s,t):e.format(`( ${l} < ${u} )`,s,t):"<="===n&&c>1?e.useComparisonMethod?e.format(`${e.getMethod("lessThanEqual",t)}( ${l}, ${u} )`,s,t):e.format(`( ${l} <= ${u} )`,s,t):">"===n&&c>1?e.useComparisonMethod?e.format(`${e.getMethod("greaterThan",t)}( ${l}, ${u} )`,s,t):e.format(`( ${l} > ${u} )`,s,t):">="===n&&c>1?e.useComparisonMethod?e.format(`${e.getMethod("greaterThanEqual",t)}( ${l}, ${u} )`,s,t):e.format(`( ${l} >= ${u} )`,s,t):"!"===n||"~"===n?e.format(`(${n}${l})`,a,t):A?e.format(`${A}( ${l}, ${u} )`,s,t):e.format(`( ${l} ${n} ${u} )`,s,t):"void"!==a?A?e.format(`${A}( ${l}, ${u} )`,s,t):e.format(`${l} ${n} ${u}`,s,t):void 0}serialize(e){super.serialize(e),e.op=this.op}deserialize(e){super.deserialize(e),this.op=e.op}}const ST=AS(bT,"+"),TT=AS(bT,"-"),wT=AS(bT,"*"),MT=AS(bT,"/"),ET=AS(bT,"%"),CT=AS(bT,"=="),RT=AS(bT,"!="),NT=AS(bT,"<"),PT=AS(bT,">"),DT=AS(bT,"<="),LT=AS(bT,">="),IT=AS(bT,"&&"),UT=AS(bT,"||"),BT=AS(bT,"!"),OT=AS(bT,"^^"),FT=AS(bT,"&"),kT=AS(bT,"~"),qT=AS(bT,"|"),GT=AS(bT,"^"),zT=AS(bT,"<<"),VT=AS(bT,">>");Bb("add",ST),Bb("sub",TT),Bb("mul",wT),Bb("div",MT),Bb("modInt",ET),Bb("equal",CT),Bb("notEqual",RT),Bb("lessThan",NT),Bb("greaterThan",PT),Bb("lessThanEqual",DT),Bb("greaterThanEqual",LT),Bb("and",IT),Bb("or",UT),Bb("not",BT),Bb("xor",OT),Bb("bitAnd",FT),Bb("bitNot",kT),Bb("bitOr",qT),Bb("bitXor",GT),Bb("shiftLeft",zT),Bb("shiftRight",VT);Bb("remainder",((...e)=>(console.warn("TSL.OperatorNode: .remainder() has been renamed to .modInt()."),ET(...e))));class HT extends Mb{static get type(){return"MathNode"}constructor(e,t,n=null,r=null){super(),this.method=e,this.aNode=t,this.bNode=n,this.cNode=r}getInputType(e){const t=this.aNode.getNodeType(e),n=this.bNode?this.bNode.getNodeType(e):null,r=this.cNode?this.cNode.getNodeType(e):null,i=e.isMatrix(t)?0:e.getTypeLength(t),s=e.isMatrix(n)?0:e.getTypeLength(n),a=e.isMatrix(r)?0:e.getTypeLength(r);return i>s&&i>a?t:s>a?n:a>i?r:t}getNodeType(e){const t=this.method;return t===HT.LENGTH||t===HT.DISTANCE||t===HT.DOT?"float":t===HT.CROSS?"vec3":t===HT.ALL?"bool":t===HT.EQUALS?e.changeComponentType(this.aNode.getNodeType(e),"bool"):t===HT.MOD?this.aNode.getNodeType(e):this.getInputType(e)}generate(e,t){const n=this.method,r=this.getNodeType(e),i=this.getInputType(e),s=this.aNode,a=this.bNode,o=this.cNode,l=!0===e.renderer.isWebGLRenderer;if(n===HT.TRANSFORM_DIRECTION){let n=s,r=a;e.isMatrix(n.getNodeType(e))?r=NS(MS(r),0):n=NS(MS(n),0);const i=wT(n,r).xyz;return aw(i).build(e,t)}if(n===HT.NEGATE)return e.format("( - "+s.build(e,i)+" )",r,t);if(n===HT.ONE_MINUS)return TT(1,s).build(e,t);if(n===HT.RECIPROCAL)return MT(1,s).build(e,t);if(n===HT.DIFFERENCE)return pw(TT(s,a)).build(e,t);{const u=[];return n===HT.CROSS||n===HT.MOD?u.push(s.build(e,r),a.build(e,r)):l&&n===HT.STEP?u.push(s.build(e,1===e.getTypeLength(s.getNodeType(e))?"float":i),a.build(e,i)):l&&(n===HT.MIN||n===HT.MAX)||n===HT.MOD?u.push(s.build(e,i),a.build(e,1===e.getTypeLength(a.getNodeType(e))?"float":i)):n===HT.REFRACT?u.push(s.build(e,i),a.build(e,i),o.build(e,"float")):n===HT.MIX?u.push(s.build(e,i),a.build(e,i),o.build(e,1===e.getTypeLength(o.getNodeType(e))?"float":i)):(u.push(s.build(e,i)),null!==a&&u.push(a.build(e,i)),null!==o&&u.push(o.build(e,i))),e.format(`${e.getMethod(n,r)}( ${u.join(", ")} )`,r,t)}}serialize(e){super.serialize(e),e.method=this.method}deserialize(e){super.deserialize(e),this.method=e.method}}HT.ALL="all",HT.ANY="any",HT.EQUALS="equals",HT.RADIANS="radians",HT.DEGREES="degrees",HT.EXP="exp",HT.EXP2="exp2",HT.LOG="log",HT.LOG2="log2",HT.SQRT="sqrt",HT.INVERSE_SQRT="inversesqrt",HT.FLOOR="floor",HT.CEIL="ceil",HT.NORMALIZE="normalize",HT.FRACT="fract",HT.SIN="sin",HT.COS="cos",HT.TAN="tan",HT.ASIN="asin",HT.ACOS="acos",HT.ATAN="atan",HT.ABS="abs",HT.SIGN="sign",HT.LENGTH="length",HT.NEGATE="negate",HT.ONE_MINUS="oneMinus",HT.DFDX="dFdx",HT.DFDY="dFdy",HT.ROUND="round",HT.RECIPROCAL="reciprocal",HT.TRUNC="trunc",HT.FWIDTH="fwidth",HT.BITCAST="bitcast",HT.TRANSPOSE="transpose",HT.ATAN2="atan2",HT.MIN="min",HT.MAX="max",HT.MOD="mod",HT.STEP="step",HT.REFLECT="reflect",HT.DISTANCE="distance",HT.DIFFERENCE="difference",HT.DOT="dot",HT.CROSS="cross",HT.POW="pow",HT.TRANSFORM_DIRECTION="transformDirection",HT.MIX="mix",HT.CLAMP="clamp",HT.REFRACT="refract",HT.SMOOTHSTEP="smoothstep",HT.FACEFORWARD="faceforward";const jT=vS(1e-6),WT=vS(Math.PI),XT=AS(HT,HT.ALL),QT=AS(HT,HT.ANY),YT=AS(HT,HT.EQUALS),$T=AS(HT,HT.RADIANS),KT=AS(HT,HT.DEGREES),ZT=AS(HT,HT.EXP),JT=AS(HT,HT.EXP2),ew=AS(HT,HT.LOG),tw=AS(HT,HT.LOG2),nw=AS(HT,HT.SQRT),rw=AS(HT,HT.INVERSE_SQRT),iw=AS(HT,HT.FLOOR),sw=AS(HT,HT.CEIL),aw=AS(HT,HT.NORMALIZE),ow=AS(HT,HT.FRACT),lw=AS(HT,HT.SIN),uw=AS(HT,HT.COS),cw=AS(HT,HT.TAN),Aw=AS(HT,HT.ASIN),hw=AS(HT,HT.ACOS),dw=AS(HT,HT.ATAN),pw=AS(HT,HT.ABS),fw=AS(HT,HT.SIGN),mw=AS(HT,HT.LENGTH),gw=AS(HT,HT.NEGATE),vw=AS(HT,HT.ONE_MINUS),_w=AS(HT,HT.DFDX),yw=AS(HT,HT.DFDY),xw=AS(HT,HT.ROUND),bw=AS(HT,HT.RECIPROCAL),Sw=AS(HT,HT.TRUNC),Tw=AS(HT,HT.FWIDTH);HT.BITCAST;const ww=AS(HT,HT.TRANSPOSE),Mw=AS(HT,HT.ATAN2),Ew=AS(HT,HT.MIN),Cw=AS(HT,HT.MAX),Rw=AS(HT,HT.MOD),Nw=AS(HT,HT.STEP),Pw=AS(HT,HT.REFLECT),Dw=AS(HT,HT.DISTANCE),Lw=AS(HT,HT.DIFFERENCE),Iw=AS(HT,HT.DOT),Uw=AS(HT,HT.CROSS),Bw=AS(HT,HT.POW),Ow=AS(HT,HT.POW,2),Fw=AS(HT,HT.POW,3),kw=AS(HT,HT.POW,4),qw=AS(HT,HT.TRANSFORM_DIRECTION),Gw=AS(HT,HT.MIX),zw=(e,t=0,n=1)=>lS(new HT(HT.CLAMP,lS(e),lS(t),lS(n))),Vw=AS(HT,HT.REFRACT),Hw=AS(HT,HT.SMOOTHSTEP),jw=AS(HT,HT.FACEFORWARD),Ww=dS((([e])=>{const t=Iw(e.xy,bS(12.9898,78.233)),n=Rw(t,WT);return ow(lw(n).mul(43758.5453))}));Bb("all",XT),Bb("any",QT),Bb("equals",YT),Bb("radians",$T),Bb("degrees",KT),Bb("exp",ZT),Bb("exp2",JT),Bb("log",ew),Bb("log2",tw),Bb("sqrt",nw),Bb("inverseSqrt",rw),Bb("floor",iw),Bb("ceil",sw),Bb("normalize",aw),Bb("fract",ow),Bb("sin",lw),Bb("cos",uw),Bb("tan",cw),Bb("asin",Aw),Bb("acos",hw),Bb("atan",dw),Bb("abs",pw),Bb("sign",fw),Bb("length",mw),Bb("lengthSq",(e=>Iw(e,e))),Bb("negate",gw),Bb("oneMinus",vw),Bb("dFdx",_w),Bb("dFdy",yw),Bb("round",xw),Bb("reciprocal",bw),Bb("trunc",Sw),Bb("fwidth",Tw),Bb("atan2",Mw),Bb("min",Ew),Bb("max",Cw),Bb("mod",Rw),Bb("step",Nw),Bb("reflect",Pw),Bb("distance",Dw),Bb("dot",Iw),Bb("cross",Uw),Bb("pow",Bw),Bb("pow2",Ow),Bb("pow3",Fw),Bb("pow4",kw),Bb("transformDirection",qw),Bb("mix",((e,t,n)=>Gw(t,n,e))),Bb("clamp",zw),Bb("refract",Vw),Bb("smoothstep",((e,t,n)=>Hw(t,n,e))),Bb("faceForward",jw),Bb("difference",Lw),Bb("saturate",(e=>zw(e))),Bb("cbrt",(e=>wT(fw(e),Bw(pw(e),1/3)))),Bb("transpose",ww),Bb("rand",Ww);class Xw extends Sb{static get type(){return"ConditionalNode"}constructor(e,t,n=null){super(),this.condNode=e,this.ifNode=t,this.elseNode=n}getNodeType(e){const t=this.ifNode.getNodeType(e);if(null!==this.elseNode){const n=this.elseNode.getNodeType(e);if(e.getTypeLength(n)>e.getTypeLength(t))return n}return t}setup(e){const t=this.condNode.cache(),n=this.ifNode.cache(),r=this.elseNode?this.elseNode.cache():null,i=e.context.nodeBlock;e.getDataFromNode(n).parentNodeBlock=i,null!==r&&(e.getDataFromNode(r).parentNodeBlock=i);const s=e.getNodeProperties(this);s.condNode=t,s.ifNode=n.context({nodeBlock:n}),s.elseNode=r?r.context({nodeBlock:r}):null}generate(e,t){const n=this.getNodeType(e),r=e.getDataFromNode(this);if(void 0!==r.nodeProperty)return r.nodeProperty;const{condNode:i,ifNode:s,elseNode:a}=e.getNodeProperties(this),o="void"!==t,l=o?((e,t)=>lS(new jS(e,t)))(n).build(e):"";r.nodeProperty=l;const u=i.build(e,"bool");e.addFlowCode(`\n${e.tab}if ( ${u} ) {\n\n`).addFlowTab();let c=s.build(e,n);if(c&&(c=o?l+" = "+c+";":"return "+c+";"),e.removeFlowTab().addFlowCode(e.tab+"\t"+c+"\n\n"+e.tab+"}"),null!==a){e.addFlowCode(" else {\n\n").addFlowTab();let t=a.build(e,n);t&&(t=o?l+" = "+t+";":"return "+t+";"),e.removeFlowTab().addFlowCode(e.tab+"\t"+t+"\n\n"+e.tab+"}\n\n")}else e.addFlowCode("\n\n");return e.format(l,n,t)}}const Qw=AS(Xw);Bb("select",Qw);Bb("cond",((...e)=>(console.warn("TSL.ConditionalNode: cond() has been renamed to select()."),Qw(...e))));class Yw extends Sb{static get type(){return"ContextNode"}constructor(e,t={}){super(),this.isContextNode=!0,this.node=e,this.value=t}getScope(){return this.node.getScope()}getNodeType(e){return this.node.getNodeType(e)}analyze(e){this.node.build(e)}setup(e){const t=e.getContext();e.setContext({...e.context,...this.value});const n=this.node.build(e);return e.setContext(t),n}generate(e,t){const n=e.getContext();e.setContext({...e.context,...this.value});const r=this.node.build(e,t);return e.setContext(n),r}}const $w=AS(Yw);Bb("context",$w),Bb("label",((e,t)=>$w(e,{label:t})));class Kw extends Sb{static get type(){return"VarNode"}constructor(e,t=null){super(),this.node=e,this.name=t,this.global=!0,this.isVarNode=!0}getHash(e){return this.name||super.getHash(e)}getNodeType(e){return this.node.getNodeType(e)}generate(e){const{node:t,name:n}=this,r=e.getVarFromNode(this,n,e.getVectorType(this.getNodeType(e))),i=e.getPropertyName(r),s=t.build(e,r.type);return e.addLineFlowCode(`${i} = ${s}`,this),i}}const Zw=AS(Kw);Bb("toVar",((...e)=>Zw(...e).append()));Bb("temp",(e=>(console.warn('TSL: "temp" is deprecated. Use ".toVar()" instead.'),Zw(e))));class Jw extends Sb{static get type(){return"VaryingNode"}constructor(e,t=null){super(),this.node=e,this.name=t,this.isVaryingNode=!0}isGlobal(){return!0}getHash(e){return this.name||super.getHash(e)}getNodeType(e){return this.node.getNodeType(e)}setupVarying(e){const t=e.getNodeProperties(this);let n=t.varying;if(void 0===n){const r=this.name,i=this.getNodeType(e);t.varying=n=e.getVaryingFromNode(this,r,i),t.node=this.node}return n.needsInterpolation||(n.needsInterpolation="fragment"===e.shaderStage),n}setup(e){this.setupVarying(e)}analyze(e){return this.setupVarying(e),this.node.analyze(e)}generate(e){const t=e.getNodeProperties(this),n=this.setupVarying(e);if(void 0===t.propertyName){const r=this.getNodeType(e),i=e.getPropertyName(n,Ab);e.flowNodeFromShaderStage(Ab,this.node,r,i),t.propertyName=i}return e.getPropertyName(n)}}const eM=AS(Jw);Bb("varying",eM);const tM=dS((([e])=>{const t=e.mul(.9478672986).add(.0521327014).pow(2.4),n=e.mul(.0773993808),r=e.lessThanEqual(.04045);return Gw(t,n,r)})).setLayout({name:"sRGBTransferEOTF",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),nM=dS((([e])=>{const t=e.pow(.41666).mul(1.055).sub(.055),n=e.mul(12.92),r=e.lessThanEqual(.0031308);return Gw(t,n,r)})).setLayout({name:"sRGBTransferOETF",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),rM="WorkingColorSpace",iM="OutputColorSpace";class sM extends Mb{static get type(){return"ColorSpaceNode"}constructor(e,t,n){super("vec4"),this.colorNode=e,this.source=t,this.target=n}resolveColorSpace(e,t){return t===rM?Ht.workingColorSpace:t===iM?e.context.outputColorSpace||e.renderer.outputColorSpace:t}setup(e){const{colorNode:t}=this,n=this.resolveColorSpace(e,this.source),r=this.resolveColorSpace(e,this.target);let i=t;return!1!==Ht.enabled&&n!==r&&n&&r?(Ht.getTransfer(n)===at&&(i=NS(tM(i.rgb),i.a)),Ht.getPrimaries(n)!==Ht.getPrimaries(r)&&(i=NS(US(Ht._getMatrix(new It,n,r)).mul(i.rgb),i.a)),Ht.getTransfer(r)===at&&(i=NS(nM(i.rgb),i.a)),i):i}}const aM=(e,t)=>lS(new sM(lS(e),t,rM));Bb("toOutputColorSpace",(e=>lS(new sM(lS(e),rM,iM)))),Bb("toWorkingColorSpace",(e=>lS(new sM(lS(e),iM,rM)))),Bb("workingToColorSpace",((e,t)=>lS(new sM(lS(e),rM,t)))),Bb("colorSpaceToWorking",aM);let oM=class extends Tb{static get type(){return"ReferenceElementNode"}constructor(e,t){super(e,t),this.referenceNode=e,this.isReferenceElementNode=!0}getNodeType(){return this.referenceNode.uniformType}generate(e){const t=super.generate(e),n=this.referenceNode.getNodeType(),r=this.getNodeType();return e.format(t,n,r)}};class lM extends Sb{static get type(){return"ReferenceBaseNode"}constructor(e,t,n=null,r=null){super(),this.property=e,this.uniformType=t,this.object=n,this.count=r,this.properties=e.split("."),this.reference=n,this.node=null,this.group=null,this.updateType=fb}setGroup(e){return this.group=e,this}element(e){return lS(new oM(this,lS(e)))}setNodeType(e){const t=HS(null,e).getSelf();null!==this.group&&t.setGroup(this.group),this.node=t}getNodeType(e){return null===this.node&&(this.updateReference(e),this.updateValue()),this.node.getNodeType(e)}getValueFromReference(e=this.reference){const{properties:t}=this;let n=e[t[0]];for(let e=1;e<t.length;e++)n=n[t[e]];return n}updateReference(e){return this.reference=null!==this.object?this.object:e.object,this.reference}setup(){return this.updateValue(),this.node}update(){this.updateValue()}updateValue(){null===this.node&&this.setNodeType(this.uniformType);const e=this.getValueFromReference();Array.isArray(e)?this.node.array=e:this.node.value=e}}class uM extends lM{static get type(){return"RendererReferenceNode"}constructor(e,t,n=null){super(e,t,n),this.renderer=n,this.setGroup(GS)}updateReference(e){return this.reference=null!==this.renderer?this.renderer:e.renderer,this.reference}}const cM=(e,t,n)=>lS(new uM(e,t,n));class AM extends Mb{static get type(){return"ToneMappingNode"}constructor(e,t=hM,n=null){super("vec3"),this.toneMapping=e,this.exposureNode=t,this.colorNode=n}getCacheKey(){return sb(super.getCacheKey(),this.toneMapping)}setup(e){const t=this.colorNode||e.context.color,n=this.toneMapping;if(0===n)return t;let r=null;const i=e.renderer.library.getToneMappingFunction(n);return null!==i?r=NS(i(t.rgb,this.exposureNode),t.a):(console.error("ToneMappingNode: Unsupported Tone Mapping configuration.",n),r=t),r}}const hM=cM("toneMappingExposure","float");Bb("toneMapping",((e,t,n)=>((e,t,n)=>lS(new AM(e,lS(t),lS(n))))(t,n,e)));class dM extends Db{static get type(){return"BufferAttributeNode"}constructor(e,t=null,n=0,r=0){super(e,t),this.isBufferNode=!0,this.bufferType=t,this.bufferStride=n,this.bufferOffset=r,this.usage=mt,this.instanced=!1,this.attribute=null,this.global=!0,e&&!0===e.isBufferAttribute&&(this.attribute=e,this.usage=e.usage,this.instanced=e.isInstancedBufferAttribute)}getHash(e){if(0===this.bufferStride&&0===this.bufferOffset){let t=e.globalCache.getData(this.value);return void 0===t&&(t={node:this},e.globalCache.setData(this.value,t)),t.node.uuid}return this.uuid}getNodeType(e){return null===this.bufferType&&(this.bufferType=e.getTypeFromAttribute(this.attribute)),this.bufferType}setup(e){if(null!==this.attribute)return;const t=this.getNodeType(e),n=this.value,r=e.getTypeLength(t),i=this.bufferStride||r,s=this.bufferOffset,a=!0===n.isInterleavedBuffer?n:new Ci(n,i),o=new Ni(a,r,s);a.setUsage(this.usage),this.attribute=o,this.attribute.isInstancedBufferAttribute=this.instanced}generate(e){const t=this.getNodeType(e),n=e.getBufferAttributeFromNode(this,t),r=e.getPropertyName(n);let i=null;if("vertex"===e.shaderStage||"compute"===e.shaderStage)this.name=r,i=r;else{i=eM(this).build(e,t)}return i}getInputType(){return"bufferAttribute"}setUsage(e){return this.usage=e,this.attribute&&!0===this.attribute.isBufferAttribute&&(this.attribute.usage=e),this}setInstanced(e){return this.instanced=e,this}}const pM=(e,t,n,r)=>lS(new dM(e,t,n,r)),fM=(e,t,n,r)=>pM(e,t,n,r).setInstanced(!0),mM=(e,t,n,r)=>((e,t,n,r)=>pM(e,t,n,r).setUsage(gt))(e,t,n,r).setInstanced(!0);Bb("toAttribute",(e=>pM(e.value)));class gM extends Sb{static get type(){return"ComputeNode"}constructor(e,t,n=[64]){super("void"),this.isComputeNode=!0,this.computeNode=e,this.count=t,this.workgroupSize=n,this.dispatchCount=0,this.version=1,this.updateBeforeType=fb,this.onInitFunction=null,this.updateDispatchCount()}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}updateDispatchCount(){const{count:e,workgroupSize:t}=this;let n=t[0];for(let e=1;e<t.length;e++)n*=t[e];this.dispatchCount=Math.ceil(e/n)}onInit(e){return this.onInitFunction=e,this}updateBefore({renderer:e}){e.compute(this)}generate(e){const{shaderStage:t}=e;if("compute"===t){const t=this.computeNode.build(e,"void");""!==t&&e.addLineFlowCode(t,this)}}}Bb("compute",((e,t,n)=>lS(new gM(lS(e),t,n))));class vM extends Sb{static get type(){return"CacheNode"}constructor(e,t=!0){super(),this.node=e,this.parent=t,this.isCacheNode=!0}getNodeType(e){return this.node.getNodeType(e)}build(e,...t){const n=e.getCache(),r=e.getCacheFromNode(this,this.parent);e.setCache(r);const i=this.node.build(e,...t);return e.setCache(n),i}}const _M=(e,...t)=>lS(new vM(lS(e),...t));Bb("cache",_M);class yM extends Sb{static get type(){return"BypassNode"}constructor(e,t){super(),this.isBypassNode=!0,this.outputNode=e,this.callNode=t}getNodeType(e){return this.outputNode.getNodeType(e)}generate(e){const t=this.callNode.build(e,"void");return""!==t&&e.addLineFlowCode(t,this),this.outputNode.build(e)}}Bb("bypass",AS(yM));class xM extends Sb{static get type(){return"RemapNode"}constructor(e,t,n,r=vS(0),i=vS(1)){super(),this.node=e,this.inLowNode=t,this.inHighNode=n,this.outLowNode=r,this.outHighNode=i,this.doClamp=!0}setup(){const{node:e,inLowNode:t,inHighNode:n,outLowNode:r,outHighNode:i,doClamp:s}=this;let a=e.sub(t).div(n.sub(t));return!0===s&&(a=a.clamp()),a.mul(i.sub(r)).add(r)}}const bM=AS(xM,null,null,{doClamp:!1}),SM=AS(xM);Bb("remap",bM),Bb("remapClamp",SM);class TM extends Sb{static get type(){return"ExpressionNode"}constructor(e="",t="void"){super(t),this.snippet=e}generate(e,t){const n=this.getNodeType(e),r=this.snippet;if("void"!==n)return e.format(`( ${r} )`,n,t);e.addLineFlowCode(r,this)}}const wM=AS(TM);Bb("discard",(e=>(e?Qw(e,wM("discard")):wM("discard")).append()));class MM extends Mb{static get type(){return"RenderOutputNode"}constructor(e,t,n){super("vec4"),this.colorNode=e,this.toneMapping=t,this.outputColorSpace=n,this.isRenderOutput=!0}setup({context:e}){let t=this.colorNode||e.color;const n=(null!==this.toneMapping?this.toneMapping:e.toneMapping)||0,r=(null!==this.outputColorSpace?this.outputColorSpace:e.outputColorSpace)||nt;return 0!==n&&(t=t.toneMapping(n)),r!==nt&&r!==Ht.workingColorSpace&&(t=t.workingToColorSpace(r)),t}}Bb("renderOutput",((e,t=null,n=null)=>lS(new MM(lS(e),t,n))));class EM extends Sb{static get type(){return"AttributeNode"}constructor(e,t=null){super(t),this.global=!0,this._attributeName=e}getHash(e){return this.getAttributeName(e)}getNodeType(e){let t=this.nodeType;if(null===t){const n=this.getAttributeName(e);if(e.hasGeometryAttribute(n)){const r=e.geometry.getAttribute(n);t=e.getTypeFromAttribute(r)}else t="float"}return t}setAttributeName(e){return this._attributeName=e,this}getAttributeName(){return this._attributeName}generate(e){const t=this.getAttributeName(e),n=this.getNodeType(e);if(!0===e.hasGeometryAttribute(t)){const r=e.geometry.getAttribute(t),i=e.getTypeFromAttribute(r),s=e.getAttribute(t,i);if("vertex"===e.shaderStage)return e.format(s.name,i,n);return eM(this).build(e,n)}return console.warn(`AttributeNode: Vertex attribute "${t}" not found on geometry.`),e.generateConst(n)}serialize(e){super.serialize(e),e.global=this.global,e._attributeName=this._attributeName}deserialize(e){super.deserialize(e),this.global=e.global,this._attributeName=e._attributeName}}const CM=(e,t)=>lS(new EM(e,t)),RM=e=>CM("uv"+(e>0?e:""),"vec2");class NM extends Sb{static get type(){return"TextureSizeNode"}constructor(e,t=null){super("uvec2"),this.isTextureSizeNode=!0,this.textureNode=e,this.levelNode=t}generate(e,t){const n=this.textureNode.build(e,"property"),r=null===this.levelNode?"0":this.levelNode.build(e,"int");return e.format(`${e.getMethod("textureDimensions")}( ${n}, ${r} )`,this.getNodeType(e),t)}}const PM=AS(NM);class DM extends VS{static get type(){return"MaxMipLevelNode"}constructor(e){super(0),this._textureNode=e,this.updateType=db}get textureNode(){return this._textureNode}get texture(){return this._textureNode.value}update(){const e=this.texture,t=e.images,n=t&&t.length>0?t[0]&&t[0].image||t[0]:e.image;if(n&&void 0!==n.width){const{width:e,height:t}=n;this.value=Math.log2(Math.max(e,t))}}}const LM=AS(DM);class IM extends VS{static get type(){return"TextureNode"}constructor(e,t=null,n=null,r=null){super(e),this.isTextureNode=!0,this.uvNode=t,this.levelNode=n,this.biasNode=r,this.compareNode=null,this.depthNode=null,this.gradNode=null,this.sampler=!0,this.updateMatrix=!1,this.updateType=hb,this.referenceNode=null,this._value=e,this._matrixUniform=null,this.setUpdateMatrix(null===t)}set value(e){this.referenceNode?this.referenceNode.value=e:this._value=e}get value(){return this.referenceNode?this.referenceNode.value:this._value}getUniformHash(){return this.value.uuid}getNodeType(){return!0===this.value.isDepthTexture?"float":this.value.type===se?"uvec4":this.value.type===ie?"ivec4":"vec4"}getInputType(){return"texture"}getDefaultUV(){return RM(this.value.channel)}updateReference(){return this.value}getTransformedUV(e){return null===this._matrixUniform&&(this._matrixUniform=HS(this.value.matrix)),this._matrixUniform.mul(MS(e,1)).xy}setUpdateMatrix(e){return this.updateMatrix=e,this.updateType=e?db:hb,this}setupUV(e,t){const n=this.value;return e.isFlipY()&&(n.image instanceof ImageBitmap&&!0===n.flipY||!0===n.isRenderTargetTexture||!0===n.isFramebufferTexture||!0===n.isDepthTexture)&&(t=this.sampler?t.flipY():t.setY(_S(PM(this,this.levelNode).y).sub(t.y).sub(1))),t}setup(e){const t=e.getNodeProperties(this);t.referenceNode=this.referenceNode;let n=this.uvNode;null!==n&&!0!==e.context.forceUVContext||!e.context.getUV||(n=e.context.getUV(this)),n||(n=this.getDefaultUV()),!0===this.updateMatrix&&(n=this.getTransformedUV(n)),n=this.setupUV(e,n);let r=this.levelNode;null===r&&e.context.getTextureLevel&&(r=e.context.getTextureLevel(this)),t.uvNode=n,t.levelNode=r,t.biasNode=this.biasNode,t.compareNode=this.compareNode,t.gradNode=this.gradNode,t.depthNode=this.depthNode}generateUV(e,t){return t.build(e,!0===this.sampler?"vec2":"ivec2")}generateSnippet(e,t,n,r,i,s,a,o){const l=this.value;let u;return u=r?e.generateTextureLevel(l,t,n,r,s):i?e.generateTextureBias(l,t,n,i,s):o?e.generateTextureGrad(l,t,n,o,s):a?e.generateTextureCompare(l,t,n,a,s):!1===this.sampler?e.generateTextureLoad(l,t,n,s):e.generateTexture(l,t,n,s),u}generate(e,t){const n=e.getNodeProperties(this),r=this.value;if(!r||!0!==r.isTexture)throw new Error("TextureNode: Need a three.js texture.");const i=super.generate(e,"property");if("sampler"===t)return i+"_sampler";if(e.isReference(t))return i;{const s=e.getDataFromNode(this);let a=s.propertyName;if(void 0===a){const{uvNode:t,levelNode:r,biasNode:o,compareNode:l,depthNode:u,gradNode:c}=n,A=this.generateUV(e,t),h=r?r.build(e,"float"):null,d=o?o.build(e,"float"):null,p=u?u.build(e,"int"):null,f=l?l.build(e,"float"):null,m=c?[c[0].build(e,"vec2"),c[1].build(e,"vec2")]:null,g=e.getVarFromNode(this);a=e.getPropertyName(g);const v=this.generateSnippet(e,i,A,h,d,p,f,m);e.addLineFlowCode(`${a} = ${v}`,this),s.snippet=v,s.propertyName=a}let o=a;const l=this.getNodeType(e);return e.needsToWorkingColorSpace(r)&&(o=aM(wM(o,l),r.colorSpace).setup(e).build(e,l)),e.format(o,l,t)}}setSampler(e){return this.sampler=e,this}getSampler(){return this.sampler}uv(e){const t=this.clone();return t.uvNode=lS(e),t.referenceNode=this.getSelf(),lS(t)}blur(e){const t=this.clone();return t.biasNode=lS(e).mul(LM(t)),t.referenceNode=this.getSelf(),lS(t)}level(e){const t=this.clone();return t.levelNode=lS(e),t.referenceNode=this.getSelf(),lS(t)}size(e){return PM(this,e)}bias(e){const t=this.clone();return t.biasNode=lS(e),t.referenceNode=this.getSelf(),lS(t)}compare(e){const t=this.clone();return t.compareNode=lS(e),t.referenceNode=this.getSelf(),lS(t)}grad(e,t){const n=this.clone();return n.gradNode=[lS(e),lS(t)],n.referenceNode=this.getSelf(),lS(n)}depth(e){const t=this.clone();return t.depthNode=lS(e),t.referenceNode=this.getSelf(),lS(t)}serialize(e){super.serialize(e),e.value=this.value.toJSON(e.meta).uuid,e.sampler=this.sampler,e.updateMatrix=this.updateMatrix,e.updateType=this.updateType}deserialize(e){super.deserialize(e),this.value=e.meta.textures[e.value],this.sampler=e.sampler,this.updateMatrix=e.updateMatrix,this.updateType=e.updateType}update(){const e=this.value,t=this._matrixUniform;null!==t&&(t.value=e.matrix),!0===e.matrixAutoUpdate&&e.updateMatrix()}clone(){const e=new this.constructor(this.value,this.uvNode,this.levelNode,this.biasNode);return e.sampler=this.sampler,e}}const UM=AS(IM),BM=(...e)=>UM(...e).setSampler(!1),OM=HS("float").label("cameraNear").setGroup(GS).onRenderUpdate((({camera:e})=>e.near)),FM=HS("float").label("cameraFar").setGroup(GS).onRenderUpdate((({camera:e})=>e.far)),kM=HS("mat4").label("cameraProjectionMatrix").setGroup(GS).onRenderUpdate((({camera:e})=>e.projectionMatrix)),qM=HS("mat4").label("cameraViewMatrix").setGroup(GS).onRenderUpdate((({camera:e})=>e.matrixWorldInverse)),GM=HS(new on).label("cameraPosition").setGroup(GS).onRenderUpdate((({camera:e},t)=>t.value.setFromMatrixPosition(e.matrixWorld)));class zM extends Sb{static get type(){return"Object3DNode"}constructor(e,t=null){super(),this.scope=e,this.object3d=t,this.updateType=fb,this._uniformNode=new VS(null)}getNodeType(){const e=this.scope;return e===zM.WORLD_MATRIX?"mat4":e===zM.POSITION||e===zM.VIEW_POSITION||e===zM.DIRECTION||e===zM.SCALE?"vec3":void 0}update(e){const t=this.object3d,n=this._uniformNode,r=this.scope;if(r===zM.WORLD_MATRIX)n.value=t.matrixWorld;else if(r===zM.POSITION)n.value=n.value||new on,n.value.setFromMatrixPosition(t.matrixWorld);else if(r===zM.SCALE)n.value=n.value||new on,n.value.setFromMatrixScale(t.matrixWorld);else if(r===zM.DIRECTION)n.value=n.value||new on,t.getWorldDirection(n.value);else if(r===zM.VIEW_POSITION){const r=e.camera;n.value=n.value||new on,n.value.setFromMatrixPosition(t.matrixWorld),n.value.applyMatrix4(r.matrixWorldInverse)}}generate(e){const t=this.scope;return t===zM.WORLD_MATRIX?this._uniformNode.nodeType="mat4":t!==zM.POSITION&&t!==zM.VIEW_POSITION&&t!==zM.DIRECTION&&t!==zM.SCALE||(this._uniformNode.nodeType="vec3"),this._uniformNode.build(e)}serialize(e){super.serialize(e),e.scope=this.scope}deserialize(e){super.deserialize(e),this.scope=e.scope}}zM.WORLD_MATRIX="worldMatrix",zM.POSITION="position",zM.SCALE="scale",zM.VIEW_POSITION="viewPosition",zM.DIRECTION="direction",zM.DIRECTION,zM.WORLD_MATRIX;const VM=AS(zM,zM.POSITION);zM.SCALE,zM.VIEW_POSITION;class HM extends zM{static get type(){return"ModelNode"}constructor(e){super(e)}update(e){this.object3d=e.object,super.update(e)}}const jM=hS(HM,HM.WORLD_MATRIX),WM=HS(new It).onObjectUpdate((({object:e},t)=>t.value.getNormalMatrix(e.matrixWorld))),XM=qM.mul(jM).toVar("modelViewMatrix"),QM=CM("position","vec3"),YM=QM.varying("positionLocal"),$M=QM.varying("positionPrevious"),KM=jM.mul(YM).xyz.varying("v_positionWorld"),ZM=YM.transformDirection(jM).varying("v_positionWorldDirection").normalize().toVar("positionWorldDirection"),JM=XM.mul(YM).xyz.varying("v_positionView"),eE=JM.negate().varying("v_positionViewDirection").normalize().toVar("positionViewDirection");class tE extends Sb{static get type(){return"FrontFacingNode"}constructor(){super("bool"),this.isFrontFacingNode=!0}generate(e){const{renderer:t,material:n}=e;return t.coordinateSystem===_t&&1===n.side?"false":e.getFrontFacing()}}const nE=vS(hS(tE)).mul(2).sub(1),rE=CM("normal","vec3"),iE=dS((e=>!1===e.geometry.hasAttribute("normal")?(console.warn('TSL.NormalNode: Vertex attribute "normal" not found on geometry.'),MS(0,1,0)):rE),"vec3").once()().toVar("normalLocal"),sE=JM.dFdx().cross(JM.dFdy()).normalize().toVar("normalFlat"),aE=dS((e=>{let t;return t=!0===e.material.flatShading?sE:eM(hE(iE),"v_normalView").normalize(),t}),"vec3").once()().toVar("normalView"),oE=eM(aE.transformDirection(qM),"v_normalWorld").normalize().toVar("normalWorld"),lE=dS((e=>e.context.setupNormal()),"vec3").once()().mul(nE).toVar("transformedNormalView"),uE=lE.transformDirection(qM).toVar("transformedNormalWorld"),cE=dS((e=>e.context.setupClearcoatNormal()),"vec3").once()().mul(nE).toVar("transformedClearcoatNormalView"),AE=dS((([e,t=jM])=>{const n=US(t),r=e.div(MS(n[0].dot(n[0]),n[1].dot(n[1]),n[2].dot(n[2])));return n.mul(r).xyz})),hE=dS((([e],t)=>{const n=t.renderer.nodes.modelNormalViewMatrix;if(null!==n)return n.transformDirection(e);const r=WM.mul(e);return qM.transformDirection(r)})),dE=HS(0).onReference((({material:e})=>e)).onRenderUpdate((({material:e})=>e.refractionRatio)),pE=eE.negate().reflect(lE),fE=eE.negate().refract(lE,dE),mE=pE.transformDirection(qM).toVar("reflectVector"),gE=fE.transformDirection(qM).toVar("reflectVector");class vE extends IM{static get type(){return"CubeTextureNode"}constructor(e,t=null,n=null,r=null){super(e,t,n,r),this.isCubeTextureNode=!0}getInputType(){return"cubeTexture"}getDefaultUV(){const e=this.value;return e.mapping===q?mE:e.mapping===G?gE:(console.error('THREE.CubeTextureNode: Mapping "%s" not supported.',e.mapping),MS(0,0,0))}setUpdateMatrix(){}setupUV(e,t){const n=this.value;return e.renderer.coordinateSystem!==yt&&n.isRenderTargetTexture?t:MS(t.x.negate(),t.yz)}generateUV(e,t){return t.build(e,"vec3")}}const _E=AS(vE);class yE extends VS{static get type(){return"BufferNode"}constructor(e,t,n=0){super(e,t),this.isBufferNode=!0,this.bufferType=t,this.bufferCount=n}getElementType(e){return this.getNodeType(e)}getInputType(){return"buffer"}}const xE=(e,t,n)=>lS(new yE(e,t,n));class bE extends Tb{static get type(){return"UniformArrayElementNode"}constructor(e,t){super(e,t),this.isArrayBufferElementNode=!0}generate(e){const t=super.generate(e),n=this.getNodeType();return e.format(t,"vec4",n)}}class SE extends yE{static get type(){return"UniformArrayNode"}constructor(e,t=null){super(null,"vec4"),this.array=e,this.elementType=t,this._elementType=null,this._elementLength=0,this.updateType=pb,this.isArrayBufferNode=!0}getElementType(){return this.elementType||this._elementType}getElementLength(){return this._elementLength}update(){const{array:e,value:t}=this,n=this.getElementLength(),r=this.getElementType();if(1===n)for(let n=0;n<e.length;n++){t[4*n]=e[n]}else if("color"===r)for(let n=0;n<e.length;n++){const r=4*n,i=e[n];t[r]=i.r,t[r+1]=i.g,t[r+2]=i.b||0}else for(let n=0;n<e.length;n++){const r=4*n,i=e[n];t[r]=i.x,t[r+1]=i.y,t[r+2]=i.z||0,t[r+3]=i.w||0}}setup(e){const t=this.array.length;this._elementType=null===this.elementType?ub(this.array[0]):this.elementType,this._elementLength=e.getTypeLength(this._elementType);let n=Float32Array;return"i"===this._elementType.charAt(0)?n=Int32Array:"u"===this._elementType.charAt(0)&&(n=Uint32Array),this.value=new n(4*t),this.bufferCount=t,this.bufferType=e.changeComponentType("vec4",e.getComponentType(this._elementType)),super.setup(e)}element(e){return lS(new bE(this,lS(e)))}}const TE=(e,t)=>lS(new SE(e,t));class wE extends Tb{static get type(){return"ReferenceElementNode"}constructor(e,t){super(e,t),this.referenceNode=e,this.isReferenceElementNode=!0}getNodeType(){return this.referenceNode.uniformType}generate(e){const t=super.generate(e),n=this.referenceNode.getNodeType(),r=this.getNodeType();return e.format(t,n,r)}}class ME extends Sb{static get type(){return"ReferenceNode"}constructor(e,t,n=null,r=null){super(),this.property=e,this.uniformType=t,this.object=n,this.count=r,this.properties=e.split("."),this.reference=n,this.node=null,this.group=null,this.name=null,this.updateType=fb}element(e){return lS(new wE(this,lS(e)))}setGroup(e){return this.group=e,this}label(e){return this.name=e,this}setNodeType(e){let t=null;t=null!==this.count?xE(null,e,this.count):Array.isArray(this.getValueFromReference())?TE(null,e):"texture"===e?UM(null):"cubeTexture"===e?_E(null):HS(null,e),null!==this.group&&t.setGroup(this.group),null!==this.name&&t.label(this.name),this.node=t.getSelf()}getNodeType(e){return null===this.node&&(this.updateReference(e),this.updateValue()),this.node.getNodeType(e)}getValueFromReference(e=this.reference){const{properties:t}=this;let n=e[t[0]];for(let e=1;e<t.length;e++)n=n[t[e]];return n}updateReference(e){return this.reference=null!==this.object?this.object:e.object,this.reference}setup(){return this.updateValue(),this.node}update(){this.updateValue()}updateValue(){null===this.node&&this.setNodeType(this.uniformType);const e=this.getValueFromReference();Array.isArray(e)?this.node.array=e:this.node.value=e}}const EE=(e,t,n)=>lS(new ME(e,t,n)),CE=(e,t,n,r)=>lS(new ME(e,t,r,n));class RE extends ME{static get type(){return"MaterialReferenceNode"}constructor(e,t,n=null){super(e,t,n),this.material=n,this.isMaterialReferenceNode=!0}updateReference(e){return this.reference=null!==this.material?this.material:e.material,this.reference}}const NE=(e,t,n)=>lS(new RE(e,t,n)),PE=dS((e=>(!1===e.geometry.hasAttribute("tangent")&&e.geometry.computeTangents(),CM("tangent","vec4"))))(),DE=PE.xyz.toVar("tangentLocal"),LE=XM.mul(NS(DE,0)).xyz.varying("v_tangentView").normalize().toVar("tangentView");var IE;const UE=US(LE,eM((IE=aE.cross(LE),IE.mul(PE.w).xyz),"v_bitangentView").normalize().toVar("bitangentView"),aE),BE=(()=>{let e=oT.cross(eE);return e=e.cross(oT).normalize(),e=Gw(e,lE,sT.mul(YS.oneMinus()).oneMinus().pow2().pow2()).normalize(),e})(),OE=dS((e=>{const{eye_pos:t,surf_norm:n,mapN:r,uv:i}=e,s=t.dFdx(),a=t.dFdy(),o=i.dFdx(),l=i.dFdy(),u=n,c=a.cross(u),A=u.cross(s),h=c.mul(o.x).add(A.mul(l.x)),d=c.mul(o.y).add(A.mul(l.y)),p=h.dot(h).max(d.dot(d)),f=nE.mul(p.inverseSqrt());return ST(h.mul(r.x,f),d.mul(r.y,f),u.mul(r.z)).normalize()}));class FE extends Mb{static get type(){return"NormalMapNode"}constructor(e,t=null){super("vec3"),this.node=e,this.scaleNode=t,this.normalMapType=0}setup(e){const{normalMapType:t,scaleNode:n}=this;let r=this.node.mul(2).sub(1);null!==n&&(r=MS(r.xy.mul(n),r.z));let i=null;if(1===t)i=hE(r);else if(0===t){i=!0===e.hasGeometryAttribute("tangent")?UE.mul(r).normalize():OE({eye_pos:JM,surf_norm:aE,mapN:r,uv:RM()})}return i}}const kE=AS(FE),qE=dS((({textureNode:e,bumpScale:t})=>{const n=t=>e.cache().context({getUV:e=>t(e.uvNode||RM()),forceUVContext:!0}),r=vS(n((e=>e)));return bS(vS(n((e=>e.add(e.dFdx())))).sub(r),vS(n((e=>e.add(e.dFdy())))).sub(r)).mul(t)})),GE=dS((e=>{const{surf_pos:t,surf_norm:n,dHdxy:r}=e,i=t.dFdx().normalize(),s=n,a=t.dFdy().normalize().cross(s),o=s.cross(i),l=i.dot(a).mul(nE),u=l.sign().mul(r.x.mul(a).add(r.y.mul(o)));return l.abs().mul(n).sub(u).normalize()}));class zE extends Mb{static get type(){return"BumpMapNode"}constructor(e,t=null){super("vec3"),this.textureNode=e,this.scaleNode=t}setup(){const e=null!==this.scaleNode?this.scaleNode:1,t=qE({textureNode:this.textureNode,bumpScale:e});return GE({surf_pos:JM,surf_norm:aE,dHdxy:t})}}const VE=AS(zE),HE=new Map;class jE extends Sb{static get type(){return"MaterialNode"}constructor(e){super(),this.scope=e}getCache(e,t){let n=HE.get(e);return void 0===n&&(n=NE(e,t),HE.set(e,n)),n}getFloat(e){return this.getCache(e,"float")}getColor(e){return this.getCache(e,"color")}getTexture(e){return this.getCache("map"===e?"map":e+"Map","texture")}setup(e){const t=e.context.material,n=this.scope;let r=null;if(n===jE.COLOR){const e=void 0!==t.color?this.getColor(n):MS();r=t.map&&!0===t.map.isTexture?e.mul(this.getTexture("map")):e}else if(n===jE.OPACITY){const e=this.getFloat(n);r=t.alphaMap&&!0===t.alphaMap.isTexture?e.mul(this.getTexture("alpha")):e}else if(n===jE.SPECULAR_STRENGTH)r=t.specularMap&&!0===t.specularMap.isTexture?this.getTexture("specular").r:vS(1);else if(n===jE.SPECULAR_INTENSITY){const e=this.getFloat(n);r=t.specularMap?e.mul(this.getTexture(n).a):e}else if(n===jE.SPECULAR_COLOR){const e=this.getColor(n);r=t.specularColorMap&&!0===t.specularColorMap.isTexture?e.mul(this.getTexture(n).rgb):e}else if(n===jE.ROUGHNESS){const e=this.getFloat(n);r=t.roughnessMap&&!0===t.roughnessMap.isTexture?e.mul(this.getTexture(n).g):e}else if(n===jE.METALNESS){const e=this.getFloat(n);r=t.metalnessMap&&!0===t.metalnessMap.isTexture?e.mul(this.getTexture(n).b):e}else if(n===jE.EMISSIVE){const e=this.getFloat("emissiveIntensity"),i=this.getColor(n).mul(e);r=t.emissiveMap&&!0===t.emissiveMap.isTexture?i.mul(this.getTexture(n)):i}else if(n===jE.NORMAL)t.normalMap?(r=kE(this.getTexture("normal"),this.getCache("normalScale","vec2")),r.normalMapType=t.normalMapType):r=t.bumpMap?VE(this.getTexture("bump").r,this.getFloat("bumpScale")):aE;else if(n===jE.CLEARCOAT){const e=this.getFloat(n);r=t.clearcoatMap&&!0===t.clearcoatMap.isTexture?e.mul(this.getTexture(n).r):e}else if(n===jE.CLEARCOAT_ROUGHNESS){const e=this.getFloat(n);r=t.clearcoatRoughnessMap&&!0===t.clearcoatRoughnessMap.isTexture?e.mul(this.getTexture(n).r):e}else if(n===jE.CLEARCOAT_NORMAL)r=t.clearcoatNormalMap?kE(this.getTexture(n),this.getCache(n+"Scale","vec2")):aE;else if(n===jE.SHEEN){const e=this.getColor("sheenColor").mul(this.getFloat("sheen"));r=t.sheenColorMap&&!0===t.sheenColorMap.isTexture?e.mul(this.getTexture("sheenColor").rgb):e}else if(n===jE.SHEEN_ROUGHNESS){const e=this.getFloat(n);r=t.sheenRoughnessMap&&!0===t.sheenRoughnessMap.isTexture?e.mul(this.getTexture(n).a):e,r=r.clamp(.07,1)}else if(n===jE.ANISOTROPY)if(t.anisotropyMap&&!0===t.anisotropyMap.isTexture){const e=this.getTexture(n);r=IS(EC.x,EC.y,EC.y.negate(),EC.x).mul(e.rg.mul(2).sub(bS(1)).normalize().mul(e.b))}else r=EC;else if(n===jE.IRIDESCENCE_THICKNESS){const e=EE("1","float",t.iridescenceThicknessRange);if(t.iridescenceThicknessMap){const i=EE("0","float",t.iridescenceThicknessRange);r=e.sub(i).mul(this.getTexture(n).g).add(i)}else r=e}else if(n===jE.TRANSMISSION){const e=this.getFloat(n);r=t.transmissionMap?e.mul(this.getTexture(n).r):e}else if(n===jE.THICKNESS){const e=this.getFloat(n);r=t.thicknessMap?e.mul(this.getTexture(n).g):e}else if(n===jE.IOR)r=this.getFloat(n);else if(n===jE.LIGHT_MAP)r=this.getTexture(n).rgb.mul(this.getFloat("lightMapIntensity"));else if(n===jE.AO_MAP)r=this.getTexture(n).r.sub(1).mul(this.getFloat("aoMapIntensity")).add(1);else{const t=this.getNodeType(e);r=this.getCache(n,t)}return r}}jE.ALPHA_TEST="alphaTest",jE.COLOR="color",jE.OPACITY="opacity",jE.SHININESS="shininess",jE.SPECULAR="specular",jE.SPECULAR_STRENGTH="specularStrength",jE.SPECULAR_INTENSITY="specularIntensity",jE.SPECULAR_COLOR="specularColor",jE.REFLECTIVITY="reflectivity",jE.ROUGHNESS="roughness",jE.METALNESS="metalness",jE.NORMAL="normal",jE.CLEARCOAT="clearcoat",jE.CLEARCOAT_ROUGHNESS="clearcoatRoughness",jE.CLEARCOAT_NORMAL="clearcoatNormal",jE.EMISSIVE="emissive",jE.ROTATION="rotation",jE.SHEEN="sheen",jE.SHEEN_ROUGHNESS="sheenRoughness",jE.ANISOTROPY="anisotropy",jE.IRIDESCENCE="iridescence",jE.IRIDESCENCE_IOR="iridescenceIOR",jE.IRIDESCENCE_THICKNESS="iridescenceThickness",jE.IOR="ior",jE.TRANSMISSION="transmission",jE.THICKNESS="thickness",jE.ATTENUATION_DISTANCE="attenuationDistance",jE.ATTENUATION_COLOR="attenuationColor",jE.LINE_SCALE="scale",jE.LINE_DASH_SIZE="dashSize",jE.LINE_GAP_SIZE="gapSize",jE.LINE_WIDTH="linewidth",jE.LINE_DASH_OFFSET="dashOffset",jE.POINT_WIDTH="pointWidth",jE.DISPERSION="dispersion",jE.LIGHT_MAP="light",jE.AO_MAP="ao";const WE=hS(jE,jE.ALPHA_TEST),XE=hS(jE,jE.COLOR),QE=hS(jE,jE.SHININESS),YE=hS(jE,jE.EMISSIVE),$E=hS(jE,jE.OPACITY),KE=hS(jE,jE.SPECULAR),ZE=hS(jE,jE.SPECULAR_INTENSITY),JE=hS(jE,jE.SPECULAR_COLOR),eC=hS(jE,jE.SPECULAR_STRENGTH),tC=hS(jE,jE.REFLECTIVITY),nC=hS(jE,jE.ROUGHNESS),rC=hS(jE,jE.METALNESS),iC=hS(jE,jE.NORMAL).context({getUV:null}),sC=hS(jE,jE.CLEARCOAT),aC=hS(jE,jE.CLEARCOAT_ROUGHNESS),oC=hS(jE,jE.CLEARCOAT_NORMAL).context({getUV:null}),lC=hS(jE,jE.ROTATION),uC=hS(jE,jE.SHEEN),cC=hS(jE,jE.SHEEN_ROUGHNESS),AC=hS(jE,jE.ANISOTROPY),hC=hS(jE,jE.IRIDESCENCE),dC=hS(jE,jE.IRIDESCENCE_IOR),pC=hS(jE,jE.IRIDESCENCE_THICKNESS),fC=hS(jE,jE.TRANSMISSION),mC=hS(jE,jE.THICKNESS),gC=hS(jE,jE.IOR),vC=hS(jE,jE.ATTENUATION_DISTANCE),_C=hS(jE,jE.ATTENUATION_COLOR),yC=hS(jE,jE.LINE_SCALE),xC=hS(jE,jE.LINE_DASH_SIZE),bC=hS(jE,jE.LINE_GAP_SIZE);jE.LINE_WIDTH;const SC=hS(jE,jE.LINE_DASH_OFFSET);jE.POINT_WIDTH;const TC=hS(jE,jE.DISPERSION),wC=hS(jE,jE.LIGHT_MAP),MC=hS(jE,jE.AO_MAP),EC=HS(new Lt).onReference((function(e){return e.material})).onRenderUpdate((function({material:e}){this.value.set(e.anisotropy*Math.cos(e.anisotropyRotation),e.anisotropy*Math.sin(e.anisotropyRotation))}));class CC extends Mb{static get type(){return"ModelViewProjectionNode"}constructor(e=null){super("vec4"),this.positionNode=e}setup(e){if("fragment"===e.shaderStage)return eM(e.context.mvp);const t=this.positionNode||YM,n=e.renderer.nodes.modelViewMatrix||XM;return kM.mul(n).mul(t)}}const RC=AS(CC);class NC extends Sb{static get type(){return"IndexNode"}constructor(e){super("uint"),this.scope=e,this.isInstanceIndexNode=!0}generate(e){const t=this.getNodeType(e),n=this.scope;let r,i;if(n===NC.VERTEX)r=e.getVertexIndex();else if(n===NC.INSTANCE)r=e.getInstanceIndex();else if(n===NC.DRAW)r=e.getDrawIndex();else if(n===NC.INVOCATION_LOCAL)r=e.getInvocationLocalIndex();else if(n===NC.INVOCATION_SUBGROUP)r=e.getInvocationSubgroupIndex();else{if(n!==NC.SUBGROUP)throw new Error("THREE.IndexNode: Unknown scope: "+n);r=e.getSubgroupIndex()}if("vertex"===e.shaderStage||"compute"===e.shaderStage)i=r;else{i=eM(this).build(e,t)}return i}}NC.VERTEX="vertex",NC.INSTANCE="instance",NC.SUBGROUP="subgroup",NC.INVOCATION_LOCAL="invocationLocal",NC.INVOCATION_SUBGROUP="invocationSubgroup",NC.DRAW="draw";const PC=hS(NC,NC.VERTEX),DC=hS(NC,NC.INSTANCE);NC.SUBGROUP,NC.INVOCATION_SUBGROUP,NC.INVOCATION_LOCAL;const LC=hS(NC,NC.DRAW);class IC extends Sb{static get type(){return"InstanceNode"}constructor(e,t,n){super("void"),this.count=e,this.instanceMatrix=t,this.instanceColor=n,this.instanceMatrixNode=null,this.instanceColorNode=null,this.updateType=db,this.buffer=null,this.bufferColor=null}setup(e){const{count:t,instanceMatrix:n,instanceColor:r}=this;let{instanceMatrixNode:i,instanceColorNode:s}=this;if(null===i){if(t<=1e3)i=xE(n.array,"mat4",Math.max(t,1)).element(DC);else{const e=new Qa(n.array,16,1);this.buffer=e;const t=n.usage===gt?mM:fM,r=[t(e,"vec4",16,0),t(e,"vec4",16,4),t(e,"vec4",16,8),t(e,"vec4",16,12)];i=BS(...r)}this.instanceMatrixNode=i}if(r&&null===s){const e=new Li(r.array,3),t=r.usage===gt?mM:fM;this.bufferColor=e,s=MS(t(e,"vec3",3,0)),this.instanceColorNode=s}const a=i.mul(YM).xyz;if(YM.assign(a),e.hasGeometryAttribute("normal")){const e=AE(iE,i);iE.assign(e)}null!==this.instanceColorNode&&WS("vec3","vInstanceColor").assign(this.instanceColorNode)}update(){this.instanceMatrix.usage!==gt&&null!=this.buffer&&this.instanceMatrix.version!==this.buffer.version&&(this.buffer.version=this.instanceMatrix.version),this.instanceColor&&this.instanceColor.usage!==gt&&null!=this.bufferColor&&this.instanceColor.version!==this.bufferColor.version&&(this.bufferColor.version=this.instanceColor.version)}}class UC extends IC{static get type(){return"InstancedMeshNode"}constructor(e){const{count:t,instanceMatrix:n,instanceColor:r}=e;super(t,n,r),this.instanceMesh=e}}const BC=AS(UC);class OC extends Sb{static get type(){return"BatchNode"}constructor(e){super("void"),this.batchMesh=e,this.batchingIdNode=null}setup(e){null===this.batchingIdNode&&(null===e.getDrawIndex()?this.batchingIdNode=DC:this.batchingIdNode=LC);const t=dS((([e])=>{const t=PM(BM(this.batchMesh._indirectTexture),0),n=_S(e).modInt(_S(t)),r=_S(e).div(_S(t));return BM(this.batchMesh._indirectTexture,SS(n,r)).x})).setLayout({name:"getIndirectIndex",type:"uint",inputs:[{name:"id",type:"int"}]}),n=t(_S(this.batchingIdNode)),r=this.batchMesh._matricesTexture,i=PM(BM(r),0),s=vS(n).mul(4).toInt().toVar(),a=s.modInt(i),o=s.div(_S(i)),l=BS(BM(r,SS(a,o)),BM(r,SS(a.add(1),o)),BM(r,SS(a.add(2),o)),BM(r,SS(a.add(3),o))),u=this.batchMesh._colorsTexture;if(null!==u){const e=dS((([e])=>{const t=PM(BM(u),0).x,n=e,r=n.modInt(t),i=n.div(t);return BM(u,SS(r,i)).rgb})).setLayout({name:"getBatchingColor",type:"vec3",inputs:[{name:"id",type:"int"}]}),t=e(n);WS("vec3","vBatchColor").assign(t)}const c=US(l);YM.assign(l.mul(YM));const A=iE.div(MS(c[0].dot(c[0]),c[1].dot(c[1]),c[2].dot(c[2]))),h=c.mul(A).xyz;iE.assign(h),e.hasGeometryAttribute("tangent")&&DE.mulAssign(c)}}const FC=AS(OC),kC=new WeakMap;class qC extends Sb{static get type(){return"SkinningNode"}constructor(e,t=!1){let n,r,i;super("void"),this.skinnedMesh=e,this.useReference=t,this.updateType=fb,this.skinIndexNode=CM("skinIndex","uvec4"),this.skinWeightNode=CM("skinWeight","vec4"),t?(n=EE("bindMatrix","mat4"),r=EE("bindMatrixInverse","mat4"),i=CE("skeleton.boneMatrices","mat4",e.skeleton.bones.length)):(n=HS(e.bindMatrix,"mat4"),r=HS(e.bindMatrixInverse,"mat4"),i=xE(e.skeleton.boneMatrices,"mat4",e.skeleton.bones.length)),this.bindMatrixNode=n,this.bindMatrixInverseNode=r,this.boneMatricesNode=i,this.previousBoneMatricesNode=null}getSkinnedPosition(e=this.boneMatricesNode,t=YM){const{skinIndexNode:n,skinWeightNode:r,bindMatrixNode:i,bindMatrixInverseNode:s}=this,a=e.element(n.x),o=e.element(n.y),l=e.element(n.z),u=e.element(n.w),c=i.mul(t),A=ST(a.mul(r.x).mul(c),o.mul(r.y).mul(c),l.mul(r.z).mul(c),u.mul(r.w).mul(c));return s.mul(A).xyz}getSkinnedNormal(e=this.boneMatricesNode,t=iE){const{skinIndexNode:n,skinWeightNode:r,bindMatrixNode:i,bindMatrixInverseNode:s}=this,a=e.element(n.x),o=e.element(n.y),l=e.element(n.z),u=e.element(n.w);let c=ST(r.x.mul(a),r.y.mul(o),r.z.mul(l),r.w.mul(u));return c=s.mul(c).mul(i),c.transformDirection(t).xyz}getPreviousSkinnedPosition(e){const t=e.object;return null===this.previousBoneMatricesNode&&(t.skeleton.previousBoneMatrices=new Float32Array(t.skeleton.boneMatrices),this.previousBoneMatricesNode=CE("skeleton.previousBoneMatrices","mat4",t.skeleton.bones.length)),this.getSkinnedPosition(this.previousBoneMatricesNode,$M)}needsPreviousBoneMatrices(e){const t=e.renderer.getMRT();return t&&t.has("velocity")}setup(e){this.needsPreviousBoneMatrices(e)&&$M.assign(this.getPreviousSkinnedPosition(e));const t=this.getSkinnedPosition();if(YM.assign(t),e.hasGeometryAttribute("normal")){const t=this.getSkinnedNormal();iE.assign(t),e.hasGeometryAttribute("tangent")&&DE.assign(t)}}generate(e,t){if("void"!==t)return YM.build(e,t)}update(e){const t=(this.useReference?e.object:this.skinnedMesh).skeleton;kC.get(t)!==e.frameId&&(kC.set(t,e.frameId),null!==this.previousBoneMatricesNode&&t.previousBoneMatrices.set(t.boneMatrices),t.update())}}class GC extends Sb{static get type(){return"LoopNode"}constructor(e=[]){super(),this.params=e}getVarName(e){return String.fromCharCode("i".charCodeAt()+e)}getProperties(e){const t=e.getNodeProperties(this);if(void 0!==t.stackNode)return t;const n={};for(let e=0,t=this.params.length-1;e<t;e++){const t=this.params[e],r=!0!==t.isNode&&t.name||this.getVarName(e),i=!0!==t.isNode&&t.type||"int";n[r]=wM(r,i)}const r=e.addStack();return t.returnsNode=this.params[this.params.length-1](n,r,e),t.stackNode=r,e.removeStack(),t}getNodeType(e){const{returnsNode:t}=this.getProperties(e);return t?t.getNodeType(e):"void"}setup(e){this.getProperties(e)}generate(e){const t=this.getProperties(e),n=this.params,r=t.stackNode;for(let t=0,r=n.length-1;t<r;t++){const r=n[t];let i=null,s=null,a=null,o=null,l=null,u=null;r.isNode?(o="int",a=this.getVarName(t),i="0",s=r.build(e,o),l="<"):(o=r.type||"int",a=r.name||this.getVarName(t),i=r.start,s=r.end,l=r.condition,u=r.update,"number"==typeof i?i=e.generateConst(o,i):i&&i.isNode&&(i=i.build(e,o)),"number"==typeof s?s=e.generateConst(o,s):s&&s.isNode&&(s=s.build(e,o)),void 0!==i&&void 0===s?(i+=" - 1",s="0",l=">="):void 0!==s&&void 0===i&&(i="0",l="<"),void 0===l&&(l=Number(i)>Number(s)?">=":"<"));const c={start:i,end:s,condition:l},A=c.start,h=c.end;let d="",p="",f="";u||(u="int"===o||"uint"===o?l.includes("<")?"++":"--":l.includes("<")?"+= 1.":"-= 1."),d+=e.getVar(o,a)+" = "+A,p+=a+" "+l+" "+h,f+=a+" "+u;const m=`for ( ${d}; ${p}; ${f} )`;e.addFlowCode((0===t?"\n":"")+e.tab+m+" {\n\n").addFlowTab()}const i=r.build(e,"void"),s=t.returnsNode?t.returnsNode.build(e):"";e.removeFlowTab().addFlowCode("\n"+e.tab+i);for(let t=0,n=this.params.length-1;t<n;t++)e.addFlowCode((0===t?"":e.tab)+"}\n\n").removeFlowTab();return e.addFlowTab(),s}}const zC=(...e)=>lS(new GC(cS(e,"int"))).append(),VC=new WeakMap,HC=new en,jC=dS((({bufferMap:e,influence:t,stride:n,width:r,depth:i,offset:s})=>{const a=_S(PC).mul(n).add(s),o=a.div(r),l=a.sub(o.mul(r));return BM(e,SS(l,o)).depth(i).mul(t)}));class WC extends Sb{static get type(){return"MorphNode"}constructor(e){super("void"),this.mesh=e,this.morphBaseInfluence=HS(1),this.updateType=fb}setup(e){const{geometry:t}=e,n=void 0!==t.morphAttributes.position,r=t.hasAttribute("normal")&&void 0!==t.morphAttributes.normal,i=t.morphAttributes.position||t.morphAttributes.normal||t.morphAttributes.color,s=void 0!==i?i.length:0,{texture:a,stride:o,size:l}=function(e){const t=void 0!==e.morphAttributes.position,n=void 0!==e.morphAttributes.normal,r=void 0!==e.morphAttributes.color,i=e.morphAttributes.position||e.morphAttributes.normal||e.morphAttributes.color,s=void 0!==i?i.length:0;let a=VC.get(e);if(void 0===a||a.count!==s){void 0!==a&&a.texture.dispose();const o=e.morphAttributes.position||[],l=e.morphAttributes.normal||[],u=e.morphAttributes.color||[];let c=0;!0===t&&(c=1),!0===n&&(c=2),!0===r&&(c=3);let A=e.attributes.position.count*c,h=1;const d=4096;A>d&&(h=Math.ceil(A/d),A=d);const p=new Float32Array(A*h*4*s),f=new rn(p,A,h,s);f.type=ae,f.needsUpdate=!0;const m=4*c;for(let v=0;v<s;v++){const _=o[v],y=l[v],x=u[v],b=A*h*4*v;for(let S=0;S<_.count;S++){const T=S*m;!0===t&&(HC.fromBufferAttribute(_,S),p[b+T+0]=HC.x,p[b+T+1]=HC.y,p[b+T+2]=HC.z,p[b+T+3]=0),!0===n&&(HC.fromBufferAttribute(y,S),p[b+T+4]=HC.x,p[b+T+5]=HC.y,p[b+T+6]=HC.z,p[b+T+7]=0),!0===r&&(HC.fromBufferAttribute(x,S),p[b+T+8]=HC.x,p[b+T+9]=HC.y,p[b+T+10]=HC.z,p[b+T+11]=4===x.itemSize?HC.w:1)}}function g(){f.dispose(),VC.delete(e),e.removeEventListener("dispose",g)}a={count:s,texture:f,stride:c,size:new Lt(A,h)},VC.set(e,a),e.addEventListener("dispose",g)}return a}(t);!0===n&&YM.mulAssign(this.morphBaseInfluence),!0===r&&iE.mulAssign(this.morphBaseInfluence);const u=_S(l.width);zC(s,(({i:e})=>{const t=vS(0).toVar();this.mesh.count>1&&null!==this.mesh.morphTexture&&void 0!==this.mesh.morphTexture?t.assign(BM(this.mesh.morphTexture,SS(_S(e).add(1),_S(DC))).r):t.assign(EE("morphTargetInfluences","float").element(e).toVar()),!0===n&&YM.addAssign(jC({bufferMap:a,influence:t,stride:o,width:u,depth:e,offset:_S(0)})),!0===r&&iE.addAssign(jC({bufferMap:a,influence:t,stride:o,width:u,depth:e,offset:_S(1)}))}))}update(){const e=this.morphBaseInfluence;this.mesh.geometry.morphTargetsRelative?e.value=1:e.value=1-this.mesh.morphTargetInfluences.reduce(((e,t)=>e+t),0)}}const XC=AS(WC);class QC extends Sb{static get type(){return"LightingNode"}constructor(){super("vec3"),this.isLightingNode=!0}generate(){console.warn("Abstract function.")}}class YC extends QC{static get type(){return"AONode"}constructor(e=null){super(),this.aoNode=e}setup(e){e.context.ambientOcclusion.mulAssign(this.aoNode)}}class $C extends Yw{static get type(){return"LightingContextNode"}constructor(e,t=null,n=null,r=null){super(e),this.lightingModel=t,this.backdropNode=n,this.backdropAlphaNode=r,this._value=null}getContext(){const{backdropNode:e,backdropAlphaNode:t}=this,n={directDiffuse:MS().toVar("directDiffuse"),directSpecular:MS().toVar("directSpecular"),indirectDiffuse:MS().toVar("indirectDiffuse"),indirectSpecular:MS().toVar("indirectSpecular")};return{radiance:MS().toVar("radiance"),irradiance:MS().toVar("irradiance"),iblIrradiance:MS().toVar("iblIrradiance"),ambientOcclusion:vS(1).toVar("ambientOcclusion"),reflectedLight:n,backdrop:e,backdropAlpha:t}}setup(e){return this.value=this._value||(this._value=this.getContext()),this.value.lightingModel=this.lightingModel||e.context.lightingModel,super.setup(e)}}const KC=AS($C);class ZC extends QC{static get type(){return"IrradianceNode"}constructor(e){super(),this.node=e}setup(e){e.context.irradiance.addAssign(this.node)}}let JC,eR;class tR extends Sb{static get type(){return"ScreenNode"}constructor(e){super(),this.scope=e,this.isViewportNode=!0}getNodeType(){return this.scope===tR.VIEWPORT?"vec4":"vec2"}getUpdateType(){let e=hb;return this.scope!==tR.SIZE&&this.scope!==tR.VIEWPORT||(e=pb),this.updateType=e,e}update({renderer:e}){const t=e.getRenderTarget();this.scope===tR.VIEWPORT?null!==t?eR.copy(t.viewport):(e.getViewport(eR),eR.multiplyScalar(e.getPixelRatio())):null!==t?(JC.width=t.width,JC.height=t.height):e.getDrawingBufferSize(JC)}setup(){const e=this.scope;let t=null;return t=e===tR.SIZE?HS(JC||(JC=new Lt)):e===tR.VIEWPORT?HS(eR||(eR=new en)):bS(iR.div(rR)),t}generate(e){if(this.scope===tR.COORDINATE){let t=e.getFragCoord();if(e.isFlipY()){const n=e.getNodeProperties(rR).outputNode.build(e);t=`${e.getType("vec2")}( ${t}.x, ${n}.y - ${t}.y )`}return t}return super.generate(e)}}tR.COORDINATE="coordinate",tR.VIEWPORT="viewport",tR.SIZE="size",tR.UV="uv";const nR=hS(tR,tR.UV),rR=hS(tR,tR.SIZE),iR=hS(tR,tR.COORDINATE),sR=hS(tR,tR.VIEWPORT);sR.zw,sR.xy;const aR=new Lt;class oR extends IM{static get type(){return"ViewportTextureNode"}constructor(e=nR,t=null,n=null){null===n&&((n=new ns).minFilter=J),super(n,e,t),this.generateMipmaps=!1,this.isOutputTextureNode=!0,this.updateBeforeType=db}updateBefore(e){const t=e.renderer;t.getDrawingBufferSize(aR);const n=this.value;n.image.width===aR.width&&n.image.height===aR.height||(n.image.width=aR.width,n.image.height=aR.height,n.needsUpdate=!0);const r=n.generateMipmaps;n.generateMipmaps=this.generateMipmaps,t.copyFramebufferToTexture(n),n.generateMipmaps=r}clone(){const e=new this.constructor(this.uvNode,this.levelNode,this.value);return e.generateMipmaps=this.generateMipmaps,e}}const lR=AS(oR,null,null,{generateMipmaps:!0});let uR=null;class cR extends oR{static get type(){return"ViewportDepthTextureNode"}constructor(e=nR,t=null){null===uR&&(uR=new rs),super(e,t,uR)}}const AR=AS(cR);class hR extends Sb{static get type(){return"ViewportDepthNode"}constructor(e,t=null){super("float"),this.scope=e,this.valueNode=t,this.isViewportDepthNode=!0}generate(e){const{scope:t}=this;return t===hR.DEPTH_BASE?e.getFragDepth():super.generate(e)}setup({camera:e}){const{scope:t}=this,n=this.valueNode;let r=null;if(t===hR.DEPTH_BASE)null!==n&&(r=gR().assign(n));else if(t===hR.DEPTH)r=e.isPerspectiveCamera?pR(JM.z,OM,FM):dR(JM.z,OM,FM);else if(t===hR.LINEAR_DEPTH)if(null!==n)if(e.isPerspectiveCamera){const e=fR(n,OM,FM);r=dR(e,OM,FM)}else r=n;else r=dR(JM.z,OM,FM);return r}}hR.DEPTH_BASE="depthBase",hR.DEPTH="depth",hR.LINEAR_DEPTH="linearDepth";const dR=(e,t,n)=>e.add(t).div(t.sub(n)),pR=(e,t,n)=>t.add(e).mul(n).div(n.sub(t).mul(e)),fR=(e,t,n)=>t.mul(n).div(n.sub(t).mul(e).sub(n)),mR=(e,t,n)=>{t=t.max(1e-6).toVar();const r=tw(e.negate().div(t)),i=tw(n.div(t));return r.div(i)},gR=AS(hR,hR.DEPTH_BASE),vR=hS(hR,hR.DEPTH);hR.LINEAR_DEPTH;AR(),vR.assign=e=>gR(e);const _R=AS(class extends Sb{constructor(e){super("float"),this.name=e,this.isBuiltinNode=!0}generate(){return this.name}});class yR extends Sb{static get type(){return"ClippingNode"}constructor(e=yR.DEFAULT){super(),this.scope=e}setup(e){super.setup(e);const t=e.clippingContext,{intersectionPlanes:n,unionPlanes:r}=t;return this.hardwareClipping=e.material.hardwareClipping,this.scope===yR.ALPHA_TO_COVERAGE?this.setupAlphaToCoverage(n,r):this.scope===yR.HARDWARE?this.setupHardwareClipping(r,e):this.setupDefault(n,r)}setupAlphaToCoverage(e,t){return dS((()=>{const n=vS().toVar("distanceToPlane"),r=vS().toVar("distanceToGradient"),i=vS(1).toVar("clipOpacity"),s=t.length;if(!this.hardwareClipping&&s>0){const e=TE(t);zC(s,(({i:t})=>{const s=e.element(t);n.assign(JM.dot(s.xyz).negate().add(s.w)),r.assign(n.fwidth().div(2)),i.mulAssign(Hw(r.negate(),r,n))}))}const a=e.length;if(a>0){const t=TE(e),s=vS(1).toVar("intersectionClipOpacity");zC(a,(({i:e})=>{const i=t.element(e);n.assign(JM.dot(i.xyz).negate().add(i.w)),r.assign(n.fwidth().div(2)),s.mulAssign(Hw(r.negate(),r,n).oneMinus())})),i.mulAssign(s.oneMinus())}XS.a.mulAssign(i),XS.a.equal(0).discard()}))()}setupDefault(e,t){return dS((()=>{const n=t.length;if(!this.hardwareClipping&&n>0){const e=TE(t);zC(n,(({i:t})=>{const n=e.element(t);JM.dot(n.xyz).greaterThan(n.w).discard()}))}const r=e.length;if(r>0){const t=TE(e),n=xS(!0).toVar("clipped");zC(r,(({i:e})=>{const r=t.element(e);n.assign(JM.dot(r.xyz).greaterThan(r.w).and(n))})),n.discard()}}))()}setupHardwareClipping(e,t){const n=e.length;return t.enableHardwareClipping(n),dS((()=>{const r=TE(e),i=_R(t.getClipDistance());zC(n,(({i:e})=>{const t=r.element(e),n=JM.dot(t.xyz).sub(t.w).negate();i.element(e).assign(n)}))}))()}}yR.ALPHA_TO_COVERAGE="alphaToCoverage",yR.DEFAULT="default",yR.HARDWARE="hardware";const xR=dS((([e])=>ow(wT(1e4,lw(wT(17,e.x).add(wT(.1,e.y)))).mul(ST(.1,pw(lw(wT(13,e.y).add(e.x)))))))),bR=dS((([e])=>xR(bS(xR(e.xy),e.z)))),SR=dS((([e])=>{const t=Cw(mw(_w(e.xyz)),mw(yw(e.xyz))),n=vS(1).div(vS(.05).mul(t)).toVar("pixScale"),r=bS(JT(iw(tw(n))),JT(sw(tw(n)))),i=bS(bR(iw(r.x.mul(e.xyz))),bR(iw(r.y.mul(e.xyz)))),s=ow(tw(n)),a=ST(wT(s.oneMinus(),i.x),wT(s,i.y)),o=Ew(s,s.oneMinus()),l=MS(a.mul(a).div(wT(2,o).mul(TT(1,o))),a.sub(wT(.5,o)).div(TT(1,o)),TT(1,TT(1,a).mul(TT(1,a)).div(wT(2,o).mul(TT(1,o))))),u=a.lessThan(o.oneMinus()).select(a.lessThan(o).select(l.x,l.y),l.z);return zw(u,1e-6,1)})).setLayout({name:"getAlphaHashThreshold",type:"float",inputs:[{name:"position",type:"vec3"}]});class TR extends Dr{static get type(){return"NodeMaterial"}get type(){return this.constructor.type}set type(e){}constructor(){super(),this.isNodeMaterial=!0,this.forceSinglePass=!1,this.fog=!0,this.lights=!1,this.hardwareClipping=!1,this.lightsNode=null,this.envNode=null,this.aoNode=null,this.colorNode=null,this.normalNode=null,this.opacityNode=null,this.backdropNode=null,this.backdropAlphaNode=null,this.alphaTestNode=null,this.positionNode=null,this.geometryNode=null,this.depthNode=null,this.shadowPositionNode=null,this.receivedShadowNode=null,this.castShadowNode=null,this.outputNode=null,this.mrtNode=null,this.fragmentNode=null,this.vertexNode=null}customProgramCacheKey(){return this.type+ab(this)}build(e){this.setup(e)}setupObserver(e){return new nb(e)}setup(e){e.context.setupNormal=()=>this.setupNormal(e);const t=e.renderer,n=t.getRenderTarget();let r;e.addStack(),e.stack.outputNode=this.vertexNode||this.setupPosition(e),null!==this.geometryNode&&(e.stack.outputNode=e.stack.outputNode.bypass(this.geometryNode)),e.addFlow("vertex",e.removeStack()),e.addStack();const i=this.setupClipping(e);if(!0===this.depthWrite&&(null!==n?!0===n.depthBuffer&&this.setupDepth(e):!0===t.depth&&this.setupDepth(e)),null===this.fragmentNode){this.setupDiffuseColor(e),this.setupVariants(e);const s=this.setupLighting(e);null!==i&&e.stack.add(i);const a=NS(s,XS.a).max(0);if(r=this.setupOutput(e,a),AT.assign(r),null!==this.outputNode&&(r=this.outputNode),null!==n){const e=t.getMRT(),n=this.mrtNode;null!==e?(r=e,null!==n&&(r=e.merge(n))):null!==n&&(r=n)}}else{let t=this.fragmentNode;!0!==t.isOutputStructNode&&(t=NS(t)),r=this.setupOutput(e,t)}e.stack.outputNode=r,e.addFlow("fragment",e.removeStack()),e.monitor=this.setupObserver(e)}setupClipping(e){if(null===e.clippingContext)return null;const{unionPlanes:t,intersectionPlanes:n}=e.clippingContext;let r=null;if(t.length>0||n.length>0){const t=e.renderer.samples;this.alphaToCoverage&&t>1?r=lS(new yR(yR.ALPHA_TO_COVERAGE)):e.stack.add(lS(new yR))}return r}setupHardwareClipping(e){if(this.hardwareClipping=!1,null===e.clippingContext)return;const t=e.clippingContext.unionPlanes.length;t>0&&t<=8&&e.isAvailable("clipDistance")&&(e.stack.add(lS(new yR(yR.HARDWARE))),this.hardwareClipping=!0)}setupDepth(e){const{renderer:t,camera:n}=e;let r=this.depthNode;if(null===r){const e=t.getMRT();e&&e.has("depth")?r=e.get("depth"):!0===t.logarithmicDepthBuffer&&(r=n.isPerspectiveCamera?mR(JM.z,OM,FM):dR(JM.z,OM,FM))}null!==r&&vR.assign(r).append()}setupPosition(e){const{object:t}=e,n=t.geometry;var r;if(e.addStack(),(n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color)&&XC(t).append(),!0===t.isSkinnedMesh&&(r=t,lS(new qC(r,!0))).append(),this.displacementMap){const e=NE("displacementMap","texture"),t=NE("displacementScale","float"),n=NE("displacementBias","float");YM.addAssign(iE.normalize().mul(e.x.mul(t).add(n)))}t.isBatchedMesh&&FC(t).append(),t.isInstancedMesh&&t.instanceMatrix&&!0===t.instanceMatrix.isInstancedBufferAttribute&&BC(t).append(),null!==this.positionNode&&YM.assign(this.positionNode),this.setupHardwareClipping(e);const i=RC();return e.context.vertex=e.removeStack(),e.context.mvp=i,i}setupDiffuseColor({object:e,geometry:t}){let n=this.colorNode?NS(this.colorNode):XE;if(!0===this.vertexColors&&t.hasAttribute("color")&&(n=NS(n.xyz.mul(CM("color","vec3")),n.a)),e.instanceColor){n=WS("vec3","vInstanceColor").mul(n)}if(e.isBatchedMesh&&e._colorsTexture){n=WS("vec3","vBatchColor").mul(n)}XS.assign(n);const r=this.opacityNode?vS(this.opacityNode):$E;if(XS.a.assign(XS.a.mul(r)),null!==this.alphaTestNode||this.alphaTest>0){const e=null!==this.alphaTestNode?vS(this.alphaTestNode):WE;XS.a.lessThanEqual(e).discard()}!0===this.alphaHash&&XS.a.lessThan(SR(YM)).discard(),!1===this.transparent&&1===this.blending&&!1===this.alphaToCoverage&&XS.a.assign(1)}setupVariants(){}setupOutgoingLight(){return!0===this.lights?MS(0):XS.rgb}setupNormal(){return this.normalNode?MS(this.normalNode):iC}setupEnvironment(){let e=null;return this.envNode?e=this.envNode:this.envMap&&(e=this.envMap.isCubeTexture?NE("envMap","cubeTexture"):NE("envMap","texture")),e}setupLightMap(e){let t=null;return e.material.lightMap&&(t=new ZC(wC)),t}setupLights(e){const t=[],n=this.setupEnvironment(e);n&&n.isLightingNode&&t.push(n);const r=this.setupLightMap(e);if(r&&r.isLightingNode&&t.push(r),null!==this.aoNode||e.material.aoMap){const e=null!==this.aoNode?this.aoNode:MC;t.push(new YC(e))}let i=this.lightsNode||e.lightsNode;return t.length>0&&(i=e.renderer.lighting.createNode([...i.getLights(),...t])),i}setupLightingModel(){}setupLighting(e){const{material:t}=e,{backdropNode:n,backdropAlphaNode:r,emissiveNode:i}=this,s=!0===this.lights||null!==this.lightsNode?this.setupLights(e):null;let a=this.setupOutgoingLight(e);if(s&&s.getScope().hasLights){const t=this.setupLightingModel(e);a=KC(s,t,n,r)}else null!==n&&(a=MS(null!==r?Gw(a,n,r):n));return(i&&!0===i.isNode||t.emissive&&!0===t.emissive.isColor)&&(QS.assign(MS(i||YE)),a=a.add(QS)),a}setupOutput(e,t){if(!0===this.fog){const n=e.fogNode;n&&(t=NS(n.mix(t.rgb,n.colorNode),t.a))}return t}setDefaultValues(e){for(const t in e){const n=e[t];void 0===this[t]&&(this[t]=n,n&&n.clone&&(this[t]=n.clone()))}const t=Object.getOwnPropertyDescriptors(e.constructor.prototype);for(const e in t)void 0===Object.getOwnPropertyDescriptor(this.constructor.prototype,e)&&void 0!==t[e].get&&Object.defineProperty(this.constructor.prototype,e,t[e])}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{},nodes:{}});const n=Dr.prototype.toJSON.call(this,e),r=ob(this);n.inputNodes={};for(const{property:t,childNode:i}of r)n.inputNodes[t]=i.toJSON(e).uuid;function i(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}if(t){const t=i(e.textures),r=i(e.images),s=i(e.nodes);t.length>0&&(n.textures=t),r.length>0&&(n.images=r),s.length>0&&(n.nodes=s)}return n}copy(e){return this.lightsNode=e.lightsNode,this.envNode=e.envNode,this.colorNode=e.colorNode,this.normalNode=e.normalNode,this.opacityNode=e.opacityNode,this.backdropNode=e.backdropNode,this.backdropAlphaNode=e.backdropAlphaNode,this.alphaTestNode=e.alphaTestNode,this.positionNode=e.positionNode,this.geometryNode=e.geometryNode,this.depthNode=e.depthNode,this.shadowPositionNode=e.shadowPositionNode,this.receivedShadowNode=e.receivedShadowNode,this.castShadowNode=e.castShadowNode,this.outputNode=e.outputNode,this.mrtNode=e.mrtNode,this.fragmentNode=e.fragmentNode,this.vertexNode=e.vertexNode,super.copy(e)}}const wR=new Gi;class MR extends TR{static get type(){return"LineBasicNodeMaterial"}constructor(e){super(),this.isLineBasicNodeMaterial=!0,this.lights=!1,this.setDefaultValues(wR),this.setValues(e)}}const ER=new ga;class CR extends TR{static get type(){return"LineDashedNodeMaterial"}constructor(e){super(),this.isLineDashedNodeMaterial=!0,this.lights=!1,this.setDefaultValues(ER),this.dashOffset=0,this.offsetNode=null,this.dashScaleNode=null,this.dashSizeNode=null,this.gapSizeNode=null,this.setValues(e)}setupVariants(){const e=this.offsetNode?vS(this.offsetNodeNode):SC,t=this.dashScaleNode?vS(this.dashScaleNode):yC,n=this.dashSizeNode?vS(this.dashSizeNode):xC,r=this.dashSizeNode?vS(this.dashGapNode):bC;hT.assign(n),dT.assign(r);const i=eM(CM("lineDistance").mul(t));(e?i.add(e):i).mod(hT.add(dT)).greaterThan(hT).discard()}}const RR=new ha;class NR extends TR{static get type(){return"MeshNormalNodeMaterial"}constructor(e){super(),this.lights=!1,this.isMeshNormalNodeMaterial=!0,this.setDefaultValues(RR),this.setValues(e)}setupDiffuseColor(){const e=this.opacityNode?vS(this.opacityNode):$E;XS.assign(NS(lS(lE).mul(.5).add(.5),e))}}class PR extends Mb{static get type(){return"EquirectUVNode"}constructor(e=ZM){super("vec2"),this.dirNode=e}setup(){const e=this.dirNode,t=e.z.atan2(e.x).mul(1/(2*Math.PI)).add(.5),n=e.y.clamp(-1,1).asin().mul(1/Math.PI).add(.5);return bS(t,n)}}const DR=AS(PR);class LR extends Mi{constructor(e=1,t={}){super(e,t),this.isCubeRenderTarget=!0}fromEquirectangularTexture(e,t){const n=t.minFilter,r=t.generateMipmaps;t.generateMipmaps=!0,this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i=new hi(5,5,5),s=DR(ZM),a=new TR;a.colorNode=UM(t,s,0),a.side=1,a.blending=0;const o=new ci(i,a),l=new Ei;l.add(o),t.minFilter===J&&(t.minFilter=K);const u=new Ti(1,10,this),c=e.getMRT();return e.setMRT(null),u.update(e,l),e.setMRT(c),t.minFilter=n,t.currentGenerateMipmaps=r,o.geometry.dispose(),o.material.dispose(),this}}const IR=new WeakMap;class UR extends Mb{static get type(){return"CubeMapNode"}constructor(e){super("vec3"),this.envNode=e,this._cubeTexture=null,this._cubeTextureNode=_E();const t=new wi;t.isRenderTargetTexture=!0,this._defaultTexture=t,this.updateBeforeType=pb}updateBefore(e){const{renderer:t,material:n}=e,r=this.envNode;if(r.isTextureNode||r.isMaterialReferenceNode){const e=r.isTextureNode?r.value:n[r.property];if(e&&e.isTexture){const n=e.mapping;if(n===z||n===V){if(IR.has(e)){const t=IR.get(e);OR(t,e.mapping),this._cubeTexture=t}else{const n=e.image;if(function(e){return null!=e&&e.height>0}(n)){const r=new LR(n.height);r.fromEquirectangularTexture(t,e),OR(r.texture,e.mapping),this._cubeTexture=r.texture,IR.set(e,r.texture),e.addEventListener("dispose",BR)}else this._cubeTexture=this._defaultTexture}this._cubeTextureNode.value=this._cubeTexture}else this._cubeTextureNode=this.envNode}}}setup(e){return this.updateBefore(e),this._cubeTextureNode}}function BR(e){const t=e.target;t.removeEventListener("dispose",BR);const n=IR.get(t);void 0!==n&&(IR.delete(t),n.dispose())}function OR(e,t){t===z?e.mapping=q:t===V&&(e.mapping=G)}const FR=AS(UR);class kR extends QC{static get type(){return"BasicEnvironmentNode"}constructor(e=null){super(),this.envNode=e}setup(e){e.context.environment=FR(this.envNode)}}class qR extends QC{static get type(){return"BasicLightMapNode"}constructor(e=null){super(),this.lightMapNode=e}setup(e){const t=vS(1/Math.PI);e.context.irradianceLightMap=this.lightMapNode.mul(t)}}class GR{start(){}finish(){}direct(){}directRectArea(){}indirect(){}ambientOcclusion(){}}class zR extends GR{constructor(){super()}indirect(e,t,n){const r=e.ambientOcclusion,i=e.reflectedLight,s=n.context.irradianceLightMap;i.indirectDiffuse.assign(NS(0)),s?i.indirectDiffuse.addAssign(s):i.indirectDiffuse.addAssign(NS(1,1,1,0)),i.indirectDiffuse.mulAssign(r),i.indirectDiffuse.mulAssign(XS.rgb)}finish(e,t,n){const r=n.material,i=e.outgoingLight,s=n.context.environment;if(s)switch(r.combine){case 0:i.rgb.assign(Gw(i.rgb,i.rgb.mul(s.rgb),eC.mul(tC)));break;case 1:i.rgb.assign(Gw(i.rgb,s.rgb,eC.mul(tC)));break;case 2:i.rgb.addAssign(s.rgb.mul(eC.mul(tC)));break;default:console.warn("THREE.BasicLightingModel: Unsupported .combine value:",r.combine)}}}const VR=new Lr;class HR extends TR{static get type(){return"MeshBasicNodeMaterial"}constructor(e){super(),this.isMeshBasicNodeMaterial=!0,this.lights=!0,this.setDefaultValues(VR),this.setValues(e)}setupNormal(){return aE}setupEnvironment(e){const t=super.setupEnvironment(e);return t?new kR(t):null}setupLightMap(e){let t=null;return e.material.lightMap&&(t=new qR(wC)),t}setupOutgoingLight(){return XS.rgb}setupLightingModel(){return new zR}}const jR=dS((({f0:e,f90:t,dotVH:n})=>{const r=n.mul(-5.55473).sub(6.98316).mul(n).exp2();return e.mul(r.oneMinus()).add(t.mul(r))})),WR=dS((e=>e.diffuseColor.mul(1/Math.PI))),XR=dS((({dotNH:e})=>cT.mul(vS(.5)).add(1).mul(vS(1/Math.PI)).mul(e.pow(cT)))),QR=dS((({lightDirection:e})=>{const t=e.add(eE).normalize(),n=lE.dot(t).clamp(),r=eE.dot(t).clamp(),i=jR({f0:lT,f90:1,dotVH:r}),s=vS(.25),a=XR({dotNH:n});return i.mul(s).mul(a)}));class YR extends zR{constructor(e=!0){super(),this.specular=e}direct({lightDirection:e,lightColor:t,reflectedLight:n}){const r=lE.dot(e).clamp().mul(t);n.directDiffuse.addAssign(r.mul(WR({diffuseColor:XS.rgb}))),!0===this.specular&&n.directSpecular.addAssign(r.mul(QR({lightDirection:e})).mul(eC))}indirect({ambientOcclusion:e,irradiance:t,reflectedLight:n}){n.indirectDiffuse.addAssign(t.mul(WR({diffuseColor:XS}))),n.indirectDiffuse.mulAssign(e)}}const $R=new da;class KR extends TR{static get type(){return"MeshLambertNodeMaterial"}constructor(e){super(),this.isMeshLambertNodeMaterial=!0,this.lights=!0,this.setDefaultValues($R),this.setValues(e)}setupEnvironment(e){const t=super.setupEnvironment(e);return t?new kR(t):null}setupLightingModel(){return new YR(!1)}}const ZR=new ca;class JR extends TR{static get type(){return"MeshPhongNodeMaterial"}constructor(e){super(),this.isMeshPhongNodeMaterial=!0,this.lights=!0,this.shininessNode=null,this.specularNode=null,this.setDefaultValues(ZR),this.setValues(e)}setupEnvironment(e){const t=super.setupEnvironment(e);return t?new kR(t):null}setupLightingModel(){return new YR}setupVariants(){const e=(this.shininessNode?vS(this.shininessNode):QE).max(1e-4);cT.assign(e);const t=this.specularNode||KE;lT.assign(t)}copy(e){return this.shininessNode=e.shininessNode,this.specularNode=e.specularNode,super.copy(e)}}const eN=dS((e=>{if(!1===e.geometry.hasAttribute("normal"))return vS(0);const t=aE.dFdx().abs().max(aE.dFdy().abs());return t.x.max(t.y).max(t.z)})),tN=dS((e=>{const{roughness:t}=e,n=eN();let r=t.max(.0525);return r=r.add(n),r=r.min(1),r})),nN=dS((({alpha:e,dotNL:t,dotNV:n})=>{const r=e.pow2(),i=t.mul(r.add(r.oneMinus().mul(n.pow2())).sqrt()),s=n.mul(r.add(r.oneMinus().mul(t.pow2())).sqrt());return MT(.5,i.add(s).max(jT))})).setLayout({name:"V_GGX_SmithCorrelated",type:"float",inputs:[{name:"alpha",type:"float"},{name:"dotNL",type:"float"},{name:"dotNV",type:"float"}]}),rN=dS((({alphaT:e,alphaB:t,dotTV:n,dotBV:r,dotTL:i,dotBL:s,dotNV:a,dotNL:o})=>{const l=o.mul(MS(e.mul(n),t.mul(r),a).length()),u=a.mul(MS(e.mul(i),t.mul(s),o).length());return MT(.5,l.add(u)).saturate()})).setLayout({name:"V_GGX_SmithCorrelated_Anisotropic",type:"float",inputs:[{name:"alphaT",type:"float",qualifier:"in"},{name:"alphaB",type:"float",qualifier:"in"},{name:"dotTV",type:"float",qualifier:"in"},{name:"dotBV",type:"float",qualifier:"in"},{name:"dotTL",type:"float",qualifier:"in"},{name:"dotBL",type:"float",qualifier:"in"},{name:"dotNV",type:"float",qualifier:"in"},{name:"dotNL",type:"float",qualifier:"in"}]}),iN=dS((({alpha:e,dotNH:t})=>{const n=e.pow2(),r=t.pow2().mul(n.oneMinus()).oneMinus();return n.div(r.pow2()).mul(1/Math.PI)})).setLayout({name:"D_GGX",type:"float",inputs:[{name:"alpha",type:"float"},{name:"dotNH",type:"float"}]}),sN=vS(1/Math.PI),aN=dS((({alphaT:e,alphaB:t,dotNH:n,dotTH:r,dotBH:i})=>{const s=e.mul(t),a=MS(t.mul(r),e.mul(i),s.mul(n)),o=a.dot(a),l=s.div(o);return sN.mul(s.mul(l.pow2()))})).setLayout({name:"D_GGX_Anisotropic",type:"float",inputs:[{name:"alphaT",type:"float",qualifier:"in"},{name:"alphaB",type:"float",qualifier:"in"},{name:"dotNH",type:"float",qualifier:"in"},{name:"dotTH",type:"float",qualifier:"in"},{name:"dotBH",type:"float",qualifier:"in"}]}),oN=dS((e=>{const{lightDirection:t,f0:n,f90:r,roughness:i,f:s,USE_IRIDESCENCE:a,USE_ANISOTROPY:o}=e,l=e.normalView||lE,u=i.pow2(),c=t.add(eE).normalize(),A=l.dot(t).clamp(),h=l.dot(eE).clamp(),d=l.dot(c).clamp(),p=eE.dot(c).clamp();let f,m,g=jR({f0:n,f90:r,dotVH:p});if(aS(a)&&(g=tT.mix(g,s)),aS(o)){const e=aT.dot(t),n=aT.dot(eE),r=aT.dot(c),i=oT.dot(t),s=oT.dot(eE),a=oT.dot(c);f=rN({alphaT:iT,alphaB:u,dotTV:n,dotBV:s,dotTL:e,dotBL:i,dotNV:h,dotNL:A}),m=aN({alphaT:iT,alphaB:u,dotNH:d,dotTH:r,dotBH:a})}else f=nN({alpha:u,dotNL:A,dotNV:h}),m=iN({alpha:u,dotNH:d});return g.mul(f).mul(m)})),lN=dS((({roughness:e,dotNV:t})=>{const n=NS(-1,-.0275,-.572,.022),r=NS(1,.0425,1.04,-.04),i=e.mul(n).add(r),s=i.x.mul(i.x).min(t.mul(-9.28).exp2()).mul(i.x).add(i.y);return bS(-1.04,1.04).mul(s).add(i.zw)})).setLayout({name:"DFGApprox",type:"vec2",inputs:[{name:"roughness",type:"float"},{name:"dotNV",type:"vec3"}]}),uN=dS((e=>{const{dotNV:t,specularColor:n,specularF90:r,roughness:i}=e,s=lN({dotNV:t,roughness:i});return n.mul(s.x).add(r.mul(s.y))})),cN=dS((({f:e,f90:t,dotVH:n})=>{const r=n.oneMinus().saturate(),i=r.mul(r),s=r.mul(i,i).clamp(0,.9999);return e.sub(MS(t).mul(s)).div(s.oneMinus())})).setLayout({name:"Schlick_to_F0",type:"vec3",inputs:[{name:"f",type:"vec3"},{name:"f90",type:"float"},{name:"dotVH",type:"float"}]}),AN=dS((({roughness:e,dotNH:t})=>{const n=e.pow2(),r=vS(1).div(n),i=t.pow2().oneMinus().max(.0078125);return vS(2).add(r).mul(i.pow(r.mul(.5))).div(2*Math.PI)})).setLayout({name:"D_Charlie",type:"float",inputs:[{name:"roughness",type:"float"},{name:"dotNH",type:"float"}]}),hN=dS((({dotNV:e,dotNL:t})=>vS(1).div(vS(4).mul(t.add(e).sub(t.mul(e)))))).setLayout({name:"V_Neubelt",type:"float",inputs:[{name:"dotNV",type:"float"},{name:"dotNL",type:"float"}]}),dN=dS((({lightDirection:e})=>{const t=e.add(eE).normalize(),n=lE.dot(e).clamp(),r=lE.dot(eE).clamp(),i=lE.dot(t).clamp(),s=AN({roughness:eT,dotNH:i}),a=hN({dotNV:r,dotNL:n});return JS.mul(s).mul(a)})),pN=dS((({N:e,V:t,roughness:n})=>{const r=e.dot(t).saturate(),i=bS(n,r.oneMinus().sqrt());return i.assign(i.mul(.984375).add(.0078125)),i})).setLayout({name:"LTC_Uv",type:"vec2",inputs:[{name:"N",type:"vec3"},{name:"V",type:"vec3"},{name:"roughness",type:"float"}]}),fN=dS((({f:e})=>{const t=e.length();return Cw(t.mul(t).add(e.z).div(t.add(1)),0)})).setLayout({name:"LTC_ClippedSphereFormFactor",type:"float",inputs:[{name:"f",type:"vec3"}]}),mN=dS((({v1:e,v2:t})=>{const n=e.dot(t),r=n.abs().toVar(),i=r.mul(.0145206).add(.4965155).mul(r).add(.8543985).toVar(),s=r.add(4.1616724).mul(r).add(3.417594).toVar(),a=i.div(s),o=n.greaterThan(0).select(a,Cw(n.mul(n).oneMinus(),1e-7).inverseSqrt().mul(.5).sub(a));return e.cross(t).mul(o)})).setLayout({name:"LTC_EdgeVectorFormFactor",type:"vec3",inputs:[{name:"v1",type:"vec3"},{name:"v2",type:"vec3"}]}),gN=dS((({N:e,V:t,P:n,mInv:r,p0:i,p1:s,p2:a,p3:o})=>{const l=s.sub(i).toVar(),u=o.sub(i).toVar(),c=l.cross(u),A=MS().toVar();return mS(c.dot(n.sub(i)).greaterThanEqual(0),(()=>{const l=t.sub(e.mul(t.dot(e))).normalize(),u=e.cross(l).negate(),c=r.mul(US(l,u,e).transpose()).toVar(),h=c.mul(i.sub(n)).normalize().toVar(),d=c.mul(s.sub(n)).normalize().toVar(),p=c.mul(a.sub(n)).normalize().toVar(),f=c.mul(o.sub(n)).normalize().toVar(),m=MS(0).toVar();m.addAssign(mN({v1:h,v2:d})),m.addAssign(mN({v1:d,v2:p})),m.addAssign(mN({v1:p,v2:f})),m.addAssign(mN({v1:f,v2:h})),A.assign(MS(fN({f:m})))})),A})).setLayout({name:"LTC_Evaluate",type:"vec3",inputs:[{name:"N",type:"vec3"},{name:"V",type:"vec3"},{name:"P",type:"vec3"},{name:"mInv",type:"mat3"},{name:"p0",type:"vec3"},{name:"p1",type:"vec3"},{name:"p2",type:"vec3"},{name:"p3",type:"vec3"}]}),vN=1/6,_N=e=>wT(vN,wT(e,wT(e,e.negate().add(3)).sub(3)).add(1)),yN=e=>wT(vN,wT(e,wT(e,wT(3,e).sub(6))).add(4)),xN=e=>wT(vN,wT(e,wT(e,wT(-3,e).add(3)).add(3)).add(1)),bN=e=>wT(vN,Bw(e,3)),SN=e=>_N(e).add(yN(e)),TN=e=>xN(e).add(bN(e)),wN=e=>ST(-1,yN(e).div(_N(e).add(yN(e)))),MN=e=>ST(1,bN(e).div(xN(e).add(bN(e)))),EN=(e,t,n)=>{const r=e.uvNode,i=wT(r,t.zw).add(.5),s=iw(i),a=ow(i),o=SN(a.x),l=TN(a.x),u=wN(a.x),c=MN(a.x),A=wN(a.y),h=MN(a.y),d=bS(s.x.add(u),s.y.add(A)).sub(.5).mul(t.xy),p=bS(s.x.add(c),s.y.add(A)).sub(.5).mul(t.xy),f=bS(s.x.add(u),s.y.add(h)).sub(.5).mul(t.xy),m=bS(s.x.add(c),s.y.add(h)).sub(.5).mul(t.xy),g=SN(a.y).mul(ST(o.mul(e.uv(d).level(n)),l.mul(e.uv(p).level(n)))),v=TN(a.y).mul(ST(o.mul(e.uv(f).level(n)),l.mul(e.uv(m).level(n))));return g.add(v)},CN=dS((([e,t=vS(3)])=>{const n=bS(e.size(_S(t))),r=bS(e.size(_S(t.add(1)))),i=MT(1,n),s=MT(1,r),a=EN(e,NS(i,n),iw(t)),o=EN(e,NS(s,r),sw(t));return ow(t).mix(a,o)})),RN=dS((([e,t,n,r,i])=>{const s=MS(Vw(t.negate(),aw(e),MT(1,r))),a=MS(mw(i[0].xyz),mw(i[1].xyz),mw(i[2].xyz));return aw(s).mul(n.mul(a))})).setLayout({name:"getVolumeTransmissionRay",type:"vec3",inputs:[{name:"n",type:"vec3"},{name:"v",type:"vec3"},{name:"thickness",type:"float"},{name:"ior",type:"float"},{name:"modelMatrix",type:"mat4"}]}),NN=dS((([e,t])=>e.mul(zw(t.mul(2).sub(2),0,1)))).setLayout({name:"applyIorToRoughness",type:"float",inputs:[{name:"roughness",type:"float"},{name:"ior",type:"float"}]}),PN=lR(),DN=lR(),LN=dS((([e,t,n],{material:r})=>{const i=(1==r.side?PN:DN).uv(e),s=tw(rR.x).mul(NN(t,n));return CN(i,s)})),IN=dS((([e,t,n])=>(mS(n.notEqual(0),(()=>{const r=ew(t).negate().div(n);return ZT(r.negate().mul(e))})),MS(1)))).setLayout({name:"volumeAttenuation",type:"vec3",inputs:[{name:"transmissionDistance",type:"float"},{name:"attenuationColor",type:"vec3"},{name:"attenuationDistance",type:"float"}]}),UN=dS((([e,t,n,r,i,s,a,o,l,u,c,A,h,d,p])=>{let f,m;if(p){f=NS().toVar(),m=MS().toVar();const i=c.sub(1).mul(p.mul(.025)),s=MS(c.sub(i),c,c.add(i));zC({start:0,end:3},(({i:i})=>{const c=s.element(i),p=RN(e,t,A,c,o),g=a.add(p),v=u.mul(l.mul(NS(g,1))),_=bS(v.xy.div(v.w)).toVar();_.addAssign(1),_.divAssign(2),_.assign(bS(_.x,_.y.oneMinus()));const y=LN(_,n,c);f.element(i).assign(y.element(i)),f.a.addAssign(y.a),m.element(i).assign(r.element(i).mul(IN(mw(p),h,d).element(i)))})),f.a.divAssign(3)}else{const i=RN(e,t,A,c,o),s=a.add(i),p=u.mul(l.mul(NS(s,1))),g=bS(p.xy.div(p.w)).toVar();g.addAssign(1),g.divAssign(2),g.assign(bS(g.x,g.y.oneMinus())),f=LN(g,n,c),m=r.mul(IN(mw(i),h,d))}const g=m.rgb.mul(f.rgb),v=e.dot(t).clamp(),_=MS(uN({dotNV:v,specularColor:i,specularF90:s,roughness:n})),y=m.r.add(m.g,m.b).div(3);return NS(_.oneMinus().mul(g),f.a.oneMinus().mul(y).oneMinus())})),BN=US(3.2404542,-.969266,.0556434,-1.5371385,1.8760108,-.2040259,-.4985314,.041556,1.0572252),ON=(e,t)=>e.sub(t).div(e.add(t)).pow2(),FN=dS((({outsideIOR:e,eta2:t,cosTheta1:n,thinFilmThickness:r,baseF0:i})=>{const s=Gw(e,t,Hw(0,.03,r)),a=e.div(s).pow2().mul(n.pow2().oneMinus()).oneMinus();mS(a.lessThan(0),(()=>MS(1)));const o=a.sqrt(),l=ON(s,e),u=jR({f0:l,f90:1,dotVH:n}),c=u.oneMinus(),A=s.lessThan(e).select(Math.PI,0),h=vS(Math.PI).sub(A),d=(e=>{const t=e.sqrt();return MS(1).add(t).div(MS(1).sub(t))})(i.clamp(0,.9999)),p=ON(d,s.toVec3()),f=jR({f0:p,f90:1,dotVH:o}),m=MS(d.x.lessThan(s).select(Math.PI,0),d.y.lessThan(s).select(Math.PI,0),d.z.lessThan(s).select(Math.PI,0)),g=s.mul(r,o,2),v=MS(h).add(m),_=u.mul(f).clamp(1e-5,.9999),y=_.sqrt(),x=c.pow2().mul(f).div(MS(1).sub(_)),b=u.add(x).toVar(),S=x.sub(c).toVar();return zC({start:1,end:2,condition:"<=",name:"m"},(({m:e})=>{S.mulAssign(y);const t=((e,t)=>{const n=e.mul(2*Math.PI*1e-9),r=MS(54856e-17,44201e-17,52481e-17),i=MS(1681e3,1795300,2208400),s=MS(43278e5,93046e5,66121e5),a=vS(9747e-17*Math.sqrt(2*Math.PI*45282e5)).mul(n.mul(2239900).add(t.x).cos()).mul(n.pow2().mul(-45282e5).exp());let o=r.mul(s.mul(2*Math.PI).sqrt()).mul(i.mul(n).add(t).cos()).mul(n.pow2().negate().mul(s).exp());return o=MS(o.x.add(a),o.y,o.z).div(1.0685e-7),BN.mul(o)})(vS(e).mul(g),vS(e).mul(v)).mul(2);b.addAssign(S.mul(t))})),b.max(MS(0))})).setLayout({name:"evalIridescence",type:"vec3",inputs:[{name:"outsideIOR",type:"float"},{name:"eta2",type:"float"},{name:"cosTheta1",type:"float"},{name:"thinFilmThickness",type:"float"},{name:"baseF0",type:"vec3"}]}),kN=dS((({normal:e,viewDir:t,roughness:n})=>{const r=e.dot(t).saturate(),i=n.pow2(),s=Qw(n.lessThan(.25),vS(-339.2).mul(i).add(vS(161.4).mul(n)).sub(25.9),vS(-8.48).mul(i).add(vS(14.3).mul(n)).sub(9.95)),a=Qw(n.lessThan(.25),vS(44).mul(i).sub(vS(23.7).mul(n)).add(3.26),vS(1.97).mul(i).sub(vS(3.27).mul(n)).add(.72));return Qw(n.lessThan(.25),0,vS(.1).mul(n).sub(.025)).add(s.mul(r).add(a).exp()).mul(1/Math.PI).saturate()})),qN=MS(.04),GN=vS(1);class zN extends GR{constructor(e=!1,t=!1,n=!1,r=!1,i=!1,s=!1){super(),this.clearcoat=e,this.sheen=t,this.iridescence=n,this.anisotropy=r,this.transmission=i,this.dispersion=s,this.clearcoatRadiance=null,this.clearcoatSpecularDirect=null,this.clearcoatSpecularIndirect=null,this.sheenSpecularDirect=null,this.sheenSpecularIndirect=null,this.iridescenceFresnel=null,this.iridescenceF0=null}start(e){if(!0===this.clearcoat&&(this.clearcoatRadiance=MS().toVar("clearcoatRadiance"),this.clearcoatSpecularDirect=MS().toVar("clearcoatSpecularDirect"),this.clearcoatSpecularIndirect=MS().toVar("clearcoatSpecularIndirect")),!0===this.sheen&&(this.sheenSpecularDirect=MS().toVar("sheenSpecularDirect"),this.sheenSpecularIndirect=MS().toVar("sheenSpecularIndirect")),!0===this.iridescence){const e=lE.dot(eE).clamp();this.iridescenceFresnel=FN({outsideIOR:vS(1),eta2:nT,cosTheta1:e,thinFilmThickness:rT,baseF0:lT}),this.iridescenceF0=cN({f:this.iridescenceFresnel,f90:1,dotVH:e})}if(!0===this.transmission){const t=KM,n=GM.sub(KM).normalize(),r=uE;e.backdrop=UN(r,n,YS,XS,lT,uT,t,jM,qM,kM,pT,mT,vT,gT,this.dispersion?_T:null),e.backdropAlpha=fT,XS.a.mulAssign(Gw(1,e.backdrop.a,fT))}}computeMultiscattering(e,t,n){const r=lE.dot(eE).clamp(),i=lN({roughness:YS,dotNV:r}),s=(this.iridescenceF0?tT.mix(lT,this.iridescenceF0):lT).mul(i.x).add(n.mul(i.y)),a=i.x.add(i.y).oneMinus(),o=lT.add(lT.oneMinus().mul(.047619)),l=s.mul(o).div(a.mul(o).oneMinus());e.addAssign(s),t.addAssign(l.mul(a))}direct({lightDirection:e,lightColor:t,reflectedLight:n}){const r=lE.dot(e).clamp().mul(t);if(!0===this.sheen&&this.sheenSpecularDirect.addAssign(r.mul(dN({lightDirection:e}))),!0===this.clearcoat){const n=cE.dot(e).clamp().mul(t);this.clearcoatSpecularDirect.addAssign(n.mul(oN({lightDirection:e,f0:qN,f90:GN,roughness:ZS,normalView:cE})))}n.directDiffuse.addAssign(r.mul(WR({diffuseColor:XS.rgb}))),n.directSpecular.addAssign(r.mul(oN({lightDirection:e,f0:lT,f90:1,roughness:YS,iridescence:this.iridescence,f:this.iridescenceFresnel,USE_IRIDESCENCE:this.iridescence,USE_ANISOTROPY:this.anisotropy})))}directRectArea({lightColor:e,lightPosition:t,halfWidth:n,halfHeight:r,reflectedLight:i,ltc_1:s,ltc_2:a}){const o=t.add(n).sub(r),l=t.sub(n).sub(r),u=t.sub(n).add(r),c=t.add(n).add(r),A=lE,h=eE,d=JM.toVar(),p=pN({N:A,V:h,roughness:YS}),f=s.uv(p).toVar(),m=a.uv(p).toVar(),g=US(MS(f.x,0,f.y),MS(0,1,0),MS(f.z,0,f.w)).toVar(),v=lT.mul(m.x).add(lT.oneMinus().mul(m.y)).toVar();i.directSpecular.addAssign(e.mul(v).mul(gN({N:A,V:h,P:d,mInv:g,p0:o,p1:l,p2:u,p3:c}))),i.directDiffuse.addAssign(e.mul(XS).mul(gN({N:A,V:h,P:d,mInv:US(1,0,0,0,1,0,0,0,1),p0:o,p1:l,p2:u,p3:c})))}indirect(e,t,n){this.indirectDiffuse(e,t,n),this.indirectSpecular(e,t,n),this.ambientOcclusion(e,t,n)}indirectDiffuse({irradiance:e,reflectedLight:t}){t.indirectDiffuse.addAssign(e.mul(WR({diffuseColor:XS})))}indirectSpecular({radiance:e,iblIrradiance:t,reflectedLight:n}){if(!0===this.sheen&&this.sheenSpecularIndirect.addAssign(t.mul(JS,kN({normal:lE,viewDir:eE,roughness:eT}))),!0===this.clearcoat){const e=cE.dot(eE).clamp(),t=uN({dotNV:e,specularColor:qN,specularF90:GN,roughness:ZS});this.clearcoatSpecularIndirect.addAssign(this.clearcoatRadiance.mul(t))}const r=MS().toVar("singleScattering"),i=MS().toVar("multiScattering"),s=t.mul(1/Math.PI);this.computeMultiscattering(r,i,uT);const a=r.add(i),o=XS.mul(a.r.max(a.g).max(a.b).oneMinus());n.indirectSpecular.addAssign(e.mul(r)),n.indirectSpecular.addAssign(i.mul(s)),n.indirectDiffuse.addAssign(o.mul(s))}ambientOcclusion({ambientOcclusion:e,reflectedLight:t}){const n=lE.dot(eE).clamp().add(e),r=YS.mul(-16).oneMinus().negate().exp2(),i=e.sub(n.pow(r).oneMinus()).clamp();!0===this.clearcoat&&this.clearcoatSpecularIndirect.mulAssign(e),!0===this.sheen&&this.sheenSpecularIndirect.mulAssign(e),t.indirectDiffuse.mulAssign(e),t.indirectSpecular.mulAssign(i)}finish(e){const{outgoingLight:t}=e;if(!0===this.clearcoat){const e=cE.dot(eE).clamp(),n=jR({dotVH:e,f0:qN,f90:GN}),r=t.mul(KS.mul(n).oneMinus()).add(this.clearcoatSpecularDirect.add(this.clearcoatSpecularIndirect).mul(KS));t.assign(r)}if(!0===this.sheen){const e=JS.r.max(JS.g).max(JS.b).mul(.157).oneMinus(),n=t.mul(e).add(this.sheenSpecularDirect,this.sheenSpecularIndirect);t.assign(n)}}}const VN=vS(1),HN=vS(-2),jN=vS(.8),WN=vS(-1),XN=vS(.4),QN=vS(2),YN=vS(.305),$N=vS(3),KN=vS(.21),ZN=vS(4),JN=vS(4),eP=vS(16),tP=dS((([e])=>{const t=MS(pw(e)).toVar(),n=vS(-1).toVar();return mS(t.x.greaterThan(t.z),(()=>{mS(t.x.greaterThan(t.y),(()=>{n.assign(Qw(e.x.greaterThan(0),0,3))})).Else((()=>{n.assign(Qw(e.y.greaterThan(0),1,4))}))})).Else((()=>{mS(t.z.greaterThan(t.y),(()=>{n.assign(Qw(e.z.greaterThan(0),2,5))})).Else((()=>{n.assign(Qw(e.y.greaterThan(0),1,4))}))})),n})).setLayout({name:"getFace",type:"float",inputs:[{name:"direction",type:"vec3"}]}),nP=dS((([e,t])=>{const n=bS().toVar();return mS(t.equal(0),(()=>{n.assign(bS(e.z,e.y).div(pw(e.x)))})).ElseIf(t.equal(1),(()=>{n.assign(bS(e.x.negate(),e.z.negate()).div(pw(e.y)))})).ElseIf(t.equal(2),(()=>{n.assign(bS(e.x.negate(),e.y).div(pw(e.z)))})).ElseIf(t.equal(3),(()=>{n.assign(bS(e.z.negate(),e.y).div(pw(e.x)))})).ElseIf(t.equal(4),(()=>{n.assign(bS(e.x.negate(),e.z).div(pw(e.y)))})).Else((()=>{n.assign(bS(e.x,e.y).div(pw(e.z)))})),wT(.5,n.add(1))})).setLayout({name:"getUV",type:"vec2",inputs:[{name:"direction",type:"vec3"},{name:"face",type:"float"}]}),rP=dS((([e])=>{const t=vS(0).toVar();return mS(e.greaterThanEqual(jN),(()=>{t.assign(VN.sub(e).mul(WN.sub(HN)).div(VN.sub(jN)).add(HN))})).ElseIf(e.greaterThanEqual(XN),(()=>{t.assign(jN.sub(e).mul(QN.sub(WN)).div(jN.sub(XN)).add(WN))})).ElseIf(e.greaterThanEqual(YN),(()=>{t.assign(XN.sub(e).mul($N.sub(QN)).div(XN.sub(YN)).add(QN))})).ElseIf(e.greaterThanEqual(KN),(()=>{t.assign(YN.sub(e).mul(ZN.sub($N)).div(YN.sub(KN)).add($N))})).Else((()=>{t.assign(vS(-2).mul(tw(wT(1.16,e))))})),t})).setLayout({name:"roughnessToMip",type:"float",inputs:[{name:"roughness",type:"float"}]}),iP=dS((([e,t])=>{const n=e.toVar();n.assign(wT(2,n).sub(1));const r=MS(n,1).toVar();return mS(t.equal(0),(()=>{r.assign(r.zyx)})).ElseIf(t.equal(1),(()=>{r.assign(r.xzy),r.xz.mulAssign(-1)})).ElseIf(t.equal(2),(()=>{r.x.mulAssign(-1)})).ElseIf(t.equal(3),(()=>{r.assign(r.zyx),r.xz.mulAssign(-1)})).ElseIf(t.equal(4),(()=>{r.assign(r.xzy),r.xy.mulAssign(-1)})).ElseIf(t.equal(5),(()=>{r.z.mulAssign(-1)})),r})).setLayout({name:"getDirection",type:"vec3",inputs:[{name:"uv",type:"vec2"},{name:"face",type:"float"}]}),sP=dS((([e,t,n,r,i,s])=>{const a=vS(n),o=MS(t),l=zw(rP(a),HN,s),u=ow(l),c=iw(l),A=MS(aP(e,o,c,r,i,s)).toVar();return mS(u.notEqual(0),(()=>{const t=MS(aP(e,o,c.add(1),r,i,s)).toVar();A.assign(Gw(A,t,u))})),A})),aP=dS((([e,t,n,r,i,s])=>{const a=vS(n).toVar(),o=MS(t),l=vS(tP(o)).toVar(),u=vS(Cw(JN.sub(a),0)).toVar();a.assign(Cw(a,JN));const c=vS(JT(a)).toVar(),A=bS(nP(o,l).mul(c.sub(2)).add(1)).toVar();return mS(l.greaterThan(2),(()=>{A.y.addAssign(c),l.subAssign(3)})),A.x.addAssign(l.mul(c)),A.x.addAssign(u.mul(wT(3,eP))),A.y.addAssign(wT(4,JT(s).sub(c))),A.x.mulAssign(r),A.y.mulAssign(i),e.uv(A).grad(bS(),bS())})),oP=dS((({envMap:e,mipInt:t,outputDirection:n,theta:r,axis:i,CUBEUV_TEXEL_WIDTH:s,CUBEUV_TEXEL_HEIGHT:a,CUBEUV_MAX_MIP:o})=>{const l=uw(r),u=n.mul(l).add(i.cross(n).mul(lw(r))).add(i.mul(i.dot(n).mul(l.oneMinus())));return aP(e,u,t,s,a,o)})),lP=dS((({n:e,latitudinal:t,poleAxis:n,outputDirection:r,weights:i,samples:s,dTheta:a,mipInt:o,envMap:l,CUBEUV_TEXEL_WIDTH:u,CUBEUV_TEXEL_HEIGHT:c,CUBEUV_MAX_MIP:A})=>{const h=MS(Qw(t,n,Uw(n,r))).toVar();mS(XT(h.equals(MS(0))),(()=>{h.assign(MS(r.z,0,r.x.negate()))})),h.assign(aw(h));const d=MS().toVar();return d.addAssign(i.element(_S(0)).mul(oP({theta:0,axis:h,outputDirection:r,mipInt:o,envMap:l,CUBEUV_TEXEL_WIDTH:u,CUBEUV_TEXEL_HEIGHT:c,CUBEUV_MAX_MIP:A}))),zC({start:_S(1),end:e},(({i:e})=>{mS(e.greaterThanEqual(s),(()=>{wM("break").append()}));const t=vS(a.mul(vS(e))).toVar();d.addAssign(i.element(e).mul(oP({theta:t.mul(-1),axis:h,outputDirection:r,mipInt:o,envMap:l,CUBEUV_TEXEL_WIDTH:u,CUBEUV_TEXEL_HEIGHT:c,CUBEUV_MAX_MIP:A}))),d.addAssign(i.element(e).mul(oP({theta:t,axis:h,outputDirection:r,mipInt:o,envMap:l,CUBEUV_TEXEL_WIDTH:u,CUBEUV_TEXEL_HEIGHT:c,CUBEUV_MAX_MIP:A})))})),NS(d,1)}));let uP=null;const cP=new WeakMap;function AP(e){let t=cP.get(e);if((void 0!==t?t.pmremVersion:-1)!==e.pmremVersion){const n=e.image;if(e.isCubeTexture){if(!function(e){if(null==e)return!1;let t=0;const n=6;for(let r=0;r<n;r++)void 0!==e[r]&&t++;return t===n}(n))return null;t=uP.fromCubemap(e,t)}else{if(!function(e){return null!=e&&e.height>0}(n))return null;t=uP.fromEquirectangular(e,t)}t.pmremVersion=e.pmremVersion,cP.set(e,t)}return t.texture}class hP extends Mb{static get type(){return"PMREMNode"}constructor(e,t=null,n=null){super("vec3"),this._value=e,this._pmrem=null,this.uvNode=t,this.levelNode=n,this._generator=null;const r=new Jt;r.isRenderTargetTexture=!0,this._texture=UM(r),this._width=HS(0),this._height=HS(0),this._maxMip=HS(0),this.updateBeforeType=pb}set value(e){this._value=e,this._pmrem=null}get value(){return this._value}updateFromTexture(e){const t=function(e){const t=Math.log2(e)-2,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),112)),texelHeight:n,maxMip:t}}(e.image.height);this._texture.value=e,this._width.value=t.texelWidth,this._height.value=t.texelHeight,this._maxMip.value=t.maxMip}updateBefore(){let e=this._pmrem;const t=e?e.pmremVersion:-1,n=this._value;t!==n.pmremVersion&&(e=!0===n.isPMREMTexture?n:AP(n),null!==e&&(this._pmrem=e,this.updateFromTexture(e)))}setup(e){null===uP&&(uP=e.createPMREMGenerator()),this.updateBefore(e);let t=this.uvNode;null===t&&e.context.getUV&&(t=e.context.getUV(this));const n=this.value;e.renderer.coordinateSystem===_t&&!0!==n.isPMREMTexture&&!0===n.isRenderTargetTexture&&(t=MS(t.x.negate(),t.yz));let r=this.levelNode;return null===r&&e.context.getTextureLevel&&(r=e.context.getTextureLevel(this)),sP(this._texture,t,r,this._width,this._height,this._maxMip)}}const dP=AS(hP),pP=new WeakMap;class fP extends QC{static get type(){return"EnvironmentNode"}constructor(e=null){super(),this.envNode=e}setup(e){const{material:t}=e;let n=this.envNode;if(n.isTextureNode||n.isMaterialReferenceNode){const e=n.isTextureNode?n.value:t[n.property];let r=pP.get(e);void 0===r&&(r=dP(e),pP.set(e,r)),n=r}const r=t.envMap?EE("envMapIntensity","float",e.material):EE("environmentIntensity","float",e.scene),i=!0===t.useAnisotropy||t.anisotropy>0?BE:lE,s=n.context(mP(YS,i)).mul(r),a=n.context(gP(uE)).mul(Math.PI).mul(r),o=_M(s),l=_M(a);e.context.radiance.addAssign(o),e.context.iblIrradiance.addAssign(l);const u=e.context.lightingModel.clearcoatRadiance;if(u){const e=n.context(mP(ZS,cE)).mul(r),t=_M(e);u.addAssign(t)}}}const mP=(e,t)=>{let n=null;return{getUV:()=>(null===n&&(n=eE.negate().reflect(t),n=e.mul(e).mix(n,t).normalize(),n=n.transformDirection(qM)),n),getTextureLevel:()=>e}},gP=e=>({getUV:()=>e,getTextureLevel:()=>vS(1)}),vP=new la;class _P extends TR{static get type(){return"MeshStandardNodeMaterial"}constructor(e){super(),this.isMeshStandardNodeMaterial=!0,this.lights=!0,this.emissiveNode=null,this.metalnessNode=null,this.roughnessNode=null,this.setDefaultValues(vP),this.setValues(e)}setupEnvironment(e){let t=super.setupEnvironment(e);return null===t&&e.environmentNode&&(t=e.environmentNode),t?new fP(t):null}setupLightingModel(){return new zN}setupSpecular(){const e=Gw(MS(.04),XS.rgb,$S);lT.assign(e),uT.assign(1)}setupVariants(){const e=this.metalnessNode?vS(this.metalnessNode):rC;$S.assign(e);let t=this.roughnessNode?vS(this.roughnessNode):nC;t=tN({roughness:t}),YS.assign(t),this.setupSpecular(),XS.assign(NS(XS.rgb.mul(e.oneMinus()),XS.a))}copy(e){return this.emissiveNode=e.emissiveNode,this.metalnessNode=e.metalnessNode,this.roughnessNode=e.roughnessNode,super.copy(e)}}const yP=new ua;class xP extends _P{static get type(){return"MeshPhysicalNodeMaterial"}constructor(e){super(),this.isMeshPhysicalNodeMaterial=!0,this.clearcoatNode=null,this.clearcoatRoughnessNode=null,this.clearcoatNormalNode=null,this.sheenNode=null,this.sheenRoughnessNode=null,this.iridescenceNode=null,this.iridescenceIORNode=null,this.iridescenceThicknessNode=null,this.specularIntensityNode=null,this.specularColorNode=null,this.iorNode=null,this.transmissionNode=null,this.thicknessNode=null,this.attenuationDistanceNode=null,this.attenuationColorNode=null,this.dispersionNode=null,this.anisotropyNode=null,this.setDefaultValues(yP),this.setValues(e)}get useClearcoat(){return this.clearcoat>0||null!==this.clearcoatNode}get useIridescence(){return this.iridescence>0||null!==this.iridescenceNode}get useSheen(){return this.sheen>0||null!==this.sheenNode}get useAnisotropy(){return this.anisotropy>0||null!==this.anisotropyNode}get useTransmission(){return this.transmission>0||null!==this.transmissionNode}get useDispersion(){return this.dispersion>0||null!==this.dispersionNode}setupSpecular(){const e=this.iorNode?vS(this.iorNode):gC;pT.assign(e),lT.assign(Gw(Ew(Ow(pT.sub(1).div(pT.add(1))).mul(JE),MS(1)).mul(ZE),XS.rgb,$S)),uT.assign(Gw(ZE,1,$S))}setupLightingModel(){return new zN(this.useClearcoat,this.useSheen,this.useIridescence,this.useAnisotropy,this.useTransmission,this.useDispersion)}setupVariants(e){if(super.setupVariants(e),this.useClearcoat){const e=this.clearcoatNode?vS(this.clearcoatNode):sC,t=this.clearcoatRoughnessNode?vS(this.clearcoatRoughnessNode):aC;KS.assign(e),ZS.assign(tN({roughness:t}))}if(this.useSheen){const e=this.sheenNode?MS(this.sheenNode):uC,t=this.sheenRoughnessNode?vS(this.sheenRoughnessNode):cC;JS.assign(e),eT.assign(t)}if(this.useIridescence){const e=this.iridescenceNode?vS(this.iridescenceNode):hC,t=this.iridescenceIORNode?vS(this.iridescenceIORNode):dC,n=this.iridescenceThicknessNode?vS(this.iridescenceThicknessNode):pC;tT.assign(e),nT.assign(t),rT.assign(n)}if(this.useAnisotropy){const e=(this.anisotropyNode?bS(this.anisotropyNode):AC).toVar();sT.assign(e.length()),mS(sT.equal(0),(()=>{e.assign(bS(1,0))})).Else((()=>{e.divAssign(bS(sT)),sT.assign(sT.saturate())})),iT.assign(sT.pow2().mix(YS.pow2(),1)),aT.assign(UE[0].mul(e.x).add(UE[1].mul(e.y))),oT.assign(UE[1].mul(e.x).sub(UE[0].mul(e.y)))}if(this.useTransmission){const e=this.transmissionNode?vS(this.transmissionNode):fC,t=this.thicknessNode?vS(this.thicknessNode):mC,n=this.attenuationDistanceNode?vS(this.attenuationDistanceNode):vC,r=this.attenuationColorNode?MS(this.attenuationColorNode):_C;if(fT.assign(e),mT.assign(t),gT.assign(n),vT.assign(r),this.useDispersion){const e=this.dispersionNode?vS(this.dispersionNode):TC;_T.assign(e)}}}setupClearcoatNormal(){return this.clearcoatNormalNode?MS(this.clearcoatNormalNode):oC}setup(e){e.context.setupClearcoatNormal=()=>this.setupClearcoatNormal(e),super.setup(e)}copy(e){return this.clearcoatNode=e.clearcoatNode,this.clearcoatRoughnessNode=e.clearcoatRoughnessNode,this.clearcoatNormalNode=e.clearcoatNormalNode,this.sheenNode=e.sheenNode,this.sheenRoughnessNode=e.sheenRoughnessNode,this.iridescenceNode=e.iridescenceNode,this.iridescenceIORNode=e.iridescenceIORNode,this.iridescenceThicknessNode=e.iridescenceThicknessNode,this.specularIntensityNode=e.specularIntensityNode,this.specularColorNode=e.specularColorNode,this.transmissionNode=e.transmissionNode,this.thicknessNode=e.thicknessNode,this.attenuationDistanceNode=e.attenuationDistanceNode,this.attenuationColorNode=e.attenuationColorNode,this.dispersionNode=e.dispersionNode,this.anisotropyNode=e.anisotropyNode,super.copy(e)}}const bP=dS((({normal:e,lightDirection:t,builder:n})=>{const r=e.dot(t),i=bS(r.mul(.5).add(.5),0);if(n.material.gradientMap){const e=NE("gradientMap","texture").context({getUV:()=>i});return MS(e.r)}{const e=i.fwidth().mul(.5);return Gw(MS(.7),MS(1),Hw(vS(.7).sub(e.x),vS(.7).add(e.x),i.x))}}));class SP extends GR{direct({lightDirection:e,lightColor:t,reflectedLight:n},r,i){const s=bP({normal:rE,lightDirection:e,builder:i}).mul(t);n.directDiffuse.addAssign(s.mul(WR({diffuseColor:XS.rgb})))}indirect({ambientOcclusion:e,irradiance:t,reflectedLight:n}){n.indirectDiffuse.addAssign(t.mul(WR({diffuseColor:XS}))),n.indirectDiffuse.mulAssign(e)}}const TP=new Aa;class wP extends TR{static get type(){return"MeshToonNodeMaterial"}constructor(e){super(),this.isMeshToonNodeMaterial=!0,this.lights=!0,this.setDefaultValues(TP),this.setValues(e)}setupLightingModel(){return new SP}}class MP extends Mb{static get type(){return"MatcapUVNode"}constructor(){super("vec2")}setup(){const e=MS(eE.z,0,eE.x.negate()).normalize(),t=eE.cross(e);return bS(e.dot(lE),t.dot(lE)).mul(.495).add(.5)}}const EP=hS(MP),CP=new ma;class RP extends TR{static get type(){return"MeshMatcapNodeMaterial"}constructor(e){super(),this.lights=!1,this.isMeshMatcapNodeMaterial=!0,this.setDefaultValues(CP),this.setValues(e)}setupVariants(e){const t=EP;let n;n=e.material.matcap?NE("matcap","texture").context({getUV:()=>t}):MS(Gw(.2,.8,t.y)),XS.rgb.mulAssign(n.rgb)}}const NP=new es;class PP extends TR{static get type(){return"PointsNodeMaterial"}constructor(e){super(),this.isPointsNodeMaterial=!0,this.lights=!1,this.transparent=!0,this.sizeNode=null,this.setDefaultValues(NP),this.setValues(e)}copy(e){return this.sizeNode=e.sizeNode,super.copy(e)}}class DP extends Mb{static get type(){return"RotateNode"}constructor(e,t){super(),this.positionNode=e,this.rotationNode=t}getNodeType(e){return this.positionNode.getNodeType(e)}setup(e){const{rotationNode:t,positionNode:n}=this;if("vec2"===this.getNodeType(e)){const e=t.cos(),r=t.sin();return IS(e,r,r.negate(),e).mul(n)}{const e=t,r=BS(NS(1,0,0,0),NS(0,uw(e.x),lw(e.x).negate(),0),NS(0,lw(e.x),uw(e.x),0),NS(0,0,0,1)),i=BS(NS(uw(e.y),0,lw(e.y),0),NS(0,1,0,0),NS(lw(e.y).negate(),0,uw(e.y),0),NS(0,0,0,1)),s=BS(NS(uw(e.z),lw(e.z).negate(),0,0),NS(lw(e.z),uw(e.z),0,0),NS(0,0,1,0),NS(0,0,0,1));return r.mul(i).mul(s).mul(NS(n,1)).xyz}}}const LP=AS(DP),IP=new Pi;class UP extends TR{static get type(){return"SpriteNodeMaterial"}constructor(e){super(),this.isSpriteNodeMaterial=!0,this.lights=!1,this._useSizeAttenuation=!0,this.positionNode=null,this.rotationNode=null,this.scaleNode=null,this.setDefaultValues(IP),this.setValues(e)}setupPosition({object:e,camera:t,context:n}){const r=this.sizeAttenuation,{positionNode:i,rotationNode:s,scaleNode:a}=this,o=YM;let l=XM.mul(MS(i||0)),u=bS(jM[0].xyz.length(),jM[1].xyz.length());if(null!==a&&(u=u.mul(a)),!r)if(t.isPerspectiveCamera)u=u.mul(l.z.negate());else{const e=vS(2).div(kM.element(1).element(1));u=u.mul(e.mul(2))}let c=o.xy;if(e.center&&!0===e.center.isVector2){const e=((e,t,n)=>lS(new lM(e,t,n)))("center","vec2");c=c.sub(e.sub(.5))}c=c.mul(u);const A=vS(s||lC),h=LP(c,A);l=NS(l.xy.add(h),l.zw);const d=kM.mul(l);return n.vertex=o,d}copy(e){return this.positionNode=e.positionNode,this.rotationNode=e.rotationNode,this.scaleNode=e.scaleNode,super.copy(e)}get sizeAttenuation(){return this._useSizeAttenuation}set sizeAttenuation(e){this._useSizeAttenuation!==e&&(this._useSizeAttenuation=e,this.needsUpdate=!0)}}class BP extends GR{constructor(){super(),this.shadowNode=vS(1).toVar("shadowMask")}direct({shadowMask:e}){this.shadowNode.mulAssign(e)}finish(e){XS.a.mulAssign(this.shadowNode.oneMinus()),e.outgoingLight.rgb.assign(XS.rgb)}}const OP=new oa;class FP extends TR{static get type(){return"ShadowNodeMaterial"}constructor(e){super(),this.isShadowNodeMaterial=!0,this.lights=!0,this.setDefaultValues(OP),this.setValues(e)}setupLightingModel(){return new BP}}dS((({texture:e,uv:t})=>{const n=1e-4,r=MS().toVar();return mS(t.x.lessThan(n),(()=>{r.assign(MS(1,0,0))})).ElseIf(t.y.lessThan(n),(()=>{r.assign(MS(0,1,0))})).ElseIf(t.z.lessThan(n),(()=>{r.assign(MS(0,0,1))})).ElseIf(t.x.greaterThan(.9999),(()=>{r.assign(MS(-1,0,0))})).ElseIf(t.y.greaterThan(.9999),(()=>{r.assign(MS(0,-1,0))})).ElseIf(t.z.greaterThan(.9999),(()=>{r.assign(MS(0,0,-1))})).Else((()=>{const n=.01,i=e.uv(t.add(MS(-.01,0,0))).r.sub(e.uv(t.add(MS(n,0,0))).r),s=e.uv(t.add(MS(0,-.01,0))).r.sub(e.uv(t.add(MS(0,n,0))).r),a=e.uv(t.add(MS(0,0,-.01))).r.sub(e.uv(t.add(MS(0,0,n))).r);r.assign(MS(i,s,a))})),r.normalize()}));class kP{constructor(e,t){this.nodes=e,this.info=t,this._context=self,this._animationLoop=null,this._requestId=null}start(){const e=(t,n)=>{this._requestId=this._context.requestAnimationFrame(e),!0===this.info.autoReset&&this.info.reset(),this.nodes.nodeFrame.update(),this.info.frame=this.nodes.nodeFrame.frameId,null!==this._animationLoop&&this._animationLoop(t,n)};e()}stop(){this._context.cancelAnimationFrame(this._requestId),this._requestId=null}setAnimationLoop(e){this._animationLoop=e}setContext(e){this._context=e}dispose(){this.stop()}}class qP{constructor(){this.weakMap=new WeakMap}get(e){let t=this.weakMap;for(let n=0;n<e.length;n++)if(t=t.get(e[n]),void 0===t)return;return t.get(e[e.length-1])}set(e,t){let n=this.weakMap;for(let t=0;t<e.length;t++){const r=e[t];!1===n.has(r)&&n.set(r,new WeakMap),n=n.get(r)}return n.set(e[e.length-1],t)}delete(e){let t=this.weakMap;for(let n=0;n<e.length;n++)if(t=t.get(e[n]),void 0===t)return!1;return t.delete(e[e.length-1])}}let GP=0;class zP{constructor(e,t,n,r,i,s,a,o,l,u){this._nodes=e,this._geometries=t,this.id=GP++,this.renderer=n,this.object=r,this.material=i,this.scene=s,this.camera=a,this.lightsNode=o,this.context=l,this.geometry=r.geometry,this.version=i.version,this.drawRange=null,this.attributes=null,this.pipeline=null,this.vertexBuffers=null,this.drawParams=null,this.bundle=null,this.clippingContext=u,this.clippingContextCacheKey=null!==u?u.cacheKey:"",this.initialNodesCacheKey=this.getDynamicCacheKey(),this.initialCacheKey=this.getCacheKey(),this._nodeBuilderState=null,this._bindings=null,this._monitor=null,this.onDispose=null,this.isRenderObject=!0,this.onMaterialDispose=()=>{this.dispose()},this.material.addEventListener("dispose",this.onMaterialDispose)}updateClipping(e){this.clippingContext=e}get clippingNeedsUpdate(){return null!==this.clippingContext&&this.clippingContext.cacheKey!==this.clippingContextCacheKey&&(this.clippingContextCacheKey=this.clippingContext.cacheKey,!0)}get hardwareClippingPlanes(){return!0===this.material.hardwareClipping?this.clippingContext.unionClippingCount:0}getNodeBuilderState(){return this._nodeBuilderState||(this._nodeBuilderState=this._nodes.getForRender(this))}getMonitor(){return this._monitor||(this._monitor=this.getNodeBuilderState().monitor)}getBindings(){return this._bindings||(this._bindings=this.getNodeBuilderState().createBindings())}getIndex(){return this._geometries.getIndex(this)}getIndirect(){return this._geometries.getIndirect(this)}getChainArray(){return[this.object,this.material,this.context,this.lightsNode]}setGeometry(e){this.geometry=e,this.attributes=null}getAttributes(){if(null!==this.attributes)return this.attributes;const e=this.getNodeBuilderState().nodeAttributes,t=this.geometry,n=[],r=new Set;for(const i of e){const e=i.node&&i.node.attribute?i.node.attribute:t.getAttribute(i.name);if(void 0===e)continue;n.push(e);const s=e.isInterleavedBufferAttribute?e.data:e;r.add(s)}return this.attributes=n,this.vertexBuffers=Array.from(r.values()),n}getVertexBuffers(){return null===this.vertexBuffers&&this.getAttributes(),this.vertexBuffers}getDrawParameters(){const{object:e,material:t,geometry:n,group:r,drawRange:i}=this,s=this.drawParams||(this.drawParams={vertexCount:0,firstVertex:0,instanceCount:0,firstInstance:0}),a=this.getIndex(),o=null!==a,l=n.isInstancedBufferGeometry?n.instanceCount:e.count>1?e.count:1;if(0===l)return null;if(s.instanceCount=l,!0===e.isBatchedMesh)return s;let u=1;!0!==t.wireframe||e.isPoints||e.isLineSegments||e.isLine||e.isLineLoop||(u=2);let c=i.start*u,A=(i.start+i.count)*u;null!==r&&(c=Math.max(c,r.start*u),A=Math.min(A,(r.start+r.count)*u));const h=n.attributes.position;let d=1/0;o?d=a.count:null!=h&&(d=h.count),c=Math.max(c,0),A=Math.min(A,d);const p=A-c;return p<0||p===1/0?null:(s.vertexCount=p,s.firstVertex=c,s)}getGeometryCacheKey(){const{geometry:e}=this;let t="";for(const n of Object.keys(e.attributes).sort()){const r=e.attributes[n];t+=n+",",r.data&&(t+=r.data.stride+","),r.offset&&(t+=r.offset+","),r.itemSize&&(t+=r.itemSize+","),r.normalized&&(t+="n,")}return e.index&&(t+="index,"),t}getMaterialCacheKey(){const{object:e,material:t}=this;let n=t.customProgramCacheKey();for(const e of function(e){const t=Object.keys(e);let n=Object.getPrototypeOf(e);for(;n;){const e=Object.getOwnPropertyDescriptors(n);for(const n in e)if(void 0!==e[n]){const r=e[n];r&&"function"==typeof r.get&&t.push(n)}n=Object.getPrototypeOf(n)}return t}(t)){if(/^(is[A-Z]|_)|^(visible|version|uuid|name|opacity|userData)$/.test(e))continue;const r=t[e];let i;if(null!==r){const e=typeof r;"number"===e?i=0!==r?"1":"0":"object"===e?(i="{",r.isTexture&&(i+=r.mapping),i+="}"):i=String(r)}else i=String(r);n+=i+","}return n+=this.clippingContextCacheKey+",",e.geometry&&(n+=this.getGeometryCacheKey()),e.skeleton&&(n+=e.skeleton.bones.length+","),e.morphTargetInfluences&&(n+=e.morphTargetInfluences.length+","),e.isBatchedMesh&&(n+=e._matricesTexture.uuid+",",null!==e._colorsTexture&&(n+=e._colorsTexture.uuid+",")),e.count>1&&(n+=e.uuid+","),n+=e.receiveShadow+",",rb(n)}get needsGeometryUpdate(){return this.geometry.id!==this.object.geometry.id}get needsUpdate(){return this.initialNodesCacheKey!==this.getDynamicCacheKey()||this.clippingNeedsUpdate}getDynamicCacheKey(){let e=this._nodes.getCacheKey(this.scene,this.lightsNode);return this.object.receiveShadow&&(e+=1),e}getCacheKey(){return this.getMaterialCacheKey()+this.getDynamicCacheKey()}dispose(){this.material.removeEventListener("dispose",this.onMaterialDispose),this.onDispose()}}const VP=[];class HP{constructor(e,t,n,r,i,s){this.renderer=e,this.nodes=t,this.geometries=n,this.pipelines=r,this.bindings=i,this.info=s,this.chainMaps={}}get(e,t,n,r,i,s,a,o){const l=this.getChainMap(o);VP[0]=e,VP[1]=t,VP[2]=s,VP[3]=i;let u=l.get(VP);return void 0===u?(u=this.createRenderObject(this.nodes,this.geometries,this.renderer,e,t,n,r,i,s,a,o),l.set(VP,u)):(u.updateClipping(a),u.needsGeometryUpdate&&u.setGeometry(e.geometry),(u.version!==t.version||u.needsUpdate)&&(u.initialCacheKey!==u.getCacheKey()?(u.dispose(),u=this.get(e,t,n,r,i,s,a,o)):u.version=t.version)),u}getChainMap(e="default"){return this.chainMaps[e]||(this.chainMaps[e]=new qP)}dispose(){this.chainMaps={}}createRenderObject(e,t,n,r,i,s,a,o,l,u,c){const A=this.getChainMap(c),h=new zP(e,t,n,r,i,s,a,o,l,u);return h.onDispose=()=>{this.pipelines.delete(h),this.bindings.delete(h),this.nodes.delete(h),A.delete(h.getChainArray())},h}}class jP{constructor(){this.data=new WeakMap}get(e){let t=this.data.get(e);return void 0===t&&(t={},this.data.set(e,t)),t}delete(e){let t;return this.data.has(e)&&(t=this.data.get(e),this.data.delete(e)),t}has(e){return this.data.has(e)}dispose(){this.data=new WeakMap}}const WP=1,XP=2,QP=3,YP=4,$P=16;class KP extends jP{constructor(e){super(),this.backend=e}delete(e){const t=super.delete(e);return void 0!==t&&this.backend.destroyAttribute(e),t}update(e,t){const n=this.get(e);if(void 0===n.version)t===WP?this.backend.createAttribute(e):t===XP?this.backend.createIndexAttribute(e):t===QP?this.backend.createStorageAttribute(e):t===YP&&this.backend.createIndirectStorageAttribute(e),n.version=this._getBufferAttribute(e).version;else{const t=this._getBufferAttribute(e);(n.version<t.version||t.usage===gt)&&(this.backend.updateAttribute(e),n.version=t.version)}}_getBufferAttribute(e){return e.isInterleavedBufferAttribute&&(e=e.data),e}}function ZP(e){return null!==e.index?e.index.version:e.attributes.position.version}function JP(e){const t=[],n=e.index,r=e.attributes.position;if(null!==n){const e=n.array;for(let n=0,r=e.length;n<r;n+=3){const r=e[n+0],i=e[n+1],s=e[n+2];t.push(r,i,i,s,s,r)}}else{for(let e=0,n=r.array.length/3-1;e<n;e+=3){const n=e+0,r=e+1,i=e+2;t.push(n,r,r,i,i,n)}}const i=new(function(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}(t)?zr:Gr)(t,1);return i.version=ZP(e),i}class eD extends jP{constructor(e,t){super(),this.attributes=e,this.info=t,this.wireframes=new WeakMap,this.attributeCall=new WeakMap}has(e){const t=e.geometry;return super.has(t)&&!0===this.get(t).initialized}updateForRender(e){!1===this.has(e)&&this.initGeometry(e),this.updateAttributes(e)}initGeometry(e){const t=e.geometry;this.get(t).initialized=!0,this.info.memory.geometries++;const n=()=>{this.info.memory.geometries--;const r=t.index,i=e.getAttributes();null!==r&&this.attributes.delete(r);for(const e of i)this.attributes.delete(e);const s=this.wireframes.get(t);void 0!==s&&this.attributes.delete(s),t.removeEventListener("dispose",n)};t.addEventListener("dispose",n)}updateAttributes(e){const t=e.getAttributes();for(const e of t)e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute?this.updateAttribute(e,QP):this.updateAttribute(e,WP);const n=this.getIndex(e);null!==n&&this.updateAttribute(n,XP);const r=e.geometry.indirect;null!==r&&this.updateAttribute(r,YP)}updateAttribute(e,t){const n=this.info.render.calls;e.isInterleavedBufferAttribute?void 0===this.attributeCall.get(e)?(this.attributes.update(e,t),this.attributeCall.set(e,n)):this.attributeCall.get(e.data)!==n&&(this.attributes.update(e,t),this.attributeCall.set(e.data,n),this.attributeCall.set(e,n)):this.attributeCall.get(e)!==n&&(this.attributes.update(e,t),this.attributeCall.set(e,n))}getIndirect(e){return e.geometry.indirect}getIndex(e){const{geometry:t,material:n}=e;let r=t.index;if(!0===n.wireframe){const e=this.wireframes;let n=e.get(t);void 0===n?(n=JP(t),e.set(t,n)):n.version!==ZP(t)&&(this.attributes.delete(n),n=JP(t),e.set(t,n)),r=n}return r}}class tD{constructor(){this.autoReset=!0,this.frame=0,this.calls=0,this.render={calls:0,frameCalls:0,drawCalls:0,triangles:0,points:0,lines:0,timestamp:0,previousFrameCalls:0,timestampCalls:0},this.compute={calls:0,frameCalls:0,timestamp:0,previousFrameCalls:0,timestampCalls:0},this.memory={geometries:0,textures:0}}update(e,t,n){this.render.drawCalls++,e.isMesh||e.isSprite?this.render.triangles+=n*(t/3):e.isPoints?this.render.points+=n*t:e.isLineSegments?this.render.lines+=n*(t/2):e.isLine?this.render.lines+=n*(t-1):console.error("THREE.WebGPUInfo: Unknown object type.")}updateTimestamp(e,t){0===this[e].timestampCalls&&(this[e].timestamp=0),this[e].timestamp+=t,this[e].timestampCalls++,this[e].timestampCalls>=this[e].previousFrameCalls&&(this[e].timestampCalls=0)}reset(){const e=this.render.frameCalls;this.render.previousFrameCalls=e;const t=this.compute.frameCalls;this.compute.previousFrameCalls=t,this.render.drawCalls=0,this.render.frameCalls=0,this.compute.frameCalls=0,this.render.triangles=0,this.render.points=0,this.render.lines=0}dispose(){this.reset(),this.calls=0,this.render.calls=0,this.compute.calls=0,this.render.timestamp=0,this.compute.timestamp=0,this.memory.geometries=0,this.memory.textures=0}}class nD{constructor(e){this.cacheKey=e,this.usedTimes=0}}class rD extends nD{constructor(e,t,n){super(e),this.vertexProgram=t,this.fragmentProgram=n}}class iD extends nD{constructor(e,t){super(e),this.computeProgram=t,this.isComputePipeline=!0}}let sD=0;class aD{constructor(e,t,n=null,r=null){this.id=sD++,this.code=e,this.stage=t,this.transforms=n,this.attributes=r,this.usedTimes=0}}class oD extends jP{constructor(e,t){super(),this.backend=e,this.nodes=t,this.bindings=null,this.caches=new Map,this.programs={vertex:new Map,fragment:new Map,compute:new Map}}getForCompute(e,t){const{backend:n}=this,r=this.get(e);if(this._needsComputeUpdate(e)){const i=r.pipeline;i&&(i.usedTimes--,i.computeProgram.usedTimes--);const s=this.nodes.getForCompute(e);let a=this.programs.compute.get(s.computeShader);void 0===a&&(i&&0===i.computeProgram.usedTimes&&this._releaseProgram(i.computeProgram),a=new aD(s.computeShader,"compute",s.transforms,s.nodeAttributes),this.programs.compute.set(s.computeShader,a),n.createProgram(a));const o=this._getComputeCacheKey(e,a);let l=this.caches.get(o);void 0===l&&(i&&0===i.usedTimes&&this._releasePipeline(i),l=this._getComputePipeline(e,a,o,t)),l.usedTimes++,a.usedTimes++,r.version=e.version,r.pipeline=l}return r.pipeline}getForRender(e,t=null){const{backend:n}=this,r=this.get(e);if(this._needsRenderUpdate(e)){const i=r.pipeline;i&&(i.usedTimes--,i.vertexProgram.usedTimes--,i.fragmentProgram.usedTimes--);const s=e.getNodeBuilderState();let a=this.programs.vertex.get(s.vertexShader);void 0===a&&(i&&0===i.vertexProgram.usedTimes&&this._releaseProgram(i.vertexProgram),a=new aD(s.vertexShader,"vertex"),this.programs.vertex.set(s.vertexShader,a),n.createProgram(a));let o=this.programs.fragment.get(s.fragmentShader);void 0===o&&(i&&0===i.fragmentProgram.usedTimes&&this._releaseProgram(i.fragmentProgram),o=new aD(s.fragmentShader,"fragment"),this.programs.fragment.set(s.fragmentShader,o),n.createProgram(o));const l=this._getRenderCacheKey(e,a,o);let u=this.caches.get(l);void 0===u?(i&&0===i.usedTimes&&this._releasePipeline(i),u=this._getRenderPipeline(e,a,o,l,t)):e.pipeline=u,u.usedTimes++,a.usedTimes++,o.usedTimes++,r.pipeline=u}return r.pipeline}delete(e){const t=this.get(e).pipeline;return t&&(t.usedTimes--,0===t.usedTimes&&this._releasePipeline(t),t.isComputePipeline?(t.computeProgram.usedTimes--,0===t.computeProgram.usedTimes&&this._releaseProgram(t.computeProgram)):(t.fragmentProgram.usedTimes--,t.vertexProgram.usedTimes--,0===t.vertexProgram.usedTimes&&this._releaseProgram(t.vertexProgram),0===t.fragmentProgram.usedTimes&&this._releaseProgram(t.fragmentProgram))),super.delete(e)}dispose(){super.dispose(),this.caches=new Map,this.programs={vertex:new Map,fragment:new Map,compute:new Map}}updateForRender(e){this.getForRender(e)}_getComputePipeline(e,t,n,r){n=n||this._getComputeCacheKey(e,t);let i=this.caches.get(n);return void 0===i&&(i=new iD(n,t),this.caches.set(n,i),this.backend.createComputePipeline(i,r)),i}_getRenderPipeline(e,t,n,r,i){r=r||this._getRenderCacheKey(e,t,n);let s=this.caches.get(r);return void 0===s&&(s=new rD(r,t,n),this.caches.set(r,s),e.pipeline=s,this.backend.createRenderPipeline(e,i)),s}_getComputeCacheKey(e,t){return e.id+","+t.id}_getRenderCacheKey(e,t,n){return t.id+","+n.id+","+this.backend.getRenderCacheKey(e)}_releasePipeline(e){this.caches.delete(e.cacheKey)}_releaseProgram(e){const t=e.code,n=e.stage;this.programs[n].delete(t)}_needsComputeUpdate(e){const t=this.get(e);return void 0===t.pipeline||t.version!==e.version}_needsRenderUpdate(e){return void 0===this.get(e).pipeline||this.backend.needsRenderUpdate(e)}}class lD extends jP{constructor(e,t,n,r,i,s){super(),this.backend=e,this.textures=n,this.pipelines=i,this.attributes=r,this.nodes=t,this.info=s,this.pipelines.bindings=this}getForRender(e){const t=e.getBindings();for(const e of t){const n=this.get(e);void 0===n.bindGroup&&(this._init(e),this.backend.createBindings(e,t,0),n.bindGroup=e)}return t}getForCompute(e){const t=this.nodes.getForCompute(e).bindings;for(const e of t){const n=this.get(e);void 0===n.bindGroup&&(this._init(e),this.backend.createBindings(e,t,0),n.bindGroup=e)}return t}updateForCompute(e){this._updateBindings(this.getForCompute(e))}updateForRender(e){this._updateBindings(this.getForRender(e))}_updateBindings(e){for(const t of e)this._update(t,e)}_init(e){for(const t of e.bindings)if(t.isSampledTexture)this.textures.updateTexture(t.texture);else if(t.isStorageBuffer){const e=t.attribute,n=e.isIndirectStorageBufferAttribute?YP:QP;this.attributes.update(e,n)}}_update(e,t){const{backend:n}=this;let r=!1,i=!0,s=0,a=0;for(const t of e.bindings){if(t.isNodeUniformsGroup){if(!this.nodes.updateGroup(t))continue}if(t.isUniformBuffer){t.update()&&n.updateBinding(t)}else if(t.isSampler)t.update();else if(t.isSampledTexture){const e=this.textures.get(t.texture);t.needsBindingsUpdate(e.generation)&&(r=!0);const o=t.update(),l=t.texture;o&&this.textures.updateTexture(l);const u=n.get(l);if(void 0!==u.externalTexture||e.isDefaultTexture?i=!1:(s=10*s+l.id,a+=l.version),!0===n.isWebGPUBackend&&void 0===u.texture&&void 0===u.externalTexture&&(console.error("Bindings._update: binding should be available:",t,o,l,t.textureNode.value,r),this.textures.updateTexture(l),r=!0),!0===l.isStorageTexture){const e=this.get(l);!0===t.store?e.needsMipmap=!0:this.textures.needsMipmaps(l)&&!0===e.needsMipmap&&(this.backend.generateMipmaps(l),e.needsMipmap=!1)}}}!0===r&&this.backend.updateBindings(e,t,i?s:0,a)}}function uD(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function cD(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function AD(e){return(e.transmission>0||e.transmissionNode)&&2===e.side&&!1===e.forceSinglePass}class hD{constructor(e,t,n){this.renderItems=[],this.renderItemsIndex=0,this.opaque=[],this.transparentDoublePass=[],this.transparent=[],this.bundles=[],this.lightsNode=e.getNode(t,n),this.lightsArray=[],this.scene=t,this.camera=n,this.occlusionQueryCount=0}begin(){return this.renderItemsIndex=0,this.opaque.length=0,this.transparentDoublePass.length=0,this.transparent.length=0,this.bundles.length=0,this.lightsArray.length=0,this.occlusionQueryCount=0,this}getNextRenderItem(e,t,n,r,i,s,a){let o=this.renderItems[this.renderItemsIndex];return void 0===o?(o={id:e.id,object:e,geometry:t,material:n,groupOrder:r,renderOrder:e.renderOrder,z:i,group:s,clippingContext:a},this.renderItems[this.renderItemsIndex]=o):(o.id=e.id,o.object=e,o.geometry=t,o.material=n,o.groupOrder=r,o.renderOrder=e.renderOrder,o.z=i,o.group=s,o.clippingContext=a),this.renderItemsIndex++,o}push(e,t,n,r,i,s,a){const o=this.getNextRenderItem(e,t,n,r,i,s,a);!0===e.occlusionTest&&this.occlusionQueryCount++,!0===n.transparent||n.transmission>0?(AD(n)&&this.transparentDoublePass.push(o),this.transparent.push(o)):this.opaque.push(o)}unshift(e,t,n,r,i,s,a){const o=this.getNextRenderItem(e,t,n,r,i,s,a);!0===n.transparent||n.transmission>0?(AD(n)&&this.transparentDoublePass.unshift(o),this.transparent.unshift(o)):this.opaque.unshift(o)}pushBundle(e){this.bundles.push(e)}pushLight(e){this.lightsArray.push(e)}sort(e,t){this.opaque.length>1&&this.opaque.sort(e||uD),this.transparentDoublePass.length>1&&this.transparentDoublePass.sort(t||cD),this.transparent.length>1&&this.transparent.sort(t||cD)}finish(){this.lightsNode.setLights(this.lightsArray);for(let e=this.renderItemsIndex,t=this.renderItems.length;e<t;e++){const t=this.renderItems[e];if(null===t.id)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.groupOrder=null,t.renderOrder=null,t.z=null,t.group=null,t.clippingContext=null}}}class dD{constructor(e){this.lighting=e,this.lists=new qP}get(e,t){const n=this.lists,r=[e,t];let i=n.get(r);return void 0===i&&(i=new hD(this.lighting,e,t),n.set(r,i)),i}dispose(){this.lists=new qP}}let pD=0;class fD{constructor(){this.id=pD++,this.color=!0,this.clearColor=!0,this.clearColorValue={r:0,g:0,b:0,a:1},this.depth=!0,this.clearDepth=!0,this.clearDepthValue=1,this.stencil=!1,this.clearStencil=!0,this.clearStencilValue=1,this.viewport=!1,this.viewportValue=new en,this.scissor=!1,this.scissorValue=new en,this.textures=null,this.depthTexture=null,this.activeCubeFace=0,this.sampleCount=1,this.width=0,this.height=0,this.isRenderContext=!0}getCacheKey(){return mD(this)}}function mD(e){const{textures:t,activeCubeFace:n}=e,r=[n];for(const e of t)r.push(e.id);return ib(r)}class gD{constructor(){this.chainMaps={}}get(e,t,n=null){const r=[e,t];let i;if(null===n)i="default";else{const e=n.texture.format;i=`${n.textures.length}:${e}:${n.samples}:${n.depthBuffer}:${n.stencilBuffer}`}const s=this.getChainMap(i);let a=s.get(r);return void 0===a&&(a=new fD,s.set(r,a)),null!==n&&(a.sampleCount=0===n.samples?1:n.samples),a}getChainMap(e){return this.chainMaps[e]||(this.chainMaps[e]=new qP)}dispose(){this.chainMaps={}}}const vD=new on;class _D extends jP{constructor(e,t,n){super(),this.renderer=e,this.backend=t,this.info=n}updateRenderTarget(e,t=0){const n=this.get(e),r=0===e.samples?1:e.samples,i=n.depthTextureMips||(n.depthTextureMips={}),s=e.textures,a=this.getSize(s[0]),o=a.width>>t,l=a.height>>t;let u=e.depthTexture||i[t];const c=!0===e.depthBuffer||!0===e.stencilBuffer;let A=!1;void 0===u&&c&&(u=new rs,u.format=e.stencilBuffer?ve:ge,u.type=e.stencilBuffer?ce:se,u.image.width=o,u.image.height=l,i[t]=u),n.width===a.width&&a.height===n.height||(A=!0,u&&(u.needsUpdate=!0,u.image.width=o,u.image.height=l)),n.width=a.width,n.height=a.height,n.textures=s,n.depthTexture=u||null,n.depth=e.depthBuffer,n.stencil=e.stencilBuffer,n.renderTarget=e,n.sampleCount!==r&&(A=!0,u&&(u.needsUpdate=!0),n.sampleCount=r);const h={sampleCount:r};for(let e=0;e<s.length;e++){const t=s[e];A&&(t.needsUpdate=!0),this.updateTexture(t,h)}if(u&&this.updateTexture(u,h),!0!==n.initialized){n.initialized=!0;const t=()=>{e.removeEventListener("dispose",t);for(let e=0;e<s.length;e++)this._destroyTexture(s[e]);u&&this._destroyTexture(u),this.delete(e)};e.addEventListener("dispose",t)}}updateTexture(e,t={}){const n=this.get(e);if(!0===n.initialized&&n.version===e.version)return;const r=e.isRenderTargetTexture||e.isDepthTexture||e.isFramebufferTexture,i=this.backend;if(r&&!0===n.initialized&&(i.destroySampler(e),i.destroyTexture(e)),e.isFramebufferTexture){const t=this.renderer.getRenderTarget();e.type=t?t.texture.type:ee}const{width:s,height:a,depth:o}=this.getSize(e);if(t.width=s,t.height=a,t.depth=o,t.needsMipmaps=this.needsMipmaps(e),t.levels=t.needsMipmaps?this.getMipLevels(e,s,a):1,r||!0===e.isStorageTexture)i.createSampler(e),i.createTexture(e,t),n.generation=e.version;else{if(!0!==n.initialized&&i.createSampler(e),e.version>0){const r=e.image;if(void 0===r)console.warn("THREE.Renderer: Texture marked for update but image is undefined.");else if(!1===r.complete)console.warn("THREE.Renderer: Texture marked for update but image is incomplete.");else{if(e.images){const n=[];for(const t of e.images)n.push(t);t.images=n}else t.image=r;void 0!==n.isDefaultTexture&&!0!==n.isDefaultTexture||(i.createTexture(e,t),n.isDefaultTexture=!1,n.generation=e.version),!0===e.source.dataReady&&i.updateTexture(e,t),t.needsMipmaps&&0===e.mipmaps.length&&i.generateMipmaps(e)}}else i.createDefaultTexture(e),n.isDefaultTexture=!0,n.generation=e.version}if(!0!==n.initialized){n.initialized=!0,n.generation=e.version,this.info.memory.textures++;const t=()=>{e.removeEventListener("dispose",t),this._destroyTexture(e),this.info.memory.textures--};e.addEventListener("dispose",t)}n.version=e.version}getSize(e,t=vD){let n=e.images?e.images[0]:e.image;return n?(void 0!==n.image&&(n=n.image),t.width=n.width||1,t.height=n.height||1,t.depth=e.isCubeTexture?6:n.depth||1):t.width=t.height=t.depth=1,t}getMipLevels(e,t,n){let r;return r=e.isCompressedTexture?e.mipmaps?e.mipmaps.length:1:Math.floor(Math.log2(Math.max(t,n)))+1,r}needsMipmaps(e){return this.isEnvironmentTexture(e)||!0===e.isCompressedTexture||e.generateMipmaps}isEnvironmentTexture(e){const t=e.mapping;return t===z||t===V||t===q||t===G}_destroyTexture(e){this.backend.destroySampler(e),this.backend.destroyTexture(e),this.delete(e)}}class yD extends Rr{constructor(e,t,n,r=1){super(e,t,n),this.a=r}set(e,t,n,r=1){return this.a=r,super.set(e,t,n)}copy(e){return void 0!==e.a&&(this.a=e.a),super.copy(e)}clone(){return new this.constructor(this.r,this.g,this.b,this.a)}}class xD extends jS{static get type(){return"ParameterNode"}constructor(e,t=null){super(e,t),this.isParameterNode=!0}getHash(){return this.uuid}generate(){return this.name}}class bD extends Sb{static get type(){return"StackNode"}constructor(e=null){super(),this.nodes=[],this.outputNode=null,this.parent=e,this._currentCond=null,this.isStackNode=!0}getNodeType(e){return this.outputNode?this.outputNode.getNodeType(e):"void"}add(e){return this.nodes.push(e),this}If(e,t){const n=new oS(t);return this._currentCond=Qw(e,n),this.add(this._currentCond)}ElseIf(e,t){const n=new oS(t),r=Qw(e,n);return this._currentCond.elseNode=r,this._currentCond=r,this}Else(e){return this._currentCond.elseNode=new oS(e),this}build(e,...t){const n=fS();pS(this);for(const t of this.nodes)t.build(e,"void");return pS(n),this.outputNode?this.outputNode.build(e,...t):super.build(e,...t)}else(...e){return console.warn("TSL.StackNode: .else() has been renamed to .Else()."),this.Else(...e)}elseif(...e){return console.warn("TSL.StackNode: .elseif() has been renamed to .ElseIf()."),this.ElseIf(...e)}}const SD=AS(bD);new Oi,new on,new on,new on,new On,new on(0,0,-1),new en,new on,new on,new en,new Lt;const TD=new tn;nR.flipX(),TD.depthTexture=new rs(1,1);const wD=new Oa(-1,1,1,-1,0,1);class MD extends Zr{constructor(e=!1){super();const t=!1===e?[0,-1,0,1,2,1]:[0,2,0,0,2,0];this.setAttribute("position",new Hr([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Hr(t,2))}}const ED=new MD;class CD extends ci{constructor(e=null){super(ED,e),this.camera=wD,this.isQuadMesh=!0}renderAsync(e){return e.renderAsync(this,wD)}render(e){e.render(this,wD)}}const RD=new Xn,ND=new On;class PD extends Sb{static get type(){return"SceneNode"}constructor(e=PD.BACKGROUND_BLURRINESS,t=null){super(),this.scope=e,this.scene=t}setup(e){const t=this.scope,n=null!==this.scene?this.scene:e.scene;let r;return t===PD.BACKGROUND_BLURRINESS?r=EE("backgroundBlurriness","float",n):t===PD.BACKGROUND_INTENSITY?r=EE("backgroundIntensity","float",n):t===PD.BACKGROUND_ROTATION?r=HS("mat4").label("backgroundRotation").setGroup(GS).onRenderUpdate((()=>{const e=n.background;return null!==e&&e.isTexture&&300!==e.mapping?(RD.copy(n.backgroundRotation),RD.x*=-1,RD.y*=-1,RD.z*=-1,ND.makeRotationFromEuler(RD)):ND.identity(),ND})):console.error("THREE.SceneNode: Unknown scope:",t),r}}PD.BACKGROUND_BLURRINESS="backgroundBlurriness",PD.BACKGROUND_INTENSITY="backgroundIntensity",PD.BACKGROUND_ROTATION="backgroundRotation";const DD=hS(PD,PD.BACKGROUND_BLURRINESS),LD=hS(PD,PD.BACKGROUND_INTENSITY),ID=hS(PD,PD.BACKGROUND_ROTATION),UD=new Lt;class BD extends IM{static get type(){return"PassTextureNode"}constructor(e,t){super(t),this.passNode=e,this.setUpdateMatrix(!1)}setup(e){return e.object.isQuadMesh&&this.passNode.build(e),super.setup(e)}clone(){return new this.constructor(this.passNode,this.value)}}class OD extends BD{static get type(){return"PassMultipleTextureNode"}constructor(e,t,n=!1){super(e,null),this.textureName=t,this.previousTexture=n}updateTexture(){this.value=this.previousTexture?this.passNode.getPreviousTexture(this.textureName):this.passNode.getTexture(this.textureName)}setup(e){return this.updateTexture(),super.setup(e)}clone(){return new this.constructor(this.passNode,this.textureName,this.previousTexture)}}class FD extends Mb{static get type(){return"PassNode"}constructor(e,t,n,r={}){super("vec4"),this.scope=e,this.scene=t,this.camera=n,this.options=r,this._pixelRatio=1,this._width=1,this._height=1;const i=new rs;i.isRenderTargetTexture=!0,i.name="depth";const s=new tn(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:oe,...r});s.texture.name="output",s.depthTexture=i,this.renderTarget=s,this.updateBeforeType=db,this._textures={output:s.texture,depth:i},this._textureNodes={},this._linearDepthNodes={},this._viewZNodes={},this._previousTextures={},this._previousTextureNodes={},this._cameraNear=HS(0),this._cameraFar=HS(0),this._mrt=null,this.isPassNode=!0}setMRT(e){return this._mrt=e,this}getMRT(){return this._mrt}isGlobal(){return!0}getTexture(e){let t=this._textures[e];if(void 0===t){t=this.renderTarget.texture.clone(),t.isRenderTargetTexture=!0,t.name=e,this._textures[e]=t,this.renderTarget.textures.push(t)}return t}getPreviousTexture(e){let t=this._previousTextures[e];return void 0===t&&(t=this.getTexture(e).clone(),t.isRenderTargetTexture=!0,this._previousTextures[e]=t),t}toggleTexture(e){const t=this._previousTextures[e];if(void 0!==t){const n=this._textures[e],r=this.renderTarget.textures.indexOf(n);this.renderTarget.textures[r]=t,this._textures[e]=t,this._previousTextures[e]=n,this._textureNodes[e].updateTexture(),this._previousTextureNodes[e].updateTexture()}}getTextureNode(e="output"){let t=this._textureNodes[e];return void 0===t&&(t=lS(new OD(this,e)),t.updateTexture(),this._textureNodes[e]=t),t}getPreviousTextureNode(e="output"){let t=this._previousTextureNodes[e];return void 0===t&&(void 0===this._textureNodes[e]&&this.getTextureNode(e),t=lS(new OD(this,e,!0)),t.updateTexture(),this._previousTextureNodes[e]=t),t}getViewZNode(e="depth"){let t=this._viewZNodes[e];if(void 0===t){const n=this._cameraNear,r=this._cameraFar;this._viewZNodes[e]=t=fR(this.getTextureNode(e),n,r)}return t}getLinearDepthNode(e="depth"){let t=this._linearDepthNodes[e];if(void 0===t){const n=this._cameraNear,r=this._cameraFar,i=this.getViewZNode(e);this._linearDepthNodes[e]=t=dR(i,n,r)}return t}setup({renderer:e}){return this.renderTarget.samples=void 0===this.options.samples?e.samples:this.options.samples,!0===e.backend.isWebGLBackend&&(this.renderTarget.samples=0),this.renderTarget.depthTexture.isMultisampleRenderTargetTexture=this.renderTarget.samples>1,this.scope===FD.COLOR?this.getTextureNode():this.getLinearDepthNode()}updateBefore(e){const{renderer:t}=e,{scene:n,camera:r}=this;this._pixelRatio=t.getPixelRatio();const i=t.getSize(UD);this.setSize(i.width,i.height);const s=t.getRenderTarget(),a=t.getMRT();this._cameraNear.value=r.near,this._cameraFar.value=r.far;for(const e in this._previousTextures)this.toggleTexture(e);t.setRenderTarget(this.renderTarget),t.setMRT(this._mrt),t.render(n,r),t.setRenderTarget(s),t.setMRT(a)}setSize(e,t){this._width=e,this._height=t;const n=this._width*this._pixelRatio,r=this._height*this._pixelRatio;this.renderTarget.setSize(n,r)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget.dispose()}}FD.COLOR="color",FD.DEPTH="depth";const kD=dS((([e,t])=>e.mul(t).clamp())).setLayout({name:"linearToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),qD=dS((([e,t])=>(e=e.mul(t)).div(e.add(1)).clamp())).setLayout({name:"reinhardToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),GD=dS((([e,t])=>{const n=(e=(e=e.mul(t)).sub(.004).max(0)).mul(e.mul(6.2).add(.5)),r=e.mul(e.mul(6.2).add(1.7)).add(.06);return n.div(r).pow(2.2)})).setLayout({name:"cineonToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),zD=dS((([e])=>{const t=e.mul(e.add(.0245786)).sub(90537e-9),n=e.mul(e.add(.432951).mul(.983729)).add(.238081);return t.div(n)})),VD=dS((([e,t])=>{const n=US(.59719,.35458,.04823,.076,.90834,.01566,.0284,.13383,.83777),r=US(1.60475,-.53108,-.07367,-.10208,1.10813,-.00605,-.00327,-.07276,1.07602);return e=e.mul(t).div(.6),e=n.mul(e),e=zD(e),(e=r.mul(e)).clamp()})).setLayout({name:"acesFilmicToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),HD=US(MS(1.6605,-.1246,-.0182),MS(-.5876,1.1329,-.1006),MS(-.0728,-.0083,1.1187)),jD=US(MS(.6274,.0691,.0164),MS(.3293,.9195,.088),MS(.0433,.0113,.8956)),WD=dS((([e])=>{const t=MS(e).toVar(),n=MS(t.mul(t)).toVar(),r=MS(n.mul(n)).toVar();return vS(15.5).mul(r.mul(n)).sub(wT(40.14,r.mul(t))).add(wT(31.96,r).sub(wT(6.868,n.mul(t))).add(wT(.4298,n).add(wT(.1191,t).sub(.00232))))})),XD=dS((([e,t])=>{const n=MS(e).toVar(),r=US(MS(.856627153315983,.137318972929847,.11189821299995),MS(.0951212405381588,.761241990602591,.0767994186031903),MS(.0482516061458583,.101439036467562,.811302368396859)),i=US(MS(1.1271005818144368,-.1413297634984383,-.14132976349843826),MS(-.11060664309660323,1.157823702216272,-.11060664309660294),MS(-.016493938717834573,-.016493938717834257,1.2519364065950405)),s=vS(-12.47393),a=vS(4.026069);return n.mulAssign(t),n.assign(jD.mul(n)),n.assign(r.mul(n)),n.assign(Cw(n,1e-10)),n.assign(tw(n)),n.assign(n.sub(s).div(a.sub(s))),n.assign(zw(n,0,1)),n.assign(WD(n)),n.assign(i.mul(n)),n.assign(Bw(Cw(MS(0),n),MS(2.2))),n.assign(HD.mul(n)),n.assign(zw(n,0,1)),n})).setLayout({name:"agxToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),QD=dS((([e,t])=>{const n=vS(.76),r=vS(.15);e=e.mul(t);const i=Ew(e.r,Ew(e.g,e.b)),s=Qw(i.lessThan(.08),i.sub(wT(6.25,i.mul(i))),.04);e.subAssign(s);const a=Cw(e.r,Cw(e.g,e.b));mS(a.lessThan(n),(()=>e));const o=TT(1,n),l=TT(1,o.mul(o).div(a.add(o.sub(n))));e.mulAssign(l.div(a));const u=TT(1,MT(1,r.mul(a.sub(l)).add(1)));return Gw(e,MS(l),u)})).setLayout({name:"neutralToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]});class YD extends Sb{static get type(){return"CodeNode"}constructor(e="",t=[],n=""){super("code"),this.isCodeNode=!0,this.code=e,this.language=n,this.includes=t}isGlobal(){return!0}setIncludes(e){return this.includes=e,this}getIncludes(){return this.includes}generate(e){const t=this.getIncludes(e);for(const n of t)n.build(e);const n=e.getCodeFromNode(this,this.getNodeType(e));return n.code=this.code,n.code}serialize(e){super.serialize(e),e.code=this.code,e.language=this.language}deserialize(e){super.deserialize(e),this.code=e.code,this.language=e.language}}class $D extends YD{static get type(){return"FunctionNode"}constructor(e="",t=[],n=""){super(e,t,n)}getNodeType(e){return this.getNodeFunction(e).type}getInputs(e){return this.getNodeFunction(e).inputs}getNodeFunction(e){const t=e.getDataFromNode(this);let n=t.nodeFunction;return void 0===n&&(n=e.parser.parseFunction(this.code),t.nodeFunction=n),n}generate(e,t){super.generate(e);const n=this.getNodeFunction(e),r=n.name,i=n.type,s=e.getCodeFromNode(this,i);""!==r&&(s.name=r);const a=e.getPropertyName(s),o=this.getNodeFunction(e).getCode(a);return s.code=o+"\n","property"===t?a:e.format(`${a}()`,i,t)}}class KD extends Sb{static get type(){return"FogNode"}constructor(e,t){super("float"),this.isFogNode=!0,this.colorNode=e,this.factorNode=t}getViewZNode(e){let t;const n=e.context.getViewZ;return void 0!==n&&(t=n(this)),(t||JM.z).negate()}setup(){return this.factorNode}}class ZD extends KD{static get type(){return"FogRangeNode"}constructor(e,t,n){super(e),this.isFogRangeNode=!0,this.nearNode=t,this.farNode=n}setup(e){const t=this.getViewZNode(e);return Hw(this.nearNode,this.farNode,t)}}const JD=AS(ZD);class eL extends KD{static get type(){return"FogExp2Node"}constructor(e,t){super(e),this.isFogExp2Node=!0,this.densityNode=t}setup(e){const t=this.getViewZNode(e),n=this.densityNode;return n.mul(n,t,t).negate().exp().oneMinus()}}const tL=AS(eL);AS(class extends Sb{constructor(e){super(),this.scope=e}generate(e){const{scope:t}=this,{renderer:n}=e;!0===n.backend.isWebGLBackend?e.addFlowCode(`\t// ${t}Barrier \n`):e.addLineFlowCode(`${t}Barrier()`,this)}});class nL extends Mb{static get type(){return"AtomicFunctionNode"}constructor(e,t,n,r=null){super("uint"),this.method=e,this.pointerNode=t,this.valueNode=n,this.storeNode=r}getInputType(e){return this.pointerNode.getNodeType(e)}getNodeType(e){return this.getInputType(e)}generate(e){const t=this.method,n=this.getNodeType(e),r=this.getInputType(e),i=this.pointerNode,s=this.valueNode,a=[];a.push(`&${i.build(e,r)}`),a.push(s.build(e,r));const o=`${e.getMethod(t,n)}( ${a.join(", ")} )`;if(null!==this.storeNode){const t=this.storeNode.build(e,r);e.addLineFlowCode(`${t} = ${o}`,this)}else e.addLineFlowCode(o,this)}}let rL;function iL(e){rL=rL||new WeakMap;let t=rL.get(e);return void 0===t&&rL.set(e,t={}),t}function sL(e){const t=iL(e);return t.shadowMatrix||(t.shadowMatrix=HS("mat4").setGroup(GS).onRenderUpdate((()=>(e.shadow.updateMatrices(e),e.shadow.matrix))))}function aL(e){const t=iL(e);return t.position||(t.position=HS(new on).setGroup(GS).onRenderUpdate(((t,n)=>n.value.setFromMatrixPosition(e.matrixWorld))))}function oL(e){const t=iL(e);return t.viewPosition||(t.viewPosition=HS(new on).setGroup(GS).onRenderUpdate((({camera:t},n)=>{n.value=n.value||new on,n.value.setFromMatrixPosition(e.matrixWorld),n.value.applyMatrix4(t.matrixWorldInverse)})))}nL.ATOMIC_LOAD="atomicLoad",nL.ATOMIC_STORE="atomicStore",nL.ATOMIC_ADD="atomicAdd",nL.ATOMIC_SUB="atomicSub",nL.ATOMIC_MAX="atomicMax",nL.ATOMIC_MIN="atomicMin",nL.ATOMIC_AND="atomicAnd",nL.ATOMIC_OR="atomicOr",nL.ATOMIC_XOR="atomicXor",AS(nL);const lL=e=>qM.transformDirection(aL(e).sub(function(e){const t=iL(e);return t.targetPosition||(t.targetPosition=HS(new on).setGroup(GS).onRenderUpdate(((t,n)=>n.value.setFromMatrixPosition(e.target.matrixWorld))))}(e))),uL=(e,t)=>{for(const n of t)if(n.isAnalyticLightNode&&n.light.id===e)return n;return null},cL=new WeakMap;class AL extends Sb{static get type(){return"LightsNode"}constructor(){super("vec3"),this.totalDiffuseNode=MS().toVar("totalDiffuse"),this.totalSpecularNode=MS().toVar("totalSpecular"),this.outgoingLightNode=MS().toVar("outgoingLight"),this._lights=[],this._lightNodes=null,this._lightNodesHash=null,this.global=!0}getHash(e){if(null===this._lightNodesHash){null===this._lightNodes&&this.setupLightsNode(e);const t=[];for(const e of this._lightNodes)t.push(e.getSelf().getHash());this._lightNodesHash="lights-"+t.join(",")}return this._lightNodesHash}analyze(e){const t=e.getDataFromNode(this);for(const n of t.nodes)n.build(e)}setupLightsNode(e){const t=[],n=this._lightNodes,r=(e=>e.sort(((e,t)=>e.id-t.id)))(this._lights),i=e.renderer.library;for(const e of r)if(e.isNode)t.push(lS(e));else{let r=null;if(null!==n&&(r=uL(e.id,n)),null===r){const n=i.getLightNodeClass(e.constructor);if(null===n){console.warn(`LightsNode.setupNodeLights: Light node not found for ${e.constructor.name}`);continue}let r=null;cL.has(e)?r=cL.get(e):(r=lS(new n(e)),cL.set(e,r)),t.push(r)}}this._lightNodes=t}setupLights(e,t){for(const n of t)n.build(e)}setup(e){null===this._lightNodes&&this.setupLightsNode(e);const t=e.context,n=t.lightingModel;let r=this.outgoingLightNode;if(n){const{_lightNodes:i,totalDiffuseNode:s,totalSpecularNode:a}=this;t.outgoingLight=r;const o=e.addStack();e.getDataFromNode(this).nodes=o.nodes,n.start(t,o,e),this.setupLights(e,i),n.indirect(t,o,e);const{backdrop:l,backdropAlpha:u}=t,{directDiffuse:c,directSpecular:A,indirectDiffuse:h,indirectSpecular:d}=t.reflectedLight;let p=c.add(h);null!==l&&(p=MS(null!==u?u.mix(p,l):l),t.material.transparent=!0),s.assign(p),a.assign(A.add(d)),r.assign(s.add(a)),n.finish(t,o,e),r=r.bypass(e.removeStack())}return r}setLights(e){return this._lights=e,this._lightNodes=null,this._lightNodesHash=null,this}getLights(){return this._lights}get hasLights(){return this._lights.length>0}}const hL=new WeakMap,dL=MS().toVar("shadowWorldPosition"),pL=dS((([e,t,n])=>{let r=KM.sub(e).length();return r=r.sub(t).div(n.sub(t)),r=r.saturate(),r})),fL=e=>{let t=hL.get(e);if(void 0===t){const n=e.isPointLight?(e=>{const t=e.shadow.camera,n=EE("near","float",t).setGroup(GS),r=EE("far","float",t).setGroup(GS),i=VM(e);return pL(i,n,r)})(e):null;t=new TR,t.colorNode=NS(0,0,0,1),t.depthNode=n,t.isShadowNodeMaterial=!0,t.blending=0,t.name="ShadowMaterial",hL.set(e,t)}return t},mL=dS((({depthTexture:e,shadowCoord:t})=>UM(e,t.xy).compare(t.z))),gL=dS((({depthTexture:e,shadowCoord:t,shadow:n})=>{const r=(t,n)=>UM(e,t).compare(n),i=EE("mapSize","vec2",n).setGroup(GS),s=EE("radius","float",n).setGroup(GS),a=bS(1).div(i),o=a.x.negate().mul(s),l=a.y.negate().mul(s),u=a.x.mul(s),c=a.y.mul(s),A=o.div(2),h=l.div(2),d=u.div(2),p=c.div(2);return ST(r(t.xy.add(bS(o,l)),t.z),r(t.xy.add(bS(0,l)),t.z),r(t.xy.add(bS(u,l)),t.z),r(t.xy.add(bS(A,h)),t.z),r(t.xy.add(bS(0,h)),t.z),r(t.xy.add(bS(d,h)),t.z),r(t.xy.add(bS(o,0)),t.z),r(t.xy.add(bS(A,0)),t.z),r(t.xy,t.z),r(t.xy.add(bS(d,0)),t.z),r(t.xy.add(bS(u,0)),t.z),r(t.xy.add(bS(A,p)),t.z),r(t.xy.add(bS(0,p)),t.z),r(t.xy.add(bS(d,p)),t.z),r(t.xy.add(bS(o,c)),t.z),r(t.xy.add(bS(0,c)),t.z),r(t.xy.add(bS(u,c)),t.z)).mul(1/17)})),vL=dS((({depthTexture:e,shadowCoord:t,shadow:n})=>{const r=(t,n)=>UM(e,t).compare(n),i=EE("mapSize","vec2",n).setGroup(GS),s=bS(1).div(i),a=s.x,o=s.y,l=t.xy,u=ow(l.mul(i).add(.5));return l.subAssign(u.mul(s)),ST(r(l,t.z),r(l.add(bS(a,0)),t.z),r(l.add(bS(0,o)),t.z),r(l.add(s),t.z),Gw(r(l.add(bS(a.negate(),0)),t.z),r(l.add(bS(a.mul(2),0)),t.z),u.x),Gw(r(l.add(bS(a.negate(),o)),t.z),r(l.add(bS(a.mul(2),o)),t.z),u.x),Gw(r(l.add(bS(0,o.negate())),t.z),r(l.add(bS(0,o.mul(2))),t.z),u.y),Gw(r(l.add(bS(a,o.negate())),t.z),r(l.add(bS(a,o.mul(2))),t.z),u.y),Gw(Gw(r(l.add(bS(a.negate(),o.negate())),t.z),r(l.add(bS(a.mul(2),o.negate())),t.z),u.x),Gw(r(l.add(bS(a.negate(),o.mul(2))),t.z),r(l.add(bS(a.mul(2),o.mul(2))),t.z),u.x),u.y)).mul(1/9)})),_L=dS((({depthTexture:e,shadowCoord:t})=>{const n=vS(1).toVar(),r=UM(e).uv(t.xy).rg,i=Nw(t.z,r.x);return mS(i.notEqual(vS(1)),(()=>{const e=t.z.sub(r.x),s=Cw(0,r.y.mul(r.y));let a=s.div(s.add(e.mul(e)));a=zw(TT(a,.3).div(.95-.3)),n.assign(zw(Cw(i,a)))})),n})),yL=dS((({samples:e,radius:t,size:n,shadowPass:r})=>{const i=vS(0).toVar(),s=vS(0).toVar(),a=e.lessThanEqual(vS(1)).select(vS(0),vS(2).div(e.sub(1))),o=e.lessThanEqual(vS(1)).select(vS(0),vS(-1));zC({start:_S(0),end:_S(e),type:"int",condition:"<"},(({i:e})=>{const l=o.add(vS(e).mul(a)),u=r.uv(ST(iR.xy,bS(0,l).mul(t)).div(n)).x;i.addAssign(u),s.addAssign(u.mul(u))})),i.divAssign(e),s.divAssign(e);const l=nw(s.sub(i.mul(i)));return bS(i,l)})),xL=dS((({samples:e,radius:t,size:n,shadowPass:r})=>{const i=vS(0).toVar(),s=vS(0).toVar(),a=e.lessThanEqual(vS(1)).select(vS(0),vS(2).div(e.sub(1))),o=e.lessThanEqual(vS(1)).select(vS(0),vS(-1));zC({start:_S(0),end:_S(e),type:"int",condition:"<"},(({i:e})=>{const l=o.add(vS(e).mul(a)),u=r.uv(ST(iR.xy,bS(l,0).mul(t)).div(n));i.addAssign(u.x),s.addAssign(ST(u.y.mul(u.y),u.x.mul(u.x)))})),i.divAssign(e),s.divAssign(e);const l=nw(s.sub(i.mul(i)));return bS(i,l)})),bL=[mL,gL,vL,_L],SL=new CD;class TL extends Sb{static get type(){return"ShadowNode"}constructor(e,t=null){super(),this.light=e,this.shadow=t||e.shadow,this.shadowMap=null,this.vsmShadowMapVertical=null,this.vsmShadowMapHorizontal=null,this.vsmMaterialVertical=null,this.vsmMaterialHorizontal=null,this.updateBeforeType=pb,this._node=null,this.isShadowNode=!0}setupShadowFilter(e,{filterFn:t,depthTexture:n,shadowCoord:r,shadow:i}){const s=r.x.greaterThanEqual(0).and(r.x.lessThanEqual(1)).and(r.y.greaterThanEqual(0)).and(r.y.lessThanEqual(1)).and(r.z.lessThanEqual(1)),a=t({depthTexture:n,shadowCoord:r,shadow:i});return s.select(a,vS(1))}setupShadowCoord(e,t){const{shadow:n}=this,{renderer:r}=e,i=EE("bias","float",n).setGroup(GS);let s,a=t;if(n.camera.isOrthographicCamera||!0!==r.logarithmicDepthBuffer)a=a.xyz.div(a.w),s=a.z,r.coordinateSystem===yt&&(s=s.mul(2).sub(1));else{const e=a.w;a=a.xy.div(e);const t=EE("near","float",n.camera).setGroup(GS),r=EE("far","float",n.camera).setGroup(GS);s=mR(e.negate(),t,r)}return a=MS(a.x,a.y.oneMinus(),s.add(i)),a}getShadowFilterFn(e){return bL[e]}setupShadow(e){const{renderer:t}=e,{light:n,shadow:r}=this,i=t.shadowMap.type,s=new rs(r.mapSize.width,r.mapSize.height);s.compareFunction=ut;const a=e.createRenderTarget(r.mapSize.width,r.mapSize.height);if(a.depthTexture=s,r.camera.updateProjectionMatrix(),3===i){s.compareFunction=null,this.vsmShadowMapVertical=e.createRenderTarget(r.mapSize.width,r.mapSize.height,{format:xe,type:oe}),this.vsmShadowMapHorizontal=e.createRenderTarget(r.mapSize.width,r.mapSize.height,{format:xe,type:oe});const t=UM(s),n=UM(this.vsmShadowMapVertical.texture),i=EE("blurSamples","float",r).setGroup(GS),a=EE("radius","float",r).setGroup(GS),o=EE("mapSize","vec2",r).setGroup(GS);let l=this.vsmMaterialVertical||(this.vsmMaterialVertical=new TR);l.fragmentNode=yL({samples:i,radius:a,size:o,shadowPass:t}).context(e.getSharedContext()),l.name="VSMVertical",l=this.vsmMaterialHorizontal||(this.vsmMaterialHorizontal=new TR),l.fragmentNode=xL({samples:i,radius:a,size:o,shadowPass:n}).context(e.getSharedContext()),l.name="VSMHorizontal"}const o=EE("intensity","float",r).setGroup(GS),l=EE("normalBias","float",r).setGroup(GS),u=sL(n).mul(dL.add(uE.mul(l))),c=this.setupShadowCoord(e,u),A=r.filterNode||this.getShadowFilterFn(t.shadowMap.type)||null;if(null===A)throw new Error("THREE.WebGPURenderer: Shadow map type not supported yet.");const h=3===i?this.vsmShadowMapHorizontal.texture:s,d=this.setupShadowFilter(e,{filterFn:A,shadowTexture:a.texture,depthTexture:h,shadowCoord:c,shadow:r}),p=UM(a.texture,c),f=Gw(1,d.rgb.mix(p,1),o.mul(p.a)).toVar();return this.shadowMap=a,this.shadow.map=a,f}setup(e){if(!1!==e.renderer.shadowMap.enabled)return dS((({material:t})=>{dL.assign(t.shadowPositionNode||KM);let n=this._node;return null===n&&(this._node=n=this.setupShadow(e)),e.material.shadowNode&&console.warn('THREE.NodeMaterial: ".shadowNode" is deprecated. Use ".castShadowNode" instead.'),e.material.receivedShadowNode&&(n=e.material.receivedShadowNode(n)),n}))()}renderShadow(e){const{shadow:t,shadowMap:n}=this,{renderer:r,scene:i}=e;n.setSize(t.mapSize.width,t.mapSize.height),r.render(i,t.camera)}updateShadow(e){const{shadowMap:t,light:n,shadow:r}=this,{renderer:i,scene:s,camera:a}=e,o=i.shadowMap.type,l=t.depthTexture.version;this._depthVersionCached=l;const u=s.overrideMaterial;s.overrideMaterial=fL(n),r.camera.layers.mask=a.layers.mask;const c=i.getRenderTarget(),A=i.getRenderObjectFunction(),h=i.getMRT();i.setMRT(null),i.setRenderObjectFunction(((e,...t)=>{(!0===e.castShadow||e.receiveShadow&&3===o)&&i.renderObject(e,...t)})),i.setRenderTarget(t),this.renderShadow(e),i.setRenderObjectFunction(A),!0!==n.isPointLight&&3===o&&this.vsmPass(i),i.setRenderTarget(c),i.setMRT(h),s.overrideMaterial=u}vsmPass(e){const{shadow:t}=this;this.vsmShadowMapVertical.setSize(t.mapSize.width,t.mapSize.height),this.vsmShadowMapHorizontal.setSize(t.mapSize.width,t.mapSize.height),e.setRenderTarget(this.vsmShadowMapVertical),SL.material=this.vsmMaterialVertical,SL.render(e),e.setRenderTarget(this.vsmShadowMapHorizontal),SL.material=this.vsmMaterialHorizontal,SL.render(e)}dispose(){this.shadowMap.dispose(),this.shadowMap=null,null!==this.vsmShadowMapVertical&&(this.vsmShadowMapVertical.dispose(),this.vsmShadowMapVertical=null,this.vsmMaterialVertical.dispose(),this.vsmMaterialVertical=null),null!==this.vsmShadowMapHorizontal&&(this.vsmShadowMapHorizontal.dispose(),this.vsmShadowMapHorizontal=null,this.vsmMaterialHorizontal.dispose(),this.vsmMaterialHorizontal=null),this.updateBeforeType=hb}updateBefore(e){const{shadow:t}=this;(t.needsUpdate||t.autoUpdate)&&(this.updateShadow(e),this.shadowMap.depthTexture.version===this._depthVersionCached&&(t.needsUpdate=!1))}}class wL extends QC{static get type(){return"AnalyticLightNode"}constructor(e=null){super(),this.light=e,this.color=new Rr,this.colorNode=e&&e.colorNode||HS(this.color).setGroup(GS),this.baseColorNode=null,this.shadowNode=null,this.shadowColorNode=null,this.isAnalyticLightNode=!0,this.updateType=db}getCacheKey(){return sb(super.getCacheKey(),this.light.id,this.light.castShadow?1:0)}getHash(){return this.light.uuid}setupShadowNode(){return((e,t)=>lS(new TL(e,t)))(this.light)}setupShadow(e){const{renderer:t}=e;if(!1===t.shadowMap.enabled)return;let n=this.shadowColorNode;if(null===n){const t=this.light.shadow.shadowNode;let r;r=void 0!==t?lS(t):this.setupShadowNode(e),this.shadowNode=r,this.shadowColorNode=n=this.colorNode.mul(r),this.baseColorNode=this.colorNode}this.colorNode=n}setup(e){this.colorNode=this.baseColorNode||this.colorNode,this.light.castShadow?e.object.receiveShadow&&this.setupShadow(e):null!==this.shadowNode&&(this.shadowNode.dispose(),this.shadowNode=null,this.shadowColorNode=null)}update(){const{light:e}=this;this.color.copy(e.color).multiplyScalar(e.intensity)}}const ML=dS((e=>{const{lightDistance:t,cutoffDistance:n,decayExponent:r}=e,i=t.pow(r).max(.01).reciprocal();return n.greaterThan(0).select(i.mul(t.div(n).pow4().oneMinus().clamp().pow2()),i)})),EL=new Rr,CL=dS((([e,t])=>{const n=e.toVar(),r=pw(n),i=MT(1,Cw(r.x,Cw(r.y,r.z)));r.mulAssign(i),n.mulAssign(i.mul(t.mul(2).oneMinus()));const s=bS(n.xy).toVar(),a=t.mul(1.5).oneMinus();return mS(r.z.greaterThanEqual(a),(()=>{mS(n.z.greaterThan(0),(()=>{s.x.assign(TT(4,n.x))}))})).ElseIf(r.x.greaterThanEqual(a),(()=>{const e=fw(n.x);s.x.assign(n.z.mul(e).add(e.mul(2)))})).ElseIf(r.y.greaterThanEqual(a),(()=>{const e=fw(n.y);s.x.assign(n.x.add(e.mul(2)).add(2)),s.y.assign(n.z.mul(e).sub(2))})),bS(.125,.25).mul(s).add(bS(.375,.75)).flipY()})).setLayout({name:"cubeToUV",type:"vec2",inputs:[{name:"pos",type:"vec3"},{name:"texelSizeY",type:"float"}]}),RL=dS((({depthTexture:e,bd3D:t,dp:n,texelSize:r})=>UM(e,CL(t,r.y)).compare(n))),NL=dS((({depthTexture:e,bd3D:t,dp:n,texelSize:r,shadow:i})=>{const s=EE("radius","float",i).setGroup(GS),a=bS(-1,1).mul(s).mul(r.y);return UM(e,CL(t.add(a.xyy),r.y)).compare(n).add(UM(e,CL(t.add(a.yyy),r.y)).compare(n)).add(UM(e,CL(t.add(a.xyx),r.y)).compare(n)).add(UM(e,CL(t.add(a.yyx),r.y)).compare(n)).add(UM(e,CL(t,r.y)).compare(n)).add(UM(e,CL(t.add(a.xxy),r.y)).compare(n)).add(UM(e,CL(t.add(a.yxy),r.y)).compare(n)).add(UM(e,CL(t.add(a.xxx),r.y)).compare(n)).add(UM(e,CL(t.add(a.yxx),r.y)).compare(n)).mul(1/9)})),PL=dS((({filterFn:e,depthTexture:t,shadowCoord:n,shadow:r})=>{const i=n.xyz.toVar(),s=i.length(),a=HS("float").setGroup(GS).onRenderUpdate((()=>r.camera.near)),o=HS("float").setGroup(GS).onRenderUpdate((()=>r.camera.far)),l=EE("bias","float",r).setGroup(GS),u=HS(r.mapSize).setGroup(GS),c=vS(1).toVar();return mS(s.sub(o).lessThanEqual(0).and(s.sub(a).greaterThanEqual(0)),(()=>{const n=s.sub(a).div(o.sub(a)).toVar();n.addAssign(l);const A=i.normalize(),h=bS(1).div(u.mul(bS(4,2)));c.assign(e({depthTexture:t,bd3D:A,dp:n,texelSize:h,shadow:r}))})),c})),DL=new en,LL=new Lt,IL=new Lt;class UL extends TL{static get type(){return"PointShadowNode"}constructor(e,t=null){super(e,t)}getShadowFilterFn(e){return 0===e?RL:NL}setupShadowCoord(e,t){return t}setupShadowFilter(e,{filterFn:t,shadowTexture:n,depthTexture:r,shadowCoord:i,shadow:s}){return PL({filterFn:t,shadowTexture:n,depthTexture:r,shadowCoord:i,shadow:s})}renderShadow(e){const{shadow:t,shadowMap:n,light:r}=this,{renderer:i,scene:s}=e,a=t.getFrameExtents();IL.copy(t.mapSize),IL.multiply(a),n.setSize(IL.width,IL.height),LL.copy(t.mapSize);const o=i.autoClear,l=i.getClearColor(EL),u=i.getClearAlpha();i.autoClear=!1,i.setClearColor(t.clearColor,t.clearAlpha),i.clear();const c=t.getViewportCount();for(let e=0;e<c;e++){const a=t.getViewport(e),o=LL.x*a.x,l=IL.y-LL.y-LL.y*a.y;DL.set(o,l,LL.x*a.z,LL.y*a.w),n.viewport.copy(DL),t.updateMatrices(r,e),i.render(s,t.camera)}i.autoClear=o,i.setClearColor(l,u)}}const BL=dS((({color:e,lightViewPosition:t,cutoffDistance:n,decayExponent:r},i)=>{const s=i.context.lightingModel,a=t.sub(JM),o=a.normalize(),l=a.length(),u=ML({lightDistance:l,cutoffDistance:n,decayExponent:r}),c=e.mul(u),A=i.context.reflectedLight;s.direct({lightDirection:o,lightColor:c,reflectedLight:A},i.stack,i)}));class OL extends wL{static get type(){return"PointLightNode"}constructor(e=null){super(e),this.cutoffDistanceNode=HS(0).setGroup(GS),this.decayExponentNode=HS(0).setGroup(GS)}update(e){const{light:t}=this;super.update(e),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}setupShadowNode(){return((e,t)=>lS(new UL(e,t)))(this.light)}setup(e){super.setup(e),BL({color:this.colorNode,lightViewPosition:oL(this.light),cutoffDistance:this.cutoffDistanceNode,decayExponent:this.decayExponentNode}).append()}}const FL=dS((([e,t])=>{const n=e.x,r=e.y,i=e.z;let s=t.element(0).mul(.886227);return s=s.add(t.element(1).mul(1.023328).mul(r)),s=s.add(t.element(2).mul(1.023328).mul(i)),s=s.add(t.element(3).mul(1.023328).mul(n)),s=s.add(t.element(4).mul(.858086).mul(n).mul(r)),s=s.add(t.element(5).mul(.858086).mul(r).mul(i)),s=s.add(t.element(6).mul(i.mul(i).mul(.743125).sub(.247708))),s=s.add(t.element(7).mul(.858086).mul(n).mul(i)),s=s.add(t.element(8).mul(.429043).mul(wT(n,n).sub(wT(r,r)))),s})),kL=new yD;class qL extends jP{constructor(e,t){super(),this.renderer=e,this.nodes=t}update(e,t,n){const r=this.renderer,i=this.nodes.getBackgroundNode(e)||e.background;let s=!1;if(null===i)r._clearColor.getRGB(kL,it),kL.a=r._clearColor.a;else if(!0===i.isColor)i.getRGB(kL,it),kL.a=1,s=!0;else if(!0===i.isNode){const n=this.get(e),s=i;kL.copy(r._clearColor);let a=n.backgroundMesh;if(void 0===a){const e=$w(NS(s).mul(LD),{getUV:()=>ID.mul(oE),getTextureLevel:()=>DD});let t=RC();t=t.setZ(t.w);const r=new TR;r.name="Background.material",r.side=1,r.depthTest=!1,r.depthWrite=!1,r.fog=!1,r.lights=!1,r.vertexNode=t,r.colorNode=e,n.backgroundMeshNode=e,n.backgroundMesh=a=new ci(new ra(1,32,32),r),a.frustumCulled=!1,a.name="Background.mesh",a.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)}}const o=s.getCacheKey();n.backgroundCacheKey!==o&&(n.backgroundMeshNode.node=NS(s).mul(LD),n.backgroundMeshNode.needsUpdate=!0,a.material.needsUpdate=!0,n.backgroundCacheKey=o),t.unshift(a,a.geometry,a.material,0,0,null,null)}else console.error("THREE.Renderer: Unsupported background configuration.",i);if(!0===r.autoClear||!0===s){const e=n.clearColorValue;e.r=kL.r,e.g=kL.g,e.b=kL.b,e.a=kL.a,!0!==r.backend.isWebGLBackend&&!0!==r.alpha||(e.r*=e.a,e.g*=e.a,e.b*=e.a),n.depthClearValue=r._clearDepth,n.stencilClearValue=r._clearStencil,n.clearColor=!0===r.autoClearColor,n.clearDepth=!0===r.autoClearDepth,n.clearStencil=!0===r.autoClearStencil}else n.clearColor=!1,n.clearDepth=!1,n.clearStencil=!1}}let GL=0;class zL{constructor(e="",t=[],n=0,r=[]){this.name=e,this.bindings=t,this.index=n,this.bindingsReference=r,this.id=GL++}}class VL{constructor(e,t,n,r,i,s,a,o,l,u=[]){this.vertexShader=e,this.fragmentShader=t,this.computeShader=n,this.transforms=u,this.nodeAttributes=r,this.bindings=i,this.updateNodes=s,this.updateBeforeNodes=a,this.updateAfterNodes=o,this.monitor=l,this.usedTimes=0}createBindings(){const e=[];for(const t of this.bindings){if(!0!==t.bindings[0].groupNode.shared){const n=new zL(t.name,[],t.index,t);e.push(n);for(const e of t.bindings)n.bindings.push(e.clone())}else e.push(t)}return e}}class HL{constructor(e,t,n=null){this.isNodeAttribute=!0,this.name=e,this.type=t,this.node=n}}class jL{constructor(e,t,n){this.isNodeUniform=!0,this.name=e,this.type=t,this.node=n.getSelf()}get value(){return this.node.value}set value(e){this.node.value=e}get id(){return this.node.id}get groupNode(){return this.node.groupNode}}class WL{constructor(e,t){this.isNodeVar=!0,this.name=e,this.type=t}}class XL extends WL{constructor(e,t){super(e,t),this.needsInterpolation=!1,this.isNodeVarying=!0}}class QL{constructor(e,t,n=""){this.name=e,this.type=t,this.code=n,Object.defineProperty(this,"isNodeCode",{value:!0})}}let YL=0;class $L{constructor(e=null){this.id=YL++,this.nodesData=new WeakMap,this.parent=e}getData(e){let t=this.nodesData.get(e);return void 0===t&&null!==this.parent&&(t=this.parent.getData(e)),t}setData(e,t){this.nodesData.set(e,t)}}class KL{constructor(e,t){this.name=e,this.value=t,this.boundary=0,this.itemSize=0,this.offset=0}setValue(e){this.value=e}getValue(){return this.value}}class ZL extends KL{constructor(e,t=0){super(e,t),this.isNumberUniform=!0,this.boundary=4,this.itemSize=1}}class JL extends KL{constructor(e,t=new Lt){super(e,t),this.isVector2Uniform=!0,this.boundary=8,this.itemSize=2}}class eI extends KL{constructor(e,t=new on){super(e,t),this.isVector3Uniform=!0,this.boundary=16,this.itemSize=3}}class tI extends KL{constructor(e,t=new en){super(e,t),this.isVector4Uniform=!0,this.boundary=16,this.itemSize=4}}class nI extends KL{constructor(e,t=new Rr){super(e,t),this.isColorUniform=!0,this.boundary=16,this.itemSize=3}}class rI extends KL{constructor(e,t=new It){super(e,t),this.isMatrix3Uniform=!0,this.boundary=48,this.itemSize=12}}class iI extends KL{constructor(e,t=new On){super(e,t),this.isMatrix4Uniform=!0,this.boundary=64,this.itemSize=16}}class sI extends ZL{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class aI extends JL{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class oI extends eI{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class lI extends tI{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class uI extends nI{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class cI extends rI{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class AI extends iI{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}const hI=[.125,.215,.35,.446,.526,.582],dI=20,pI=new Oa(-1,1,1,-1,0,1),fI=new bi(90,1),mI=new Rr;let gI=null,vI=0,_I=0;const yI=(1+Math.sqrt(5))/2,xI=1/yI,bI=[new on(-yI,xI,0),new on(yI,xI,0),new on(-xI,0,yI),new on(xI,0,yI),new on(0,yI,-xI),new on(0,yI,xI),new on(-1,1,-1),new on(1,1,-1),new on(-1,1,1),new on(1,1,1)],SI=[3,1,5,0,4,2],TI=iP(RM(),CM("faceIndex")).normalize(),wI=MS(TI.x,TI.y.negate(),TI.z);class MI{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._backgroundBox=null}get _hasInitialized(){return this._renderer.hasInitialized()}fromScene(e,t=0,n=.1,r=100,i=null){if(this._setSize(256),!1===this._hasInitialized){console.warn("THREE.PMREMGenerator: .fromScene() called before the backend is initialized. Try using .fromSceneAsync() instead.");const s=i||this._allocateTargets();return this.fromSceneAsync(e,t,n,r,s),s}gI=this._renderer.getRenderTarget(),vI=this._renderer.getActiveCubeFace(),_I=this._renderer.getActiveMipmapLevel();const s=i||this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,r,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}async fromSceneAsync(e,t=0,n=.1,r=100,i=null){return!1===this._hasInitialized&&await this._renderer.init(),this.fromScene(e,t,n,r,i)}fromEquirectangular(e,t=null){if(!1===this._hasInitialized){console.warn("THREE.PMREMGenerator: .fromEquirectangular() called before the backend is initialized. Try using .fromEquirectangularAsync() instead."),this._setSizeFromTexture(e);const n=t||this._allocateTargets();return this.fromEquirectangularAsync(e,n),n}return this._fromTexture(e,t)}async fromEquirectangularAsync(e,t=null){return!1===this._hasInitialized&&await this._renderer.init(),this._fromTexture(e,t)}fromCubemap(e,t=null){if(!1===this._hasInitialized){console.warn("THREE.PMREMGenerator: .fromCubemap() called before the backend is initialized. Try using .fromCubemapAsync() instead."),this._setSizeFromTexture(e);const n=t||this._allocateTargets();return this.fromCubemapAsync(e,t),n}return this._fromTexture(e,t)}async fromCubemapAsync(e,t=null){return!1===this._hasInitialized&&await this._renderer.init(),this._fromTexture(e,t)}async compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=NI(),await this._compileMaterial(this._cubemapMaterial))}async compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=PI(),await this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose(),null!==this._backgroundBox&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSizeFromTexture(e){e.mapping===q||e.mapping===G?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4)}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(gI,vI,_I),e.scissorTest=!1,CI(e,0,0,e.width,e.height)}_fromTexture(e,t){this._setSizeFromTexture(e),gI=this._renderer.getRenderTarget(),vI=this._renderer.getActiveCubeFace(),_I=this._renderer.getActiveMipmapLevel();const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:K,minFilter:K,generateMipmaps:!1,type:oe,format:pe,colorSpace:it},r=EI(e,t,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=EI(e,t,n);const{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas,lodMeshes:this._lodMeshes}=function(e){const t=[],n=[],r=[],i=[];let s=e;const a=e-4+1+hI.length;for(let o=0;o<a;o++){const a=Math.pow(2,s);n.push(a);let l=1/a;o>e-4?l=hI[o-e+4-1]:0===o&&(l=0),r.push(l);const u=1/(a-2),c=-u,A=1+u,h=[c,c,A,c,A,A,c,c,A,A,c,A],d=6,p=6,f=3,m=2,g=1,v=new Float32Array(f*p*d),_=new Float32Array(m*p*d),y=new Float32Array(g*p*d);for(let e=0;e<d;e++){const t=e%3*2/3-1,n=e>2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0],i=SI[e];v.set(r,f*p*i),_.set(h,m*p*i);const s=[i,i,i,i,i,i];y.set(s,g*p*i)}const x=new Zr;x.setAttribute("position",new qr(v,f)),x.setAttribute("uv",new qr(_,m)),x.setAttribute("faceIndex",new qr(y,g)),t.push(x),i.push(new ci(x,null)),s>4&&s--}return{lodPlanes:t,sizeLods:n,sigmas:r,lodMeshes:i}}(r)),this._blurMaterial=function(e,t,n){const r=TE(new Array(dI).fill(0)),i=HS(new on(0,1,0)),s=HS(0),a=vS(dI),o=HS(0),l=HS(1),u=UM(null),c=HS(0),A=vS(1/t),h=vS(1/n),d=vS(e),p={n:a,latitudinal:o,weights:r,poleAxis:i,outputDirection:wI,dTheta:s,samples:l,envMap:u,mipInt:c,CUBEUV_TEXEL_WIDTH:A,CUBEUV_TEXEL_HEIGHT:h,CUBEUV_MAX_MIP:d},f=RI("blur");return f.uniforms=p,f.fragmentNode=lP({...p,latitudinal:o.equal(1)}),f}(r,e,t)}return r}async _compileMaterial(e){const t=new ci(this._lodPlanes[0],e);await this._renderer.compile(t,pI)}_sceneToCubeUV(e,t,n,r){const i=fI;i.near=t,i.far=n;const s=[-1,1,-1,-1,-1,-1],a=[1,1,1,-1,-1,-1],o=this._renderer,l=o.autoClear;o.getClearColor(mI),o.autoClear=!1;let u=this._backgroundBox;if(null===u){const e=new Lr({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1});u=new ci(new hi,e)}let c=!1;const A=e.background;A?A.isColor&&(u.material.color.copy(A),e.background=null,c=!0):(u.material.color.copy(mI),c=!0),o.setRenderTarget(r),o.clear(),c&&o.render(u,i);for(let t=0;t<6;t++){const n=t%3;0===n?(i.up.set(0,s[t],0),i.lookAt(a[t],0,0)):1===n?(i.up.set(0,0,s[t]),i.lookAt(0,a[t],0)):(i.up.set(0,s[t],0),i.lookAt(0,0,a[t]));const l=this._cubeSize;CI(r,n*l,t>2?l:0,l,l),o.render(e,i)}o.autoClear=l,e.background=A}_textureToCubeUV(e,t){const n=this._renderer,r=e.mapping===q||e.mapping===G;r?null===this._cubemapMaterial&&(this._cubemapMaterial=NI(e)):null===this._equirectMaterial&&(this._equirectMaterial=PI(e));const i=r?this._cubemapMaterial:this._equirectMaterial;i.fragmentNode.value=e;const s=this._lodMeshes[0];s.material=i;const a=this._cubeSize;CI(t,0,0,3*a,2*a),n.setRenderTarget(t),n.render(s,pI)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const r=this._lodPlanes.length;for(let t=1;t<r;t++){const n=Math.sqrt(this._sigmas[t]*this._sigmas[t]-this._sigmas[t-1]*this._sigmas[t-1]),i=bI[(r-t-1)%bI.length];this._blur(e,t-1,t,n,i)}t.autoClear=n}_blur(e,t,n,r,i){const s=this._pingPongRenderTarget;this._halfBlur(e,s,t,n,r,"latitudinal",i),this._halfBlur(s,e,n,n,r,"longitudinal",i)}_halfBlur(e,t,n,r,i,s,a){const o=this._renderer,l=this._blurMaterial;"latitudinal"!==s&&"longitudinal"!==s&&console.error("blur direction must be either latitudinal or longitudinal!");const u=this._lodMeshes[r];u.material=l;const c=l.uniforms,A=this._sizeLods[n]-1,h=isFinite(i)?Math.PI/(2*A):2*Math.PI/39,d=i/h,p=isFinite(i)?1+Math.floor(3*d):dI;p>dI&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${p} samples when the maximum is set to 20`);const f=[];let m=0;for(let e=0;e<dI;++e){const t=e/d,n=Math.exp(-t*t/2);f.push(n),0===e?m+=n:e<p&&(m+=2*n)}for(let e=0;e<f.length;e++)f[e]=f[e]/m;e.texture.frame=(e.texture.frame||0)+1,c.envMap.value=e.texture,c.samples.value=p,c.weights.array=f,c.latitudinal.value="latitudinal"===s?1:0,a&&(c.poleAxis.value=a);const{_lodMax:g}=this;c.dTheta.value=h,c.mipInt.value=g-n;const v=this._sizeLods[r];CI(t,3*v*(r>g-4?r-g+4:0),4*(this._cubeSize-v),3*v,2*v),o.setRenderTarget(t),o.render(u,pI)}}function EI(e,t,n){const r=new tn(e,t,n);return r.texture.mapping=H,r.texture.name="PMREM.cubeUv",r.texture.isPMREMTexture=!0,r.scissorTest=!0,r}function CI(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function RI(e){const t=new TR;return t.depthTest=!1,t.depthWrite=!1,t.blending=0,t.name=`PMREM_${e}`,t}function NI(e){const t=RI("cubemap");return t.fragmentNode=_E(e,wI),t}function PI(e){const t=RI("equirect");return t.fragmentNode=UM(e,DR(wI),0),t}const DI=new WeakMap,LI=new Map([[Int8Array,"int"],[Int16Array,"int"],[Int32Array,"int"],[Uint8Array,"uint"],[Uint16Array,"uint"],[Uint32Array,"uint"],[Float32Array,"float"]]),II=e=>/e/g.test(e)?String(e).replace(/\+/g,""):(e=Number(e))+(e%1?"":".0");class UI{constructor(e,t,n){this.object=e,this.material=e&&e.material||null,this.geometry=e&&e.geometry||null,this.renderer=t,this.parser=n,this.scene=null,this.camera=null,this.nodes=[],this.sequentialNodes=[],this.updateNodes=[],this.updateBeforeNodes=[],this.updateAfterNodes=[],this.hashNodes={},this.monitor=null,this.lightsNode=null,this.environmentNode=null,this.fogNode=null,this.clippingContext=null,this.vertexShader=null,this.fragmentShader=null,this.computeShader=null,this.flowNodes={vertex:[],fragment:[],compute:[]},this.flowCode={vertex:"",fragment:"",compute:""},this.uniforms={vertex:[],fragment:[],compute:[],index:0},this.structs={vertex:[],fragment:[],compute:[],index:0},this.bindings={vertex:{},fragment:{},compute:{}},this.bindingsIndexes={},this.bindGroups=null,this.attributes=[],this.bufferAttributes=[],this.varyings=[],this.codes={},this.vars={},this.flow={code:""},this.chaining=[],this.stack=SD(),this.stacks=[],this.tab="\t",this.currentFunctionNode=null,this.context={material:this.material},this.cache=new $L,this.globalCache=this.cache,this.flowsData=new WeakMap,this.shaderStage=null,this.buildStage=null,this.useComparisonMethod=!1}getBindGroupsCache(){let e=DI.get(this.renderer);return void 0===e&&(e=new qP,DI.set(this.renderer,e)),e}createRenderTarget(e,t,n){return new tn(e,t,n)}createCubeRenderTarget(e,t){return new LR(e,t)}createPMREMGenerator(){return new MI(this.renderer)}includes(e){return this.nodes.includes(e)}_getBindGroup(e,t){const n=this.getBindGroupsCache(),r=[];let i,s=!0;for(const e of t)r.push(e),s=s&&!0!==e.groupNode.shared;return s?(i=n.get(r),void 0===i&&(i=new zL(e,r,this.bindingsIndexes[e].group,r),n.set(r,i))):i=new zL(e,r,this.bindingsIndexes[e].group,r),i}getBindGroupArray(e,t){const n=this.bindings[t];let r=n[e];return void 0===r&&(void 0===this.bindingsIndexes[e]&&(this.bindingsIndexes[e]={binding:0,group:Object.keys(this.bindingsIndexes).length}),n[e]=r=[]),r}getBindings(){let e=this.bindGroups;if(null===e){const t={},n=this.bindings;for(const e of yb)for(const r in n[e]){const i=n[e][r];(t[r]||(t[r]=[])).push(...i)}e=[];for(const n in t){const r=t[n],i=this._getBindGroup(n,r);e.push(i)}this.bindGroups=e}return e}sortBindingGroups(){const e=this.getBindings();e.sort(((e,t)=>e.bindings[0].groupNode.order-t.bindings[0].groupNode.order));for(let t=0;t<e.length;t++){const n=e[t];this.bindingsIndexes[n.name].group=t,n.index=t}}setHashNode(e,t){this.hashNodes[t]=e}addNode(e){!1===this.nodes.includes(e)&&(this.nodes.push(e),this.setHashNode(e,e.getHash(this)))}addSequentialNode(e){!1===this.sequentialNodes.includes(e)&&this.sequentialNodes.push(e)}buildUpdateNodes(){for(const e of this.nodes){e.getUpdateType()!==hb&&this.updateNodes.push(e.getSelf())}for(const e of this.sequentialNodes){const t=e.getUpdateBeforeType(),n=e.getUpdateAfterType();t!==hb&&this.updateBeforeNodes.push(e.getSelf()),n!==hb&&this.updateAfterNodes.push(e.getSelf())}}get currentNode(){return this.chaining[this.chaining.length-1]}isFilteredTexture(e){return e.magFilter===K||e.magFilter===Z||e.magFilter===$||e.magFilter===J||e.minFilter===K||e.minFilter===Z||e.minFilter===$||e.minFilter===J}addChain(e){this.chaining.push(e)}removeChain(e){if(this.chaining.pop()!==e)throw new Error("NodeBuilder: Invalid node chaining!")}getMethod(e){return e}getNodeFromHash(e){return this.hashNodes[e]}addFlow(e,t){return this.flowNodes[e].push(t),t}setContext(e){this.context=e}getContext(){return this.context}getSharedContext(){return this.context,this.context}setCache(e){this.cache=e}getCache(){return this.cache}getCacheFromNode(e,t=!0){const n=this.getDataFromNode(e);return void 0===n.cache&&(n.cache=new $L(t?this.getCache():null)),n.cache}isAvailable(){return!1}getVertexIndex(){console.warn("Abstract function.")}getInstanceIndex(){console.warn("Abstract function.")}getDrawIndex(){console.warn("Abstract function.")}getFrontFacing(){console.warn("Abstract function.")}getFragCoord(){console.warn("Abstract function.")}isFlipY(){return!1}increaseUsage(e){const t=this.getDataFromNode(e);return t.usageCount=void 0===t.usageCount?1:t.usageCount+1,t.usageCount}generateTexture(){console.warn("Abstract function.")}generateTextureLod(){console.warn("Abstract function.")}generateConst(e,t=null){if(null===t&&("float"===e||"int"===e||"uint"===e?t=0:"bool"===e?t=!1:"color"===e?t=new Rr:"vec2"===e?t=new Lt:"vec3"===e?t=new on:"vec4"===e&&(t=new en)),"float"===e)return II(t);if("int"===e)return`${Math.round(t)}`;if("uint"===e)return t>=0?`${Math.round(t)}u`:"0u";if("bool"===e)return t?"true":"false";if("color"===e)return`${this.getType("vec3")}( ${II(t.r)}, ${II(t.g)}, ${II(t.b)} )`;const n=this.getTypeLength(e),r=this.getComponentType(e),i=e=>this.generateConst(r,e);if(2===n)return`${this.getType(e)}( ${i(t.x)}, ${i(t.y)} )`;if(3===n)return`${this.getType(e)}( ${i(t.x)}, ${i(t.y)}, ${i(t.z)} )`;if(4===n)return`${this.getType(e)}( ${i(t.x)}, ${i(t.y)}, ${i(t.z)}, ${i(t.w)} )`;if(n>4&&t&&(t.isMatrix3||t.isMatrix4))return`${this.getType(e)}( ${t.elements.map(i).join(", ")} )`;if(n>4)return`${this.getType(e)}()`;throw new Error(`NodeBuilder: Type '${e}' not found in generate constant attempt.`)}getType(e){return"color"===e?"vec3":e}hasGeometryAttribute(e){return this.geometry&&void 0!==this.geometry.getAttribute(e)}getAttribute(e,t){const n=this.attributes;for(const t of n)if(t.name===e)return t;const r=new HL(e,t);return n.push(r),r}getPropertyName(e){return e.name}isVector(e){return/vec\d/.test(e)}isMatrix(e){return/mat\d/.test(e)}isReference(e){return"void"===e||"property"===e||"sampler"===e||"texture"===e||"cubeTexture"===e||"storageTexture"===e||"depthTexture"===e||"texture3D"===e}needsToWorkingColorSpace(){return!1}getComponentTypeFromTexture(e){const t=e.type;if(e.isDataTexture){if(t===ie)return"int";if(t===se)return"uint"}return"float"}getElementType(e){return"mat2"===e?"vec2":"mat3"===e?"vec3":"mat4"===e?"vec4":this.getComponentType(e)}getComponentType(e){if("float"===(e=this.getVectorType(e))||"bool"===e||"int"===e||"uint"===e)return e;const t=/(b|i|u|)(vec|mat)([2-4])/.exec(e);return null===t?null:"b"===t[1]?"bool":"i"===t[1]?"int":"u"===t[1]?"uint":"float"}getVectorType(e){return"color"===e?"vec3":"texture"===e||"cubeTexture"===e||"storageTexture"===e||"texture3D"===e?"vec4":e}getTypeFromLength(e,t="float"){if(1===e)return t;const n=function(e){return lb.get(e)}(e);return("float"===t?"":t[0])+n}getTypeFromArray(e){return LI.get(e.constructor)}getTypeFromAttribute(e){let t=e;e.isInterleavedBufferAttribute&&(t=e.data);const n=t.array,r=e.itemSize,i=e.normalized;let s;return e instanceof Vr||!0===i||(s=this.getTypeFromArray(n)),this.getTypeFromLength(r,s)}getTypeLength(e){const t=this.getVectorType(e),n=/vec([2-4])/.exec(t);return null!==n?Number(n[1]):"float"===t||"bool"===t||"int"===t||"uint"===t?1:!0===/mat2/.test(e)?4:!0===/mat3/.test(e)?9:!0===/mat4/.test(e)?16:0}getVectorFromMatrix(e){return e.replace("mat","vec")}changeComponentType(e,t){return this.getTypeFromLength(this.getTypeLength(e),t)}getIntegerType(e){const t=this.getComponentType(e);return"int"===t||"uint"===t?e:this.changeComponentType(e,"int")}addStack(){return this.stack=SD(this.stack),this.stacks.push(fS()||this.stack),pS(this.stack),this.stack}removeStack(){const e=this.stack;return this.stack=e.parent,pS(this.stacks.pop()),e}getDataFromNode(e,t=this.shaderStage,n=null){let r=(n=null===n?e.isGlobal(this)?this.globalCache:this.cache:n).getData(e);return void 0===r&&(r={},n.setData(e,r)),void 0===r[t]&&(r[t]={}),r[t]}getNodeProperties(e,t="any"){const n=this.getDataFromNode(e,t);return n.properties||(n.properties={outputNode:null})}getBufferAttributeFromNode(e,t){const n=this.getDataFromNode(e);let r=n.bufferAttribute;if(void 0===r){const i=this.uniforms.index++;r=new HL("nodeAttribute"+i,t,e),this.bufferAttributes.push(r),n.bufferAttribute=r}return r}getStructTypeFromNode(e,t=this.shaderStage){const n=this.getDataFromNode(e,t);if(void 0===n.structType){const r=this.structs.index++;e.name=`StructType${r}`,this.structs[t].push(e),n.structType=e}return e}getUniformFromNode(e,t,n=this.shaderStage,r=null){const i=this.getDataFromNode(e,n,this.globalCache);let s=i.uniform;if(void 0===s){const a=this.uniforms.index++;s=new jL(r||"nodeUniform"+a,t,e),this.uniforms[n].push(s),i.uniform=s}return s}getVarFromNode(e,t=null,n=e.getNodeType(this),r=this.shaderStage){const i=this.getDataFromNode(e,r);let s=i.variable;if(void 0===s){const e=this.vars[r]||(this.vars[r]=[]);null===t&&(t="nodeVar"+e.length),s=new WL(t,n),e.push(s),i.variable=s}return s}getVaryingFromNode(e,t=null,n=e.getNodeType(this)){const r=this.getDataFromNode(e,"any");let i=r.varying;if(void 0===i){const e=this.varyings,s=e.length;null===t&&(t="nodeVarying"+s),i=new XL(t,n),e.push(i),r.varying=i}return i}getCodeFromNode(e,t,n=this.shaderStage){const r=this.getDataFromNode(e);let i=r.code;if(void 0===i){const e=this.codes[n]||(this.codes[n]=[]),s=e.length;i=new QL("nodeCode"+s,t),e.push(i),r.code=i}return i}addFlowCodeHierarchy(e,t){const{flowCodes:n,flowCodeBlock:r}=this.getDataFromNode(e);let i=!0,s=t;for(;s;){if(!0===r.get(s)){i=!1;break}s=this.getDataFromNode(s).parentNodeBlock}if(i)for(const e of n)this.addLineFlowCode(e)}addLineFlowCodeBlock(e,t,n){const r=this.getDataFromNode(e),i=r.flowCodes||(r.flowCodes=[]),s=r.flowCodeBlock||(r.flowCodeBlock=new WeakMap);i.push(t),s.set(n,!0)}addLineFlowCode(e,t=null){return""===e||(null!==t&&this.context.nodeBlock&&this.addLineFlowCodeBlock(t,e,this.context.nodeBlock),e=this.tab+e,/;\s*$/.test(e)||(e+=";\n"),this.flow.code+=e),this}addFlowCode(e){return this.flow.code+=e,this}addFlowTab(){return this.tab+="\t",this}removeFlowTab(){return this.tab=this.tab.slice(0,-1),this}getFlowData(e){return this.flowsData.get(e)}flowNode(e){const t=e.getNodeType(this),n=this.flowChildNode(e,t);return this.flowsData.set(e,n),n}buildFunctionNode(e){const t=new $D,n=this.currentFunctionNode;return this.currentFunctionNode=t,t.code=this.buildFunctionCode(e),this.currentFunctionNode=n,t}flowShaderNode(e){const t=e.layout,n={[Symbol.iterator](){let e=0;const t=Object.values(this);return{next:()=>({value:t[e],done:e++>=t.length})}}};for(const e of t.inputs)n[e.name]=new xD(e.type,e.name);e.layout=null;const r=e.call(n),i=this.flowStagesNode(r,t.type);return e.layout=t,i}flowStagesNode(e,t=null){const n=this.flow,r=this.vars,i=this.cache,s=this.buildStage,a=this.stack,o={code:""};this.flow=o,this.vars={},this.cache=new $L,this.stack=SD();for(const n of _b)this.setBuildStage(n),o.result=e.build(this,t);return o.vars=this.getVars(this.shaderStage),this.flow=n,this.vars=r,this.cache=i,this.stack=a,this.setBuildStage(s),o}getFunctionOperator(){return null}flowChildNode(e,t=null){const n=this.flow,r={code:""};return this.flow=r,r.result=e.build(this,t),this.flow=n,r}flowNodeFromShaderStage(e,t,n=null,r=null){const i=this.shaderStage;this.setShaderStage(e);const s=this.flowChildNode(t,n);return null!==r&&(s.code+=`${this.tab+r} = ${s.result};\n`),this.flowCode[e]=this.flowCode[e]+s.code,this.setShaderStage(i),s}getAttributesArray(){return this.attributes.concat(this.bufferAttributes)}getAttributes(){console.warn("Abstract function.")}getVaryings(){console.warn("Abstract function.")}getVar(e,t){return`${this.getType(e)} ${t}`}getVars(e){let t="";const n=this.vars[e];if(void 0!==n)for(const e of n)t+=`${this.getVar(e.type,e.name)}; `;return t}getUniforms(){console.warn("Abstract function.")}getCodes(e){const t=this.codes[e];let n="";if(void 0!==t)for(const e of t)n+=e.code+"\n";return n}getHash(){return this.vertexShader+this.fragmentShader+this.computeShader}setShaderStage(e){this.shaderStage=e}getShaderStage(){return this.shaderStage}setBuildStage(e){this.buildStage=e}getBuildStage(){return this.buildStage}buildCode(){console.warn("Abstract function.")}build(){const{object:e,material:t,renderer:n}=this;if(null!==t){let e=n.library.fromMaterial(t);null===e&&(console.error(`NodeMaterial: Material "${t.type}" is not compatible.`),e=new TR),e.build(this)}else this.addFlow("compute",e);for(const e of _b){this.setBuildStage(e),this.context.vertex&&this.context.vertex.isNode&&this.flowNodeFromShaderStage("vertex",this.context.vertex);for(const t of yb){this.setShaderStage(t);const n=this.flowNodes[t];for(const t of n)"generate"===e?this.flowNode(t):t.build(this)}}return this.setBuildStage(null),this.setShaderStage(null),this.buildCode(),this.buildUpdateNodes(),this}getNodeUniform(e,t){if("float"===t||"int"===t||"uint"===t)return new sI(e);if("vec2"===t||"ivec2"===t||"uvec2"===t)return new aI(e);if("vec3"===t||"ivec3"===t||"uvec3"===t)return new oI(e);if("vec4"===t||"ivec4"===t||"uvec4"===t)return new lI(e);if("color"===t)return new uI(e);if("mat3"===t)return new cI(e);if("mat4"===t)return new AI(e);throw new Error(`Uniform "${t}" not declared.`)}createNodeMaterial(e="NodeMaterial"){throw new Error(`THREE.NodeBuilder: createNodeMaterial() was deprecated. Use new ${e}() instead.`)}format(e,t,n){if((t=this.getVectorType(t))===(n=this.getVectorType(n))||null===n||this.isReference(n))return e;const r=this.getTypeLength(t),i=this.getTypeLength(n);return 16===r&&9===i?`${this.getType(n)}(${e}[0].xyz, ${e}[1].xyz, ${e}[2].xyz)`:9===r&&4===i?`${this.getType(n)}(${e}[0].xy, ${e}[1].xy)`:r>4||i>4||0===i?e:r===i?`${this.getType(n)}( ${e} )`:r>i?this.format(`${e}.${"xyz".slice(0,i)}`,this.getTypeFromLength(i,this.getComponentType(t)),n):4===i&&r>1?`${this.getType(n)}( ${this.format(e,t,"vec3")}, 1.0 )`:2===r?`${this.getType(n)}( ${this.format(e,t,"vec2")}, 0.0 )`:(1===r&&i>1&&t!==this.getComponentType(n)&&(e=`${this.getType(this.getComponentType(n))}( ${e} )`),`${this.getType(n)}( ${e} )`)}getSignature(){return`// Three.js r${s} - Node System\n`}}class BI{constructor(){this.time=0,this.deltaTime=0,this.frameId=0,this.renderId=0,this.startTime=null,this.updateMap=new WeakMap,this.updateBeforeMap=new WeakMap,this.updateAfterMap=new WeakMap,this.renderer=null,this.material=null,this.camera=null,this.object=null,this.scene=null}_getMaps(e,t){let n=e.get(t);return void 0===n&&(n={renderMap:new WeakMap,frameMap:new WeakMap},e.set(t,n)),n}updateBeforeNode(e){const t=e.getUpdateBeforeType(),n=e.updateReference(this);if(t===db){const{frameMap:t}=this._getMaps(this.updateBeforeMap,n);t.get(n)!==this.frameId&&!1!==e.updateBefore(this)&&t.set(n,this.frameId)}else if(t===pb){const{renderMap:t}=this._getMaps(this.updateBeforeMap,n);t.get(n)!==this.renderId&&!1!==e.updateBefore(this)&&t.set(n,this.renderId)}else t===fb&&e.updateBefore(this)}updateAfterNode(e){const t=e.getUpdateAfterType(),n=e.updateReference(this);if(t===db){const{frameMap:t}=this._getMaps(this.updateAfterMap,n);t.get(n)!==this.frameId&&!1!==e.updateAfter(this)&&t.set(n,this.frameId)}else if(t===pb){const{renderMap:t}=this._getMaps(this.updateAfterMap,n);t.get(n)!==this.renderId&&!1!==e.updateAfter(this)&&t.set(n,this.renderId)}else t===fb&&e.updateAfter(this)}updateNode(e){const t=e.getUpdateType(),n=e.updateReference(this);if(t===db){const{frameMap:t}=this._getMaps(this.updateMap,n);t.get(n)!==this.frameId&&!1!==e.update(this)&&t.set(n,this.frameId)}else if(t===pb){const{renderMap:t}=this._getMaps(this.updateMap,n);t.get(n)!==this.renderId&&!1!==e.update(this)&&t.set(n,this.renderId)}else t===fb&&e.update(this)}update(){this.frameId++,void 0===this.lastTime&&(this.lastTime=performance.now()),this.deltaTime=(performance.now()-this.lastTime)/1e3,this.lastTime=performance.now(),this.time+=this.deltaTime}}class OI{constructor(e,t,n=null,r="",i=!1){this.type=e,this.name=t,this.count=n,this.qualifier=r,this.isConst=i}}OI.isNodeFunctionInput=!0;class FI extends wL{static get type(){return"DirectionalLightNode"}constructor(e=null){super(e)}setup(e){super.setup(e);const t=e.context.lightingModel,n=this.colorNode,r=lL(this.light),i=e.context.reflectedLight;t.direct({lightDirection:r,lightColor:n,reflectedLight:i},e.stack,e)}}const kI=new On,qI=new On;let GI=null;class zI extends wL{static get type(){return"RectAreaLightNode"}constructor(e=null){super(e),this.halfHeight=HS(new on).setGroup(GS),this.halfWidth=HS(new on).setGroup(GS),this.updateType=pb}update(e){super.update(e);const{light:t}=this,n=e.camera.matrixWorldInverse;qI.identity(),kI.copy(t.matrixWorld),kI.premultiply(n),qI.extractRotation(kI),this.halfWidth.value.set(.5*t.width,0,0),this.halfHeight.value.set(0,.5*t.height,0),this.halfWidth.value.applyMatrix4(qI),this.halfHeight.value.applyMatrix4(qI)}setup(e){let t,n;super.setup(e),e.isAvailable("float32Filterable")?(t=UM(GI.LTC_FLOAT_1),n=UM(GI.LTC_FLOAT_2)):(t=UM(GI.LTC_HALF_1),n=UM(GI.LTC_HALF_2));const{colorNode:r,light:i}=this,s=e.context.lightingModel,a=oL(i),o=e.context.reflectedLight;s.directRectArea({lightColor:r,lightPosition:a,halfWidth:this.halfWidth,halfHeight:this.halfHeight,reflectedLight:o,ltc_1:t,ltc_2:n},e.stack,e)}static setLTC(e){GI=e}}class VI extends wL{static get type(){return"SpotLightNode"}constructor(e=null){super(e),this.coneCosNode=HS(0).setGroup(GS),this.penumbraCosNode=HS(0).setGroup(GS),this.cutoffDistanceNode=HS(0).setGroup(GS),this.decayExponentNode=HS(0).setGroup(GS)}update(e){super.update(e);const{light:t}=this;this.coneCosNode.value=Math.cos(t.angle),this.penumbraCosNode.value=Math.cos(t.angle*(1-t.penumbra)),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}getSpotAttenuation(e){const{coneCosNode:t,penumbraCosNode:n}=this;return Hw(t,n,e)}setup(e){super.setup(e);const t=e.context.lightingModel,{colorNode:n,cutoffDistanceNode:r,decayExponentNode:i,light:s}=this,a=oL(s).sub(JM),o=a.normalize(),l=o.dot(lL(s)),u=this.getSpotAttenuation(l),c=a.length(),A=ML({lightDistance:c,cutoffDistance:r,decayExponent:i});let h=n.mul(u).mul(A);if(s.map){const e=function(e){const t=iL(e);if(void 0===t.projectionUV){const n=sL(e).mul(KM);t.projectionUV=n.xyz.div(n.w)}return t.projectionUV}(s),t=UM(s.map,e.xy).onRenderUpdate((()=>s.map));h=e.mul(2).sub(1).abs().lessThan(1).all().select(h.mul(t),h)}const d=e.context.reflectedLight;t.direct({lightDirection:o,lightColor:h,reflectedLight:d},e.stack,e)}}class HI extends VI{static get type(){return"IESSpotLightNode"}getSpotAttenuation(e){const t=this.light.iesMap;let n=null;if(t&&!0===t.isTexture){const r=e.acos().mul(1/Math.PI);n=UM(t,bS(r,0),0).r}else n=super.getSpotAttenuation(e);return n}}class jI extends wL{static get type(){return"AmbientLightNode"}constructor(e=null){super(e)}setup({context:e}){e.irradiance.addAssign(this.colorNode)}}class WI extends wL{static get type(){return"HemisphereLightNode"}constructor(e=null){super(e),this.lightPositionNode=aL(e),this.lightDirectionNode=this.lightPositionNode.normalize(),this.groundColorNode=HS(new Rr).setGroup(GS)}update(e){const{light:t}=this;super.update(e),this.lightPositionNode.object3d=t,this.groundColorNode.value.copy(t.groundColor).multiplyScalar(t.intensity)}setup(e){const{colorNode:t,groundColorNode:n,lightDirectionNode:r}=this,i=aE.dot(r).mul(.5).add(.5),s=Gw(n,t,i);e.context.irradiance.addAssign(s)}}class XI extends wL{static get type(){return"LightProbeNode"}constructor(e=null){super(e);const t=[];for(let e=0;e<9;e++)t.push(new on);this.lightProbe=TE(t)}update(e){const{light:t}=this;super.update(e);for(let e=0;e<9;e++)this.lightProbe.array[e].copy(t.sh.coefficients[e]).multiplyScalar(t.intensity)}setup(e){const t=FL(oE,this.lightProbe);e.context.irradiance.addAssign(t)}}class QI{parseFunction(){console.warn("Abstract function.")}}class YI{constructor(e,t,n="",r=""){this.type=e,this.inputs=t,this.name=n,this.precision=r}getCode(){console.warn("Abstract function.")}}YI.isNodeFunction=!0;const $I=/^\s*(highp|mediump|lowp)?\s*([a-z_0-9]+)\s*([a-z_0-9]+)?\s*\(([\s\S]*?)\)/i,KI=/[a-z_0-9]+/gi,ZI="#pragma main";class JI extends YI{constructor(e){const{type:t,inputs:n,name:r,precision:i,inputsCode:s,blockCode:a,headerCode:o}=(e=>{const t=(e=e.trim()).indexOf(ZI),n=-1!==t?e.slice(t+12):e,r=n.match($I);if(null!==r&&5===r.length){const i=r[4],s=[];let a=null;for(;null!==(a=KI.exec(i));)s.push(a);const o=[];let l=0;for(;l<s.length;){const e="const"===s[l][0];!0===e&&l++;let t=s[l][0];"in"===t||"out"===t||"inout"===t?l++:t="";const n=s[l++][0];let r=Number.parseInt(s[l][0]);!1===Number.isNaN(r)?l++:r=null;const i=s[l++][0];o.push(new OI(n,i,r,t,e))}const u=n.substring(r[0].length),c=void 0!==r[3]?r[3]:"";return{type:r[2],inputs:o,name:c,precision:void 0!==r[1]?r[1]:"",inputsCode:i,blockCode:u,headerCode:-1!==t?e.slice(0,t):""}}throw new Error("FunctionNode: Function is not a GLSL code.")})(e);super(t,n,r,i),this.inputsCode=s,this.blockCode=a,this.headerCode=o}getCode(e=this.name){let t;const n=this.blockCode;if(""!==n){const{type:r,inputsCode:i,headerCode:s,precision:a}=this;let o=`${r} ${e} ( ${i.trim()} )`;""!==a&&(o=`${a} ${o}`),t=s+o+n}else t="";return t}}class eU extends QI{parseFunction(e){return new JI(e)}}const tU=new WeakMap;class nU extends jP{constructor(e,t){super(),this.renderer=e,this.backend=t,this.nodeFrame=new BI,this.nodeBuilderCache=new Map,this.callHashCache=new qP,this.groupsData=new qP}updateGroup(e){const t=e.groupNode,n=t.name;if(n===zS.name)return!0;if(n===GS.name){const t=this.get(e),n=this.nodeFrame.renderId;return t.renderId!==n&&(t.renderId=n,!0)}if(n===qS.name){const t=this.get(e),n=this.nodeFrame.frameId;return t.frameId!==n&&(t.frameId=n,!0)}const r=[t,e];let i=this.groupsData.get(r);return void 0===i&&this.groupsData.set(r,i={}),i.version!==t.version&&(i.version=t.version,!0)}getForRenderCacheKey(e){return e.initialCacheKey}getForRender(e){const t=this.get(e);let n=t.nodeBuilderState;if(void 0===n){const{nodeBuilderCache:r}=this,i=this.getForRenderCacheKey(e);if(n=r.get(i),void 0===n){const t=this.backend.createNodeBuilder(e.object,this.renderer);t.scene=e.scene,t.material=e.material,t.camera=e.camera,t.context.material=e.material,t.lightsNode=e.lightsNode,t.environmentNode=this.getEnvironmentNode(e.scene),t.fogNode=this.getFogNode(e.scene),t.clippingContext=e.clippingContext,t.build(),n=this._createNodeBuilderState(t),r.set(i,n)}n.usedTimes++,t.nodeBuilderState=n}return n}delete(e){if(e.isRenderObject){const t=this.get(e).nodeBuilderState;t.usedTimes--,0===t.usedTimes&&this.nodeBuilderCache.delete(this.getForRenderCacheKey(e))}return super.delete(e)}getForCompute(e){const t=this.get(e);let n=t.nodeBuilderState;if(void 0===n){const r=this.backend.createNodeBuilder(e,this.renderer);r.build(),n=this._createNodeBuilderState(r),t.nodeBuilderState=n}return n}_createNodeBuilderState(e){return new VL(e.vertexShader,e.fragmentShader,e.computeShader,e.getAttributesArray(),e.getBindings(),e.updateNodes,e.updateBeforeNodes,e.updateAfterNodes,e.monitor,e.transforms)}getEnvironmentNode(e){return e.environmentNode||this.get(e).environmentNode||null}getBackgroundNode(e){return e.backgroundNode||this.get(e).backgroundNode||null}getFogNode(e){return e.fogNode||this.get(e).fogNode||null}getCacheKey(e,t){const n=[e,t],r=this.renderer.info.calls;let i=this.callHashCache.get(n);if(void 0===i||i.callId!==r){const s=this.getEnvironmentNode(e),a=this.getFogNode(e),o=[];t&&o.push(t.getCacheKey(!0)),s&&o.push(s.getCacheKey()),a&&o.push(a.getCacheKey()),o.push(this.renderer.shadowMap.enabled?1:0),i={callId:r,cacheKey:ib(o)},this.callHashCache.set(n,i)}return i.cacheKey}updateScene(e){this.updateEnvironment(e),this.updateFog(e),this.updateBackground(e)}get isToneMappingState(){return!this.renderer.getRenderTarget()}updateBackground(e){const t=this.get(e),n=e.background;if(n){const r=0===e.backgroundBlurriness&&t.backgroundBlurriness>0||e.backgroundBlurriness>0&&0===t.backgroundBlurriness;if(t.background!==n||r){let r=null;if(!0===n.isCubeTexture||n.mapping===z||n.mapping===V||n.mapping===H)if(e.backgroundBlurriness>0||n.mapping===H)r=dP(n);else{let e;e=!0===n.isCubeTexture?_E(n):UM(n),r=FR(e)}else!0===n.isTexture?r=UM(n,nR.flipY()).setUpdateMatrix(!0):!0!==n.isColor&&console.error("WebGPUNodes: Unsupported background configuration.",n);t.backgroundNode=r,t.background=n,t.backgroundBlurriness=e.backgroundBlurriness}}else t.backgroundNode&&(delete t.backgroundNode,delete t.background)}updateFog(e){const t=this.get(e),n=e.fog;if(n){if(t.fog!==n){let e=null;if(n.isFogExp2){const t=EE("color","color",n).setGroup(GS),r=EE("density","float",n).setGroup(GS);e=tL(t,r)}else if(n.isFog){const t=EE("color","color",n).setGroup(GS),r=EE("near","float",n).setGroup(GS),i=EE("far","float",n).setGroup(GS);e=JD(t,r,i)}else console.error("WebGPUNodes: Unsupported fog configuration.",n);t.fogNode=e,t.fog=n}}else delete t.fogNode,delete t.fog}updateEnvironment(e){const t=this.get(e),n=e.environment;if(n){if(t.environment!==n){let e=null;!0===n.isCubeTexture?e=_E(n):!0===n.isTexture?e=UM(n):console.error("Nodes: Unsupported environment configuration.",n),t.environmentNode=e,t.environment=n}}else t.environmentNode&&(delete t.environmentNode,delete t.environment)}getNodeFrame(e=this.renderer,t=null,n=null,r=null,i=null){const s=this.nodeFrame;return s.renderer=e,s.scene=t,s.object=n,s.camera=r,s.material=i,s}getNodeFrameForRender(e){return this.getNodeFrame(e.renderer,e.scene,e.object,e.camera,e.material)}getOutputCacheKey(){const e=this.renderer;return e.toneMapping+","+e.currentColorSpace}hasOutputChange(e){return tU.get(e)!==this.getOutputCacheKey()}getOutputNode(e){const t=this.renderer,n=this.getOutputCacheKey(),r=UM(e,nR).renderOutput(t.toneMapping,t.currentColorSpace);return tU.set(e,n),r}updateBefore(e){const t=e.getNodeBuilderState();for(const n of t.updateBeforeNodes)this.getNodeFrameForRender(e).updateBeforeNode(n)}updateAfter(e){const t=e.getNodeBuilderState();for(const n of t.updateAfterNodes)this.getNodeFrameForRender(e).updateAfterNode(n)}updateForCompute(e){const t=this.getNodeFrame(),n=this.getForCompute(e);for(const e of n.updateNodes)t.updateNode(e)}updateForRender(e){const t=this.getNodeFrameForRender(e),n=e.getNodeBuilderState();for(const e of n.updateNodes)t.updateNode(e)}needsRefresh(e){const t=this.getNodeFrameForRender(e);return e.getMonitor().needsRefresh(e,t)}dispose(){super.dispose(),this.nodeFrame=new BI,this.nodeBuilderCache=new Map}}const rU=new Oi;class iU{constructor(e=null){this.version=0,this.clipIntersection=null,this.cacheKey="",null===e?(this.intersectionPlanes=[],this.unionPlanes=[],this.viewNormalMatrix=new It,this.clippingGroupContexts=new WeakMap,this.shadowPass=!1):(this.viewNormalMatrix=e.viewNormalMatrix,this.clippingGroupContexts=e.clippingGroupContexts,this.shadowPass=e.shadowPass,this.viewMatrix=e.viewMatrix),this.parentVersion=null}projectPlanes(e,t,n){const r=e.length;for(let i=0;i<r;i++){rU.copy(e[i]).applyMatrix4(this.viewMatrix,this.viewNormalMatrix);const r=t[n+i],s=rU.normal;r.x=-s.x,r.y=-s.y,r.z=-s.z,r.w=rU.constant}}updateGlobal(e,t){this.shadowPass=null!==e.overrideMaterial&&e.overrideMaterial.isShadowNodeMaterial,this.viewMatrix=t.matrixWorldInverse,this.viewNormalMatrix.getNormalMatrix(this.viewMatrix)}update(e,t){let n=!1;e.version!==this.parentVersion&&(this.intersectionPlanes=Array.from(e.intersectionPlanes),this.unionPlanes=Array.from(e.unionPlanes),this.parentVersion=e.version),this.clipIntersection!==t.clipIntersection&&(this.clipIntersection=t.clipIntersection,this.clipIntersection?this.unionPlanes.length=e.unionPlanes.length:this.intersectionPlanes.length=e.intersectionPlanes.length);const r=t.clippingPlanes,i=r.length;let s,a;if(this.clipIntersection?(s=this.intersectionPlanes,a=e.intersectionPlanes.length):(s=this.unionPlanes,a=e.unionPlanes.length),s.length!==a+i){s.length=a+i;for(let e=0;e<i;e++)s[a+e]=new en;n=!0}this.projectPlanes(r,s,a),n&&(this.version++,this.cacheKey=`${this.intersectionPlanes.length}:${this.unionPlanes.length}`)}getGroupContext(e){if(this.shadowPass&&!e.clipShadows)return this;let t=this.clippingGroupContexts.get(e);return void 0===t&&(t=new iU(this),this.clippingGroupContexts.set(e,t)),t.update(this,e),t}get unionClippingCount(){return this.unionPlanes.length}}class sU{constructor(e,t){this.scene=e,this.camera=t}clone(){return Object.assign(new this.constructor,this)}}class aU{constructor(){this.lists=new qP}get(e,t){const n=this.lists,r=[e,t];let i=n.get(r);return void 0===i&&(i=new sU(e,t),n.set(r,i)),i}dispose(){this.lists=new qP}}class oU{constructor(){this.lightNodes=new WeakMap,this.materialNodes=new Map,this.toneMappingNodes=new Map}fromMaterial(e){if(e.isNodeMaterial)return e;let t=null;const n=this.getMaterialNodeClass(e.type);if(null!==n){t=new n;for(const n in e)t[n]=e[n]}return t}addToneMapping(e,t){this.addType(e,t,this.toneMappingNodes)}getToneMappingFunction(e){return this.toneMappingNodes.get(e)||null}getMaterialNodeClass(e){return this.materialNodes.get(e)||null}addMaterial(e,t){this.addType(e,t,this.materialNodes)}getLightNodeClass(e){return this.lightNodes.get(e)||null}addLight(e,t){this.addClass(e,t,this.lightNodes)}addType(e,t,n){if(n.has(t))console.warn(`Redefinition of node ${t}`);else{if("function"!=typeof e)throw new Error(`Node class ${e.name} is not a class.`);if("function"==typeof t||"object"==typeof t)throw new Error(`Base class ${t} is not a class.`);n.set(t,e)}}addClass(e,t,n){if(n.has(t))console.warn(`Redefinition of node ${t.name}`);else{if("function"!=typeof e)throw new Error(`Node class ${e.name} is not a class.`);if("function"!=typeof t)throw new Error(`Base class ${t.name} is not a class.`);n.set(t,e)}}}const lU=new AL;class uU extends qP{constructor(){super()}createNode(e=[]){return(new AL).setLights(e)}getNode(e,t){if(e.isQuadMesh)return lU;const n=[e,t];let r=this.get(n);return void 0===r&&(r=this.createNode(),this.set(n,r)),r}}const cU=new Ei,AU=new Lt,hU=new en,dU=new qi,pU=new On,fU=new en;class mU{constructor(e,t={}){this.isRenderer=!0;const{logarithmicDepthBuffer:n=!1,alpha:r=!0,depth:i=!0,stencil:s=!1,antialias:a=!1,samples:o=0,getFallback:l=null}=t;this.domElement=e.getDomElement(),this.backend=e,this.samples=o||!0===a?4:0,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.alpha=r,this.logarithmicDepthBuffer=n,this.outputColorSpace=rt,this.toneMapping=0,this.toneMappingExposure=1,this.sortObjects=!0,this.depth=i,this.stencil=s,this.info=new tD,this.nodes={modelViewMatrix:null,modelNormalViewMatrix:null},this.library=new oU,this.lighting=new uU,this._getFallback=l,this._pixelRatio=1,this._width=this.domElement.width,this._height=this.domElement.height,this._viewport=new en(0,0,this._width,this._height),this._scissor=new en(0,0,this._width,this._height),this._scissorTest=!1,this._attributes=null,this._geometries=null,this._nodes=null,this._animation=null,this._bindings=null,this._objects=null,this._pipelines=null,this._bundles=null,this._renderLists=null,this._renderContexts=null,this._textures=null,this._background=null,this._quad=new CD(new TR),this._quad.material.type="Renderer_output",this._currentRenderContext=null,this._opaqueSort=null,this._transparentSort=null,this._frameBufferTarget=null;const u=!0===this.alpha?0:1;this._clearColor=new yD(0,0,0,u),this._clearDepth=1,this._clearStencil=0,this._renderTarget=null,this._activeCubeFace=0,this._activeMipmapLevel=0,this._mrt=null,this._renderObjectFunction=null,this._currentRenderObjectFunction=null,this._currentRenderBundle=null,this._handleObjectFunction=this._renderObjectDirect,this._isDeviceLost=!1,this.onDeviceLost=this._onDeviceLost,this._initialized=!1,this._initPromise=null,this._compilationPromises=null,this.transparent=!0,this.opaque=!0,this.shadowMap={enabled:!1,type:1},this.xr={enabled:!1},this.debug={checkShaderErrors:!0,onShaderError:null,getShaderAsync:async(e,t,n)=>{await this.compileAsync(e,t);const r=this._renderLists.get(e,t),i=this._renderContexts.get(e,t,this._renderTarget),s=e.overrideMaterial||n.material,a=this._objects.get(n,s,e,t,r.lightsNode,i,i.clippingContext),{fragmentShader:o,vertexShader:l}=a.getNodeBuilderState();return{fragmentShader:o,vertexShader:l}}}}async init(){if(this._initialized)throw new Error("Renderer: Backend has already been initialized.");return null!==this._initPromise||(this._initPromise=new Promise((async(e,t)=>{let n=this.backend;try{await n.init(this)}catch(e){if(null===this._getFallback)return void t(e);try{this.backend=n=this._getFallback(e),await n.init(this)}catch(e){return void t(e)}}this._nodes=new nU(this,n),this._animation=new kP(this._nodes,this.info),this._attributes=new KP(n),this._background=new qL(this,this._nodes),this._geometries=new eD(this._attributes,this.info),this._textures=new _D(this,n,this.info),this._pipelines=new oD(n,this._nodes),this._bindings=new lD(n,this._nodes,this._textures,this._attributes,this._pipelines,this.info),this._objects=new HP(this,this._nodes,this._geometries,this._pipelines,this._bindings,this.info),this._renderLists=new dD(this.lighting),this._bundles=new aU,this._renderContexts=new gD,this._animation.start(),this._initialized=!0,e()}))),this._initPromise}get coordinateSystem(){return this.backend.coordinateSystem}async compileAsync(e,t,n=null){if(!0===this._isDeviceLost)return;!1===this._initialized&&await this.init();const r=this._nodes.nodeFrame,i=r.renderId,s=this._currentRenderContext,a=this._currentRenderObjectFunction,o=this._compilationPromises,l=!0===e.isScene?e:cU;null===n&&(n=e);const u=this._renderTarget,c=this._renderContexts.get(n,t,u),A=this._activeMipmapLevel,h=[];this._currentRenderContext=c,this._currentRenderObjectFunction=this.renderObject,this._handleObjectFunction=this._createObjectPipeline,this._compilationPromises=h,r.renderId++,r.update(),c.depth=this.depth,c.stencil=this.stencil,c.clippingContext||(c.clippingContext=new iU),c.clippingContext.updateGlobal(l,t),l.onBeforeRender(this,e,t,u);const d=this._renderLists.get(e,t);if(d.begin(),this._projectObject(e,t,0,d,c.clippingContext),n!==e&&n.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&d.pushLight(e)})),d.finish(),null!==u){this._textures.updateRenderTarget(u,A);const e=this._textures.get(u);c.textures=e.textures,c.depthTexture=e.depthTexture}else c.textures=null,c.depthTexture=null;this._nodes.updateScene(l),this._background.update(l,d,c);const p=d.opaque,f=d.transparent,m=d.transparentDoublePass,g=d.lightsNode;!0===this.opaque&&p.length>0&&this._renderObjects(p,t,l,g),!0===this.transparent&&f.length>0&&this._renderTransparents(f,m,t,l,g),r.renderId=i,this._currentRenderContext=s,this._currentRenderObjectFunction=a,this._compilationPromises=o,this._handleObjectFunction=this._renderObjectDirect,await Promise.all(h)}async renderAsync(e,t){!1===this._initialized&&await this.init();const n=this._renderScene(e,t);await this.backend.resolveTimestampAsync(n,"render")}async waitForGPU(){await this.backend.waitForGPU()}setMRT(e){return this._mrt=e,this}getMRT(){return this._mrt}_onDeviceLost(e){let t=`THREE.WebGPURenderer: ${e.api} Device Lost:\n\nMessage: ${e.message}`;e.reason&&(t+=`\nReason: ${e.reason}`),console.error(t),this._isDeviceLost=!0}_renderBundle(e,t,n){const{bundleGroup:r,camera:i,renderList:s}=e,a=this._currentRenderContext,o=this._bundles.get(r,i),l=this.backend.get(o);void 0===l.renderContexts&&(l.renderContexts=new Set);const u=r.version!==l.version,c=!1===l.renderContexts.has(a)||u;if(l.renderContexts.add(a),c){this.backend.beginBundle(a),(void 0===l.renderObjects||u)&&(l.renderObjects=[]),this._currentRenderBundle=o;const e=s.opaque;!0===this.opaque&&e.length>0&&this._renderObjects(e,i,t,n),this._currentRenderBundle=null,this.backend.finishBundle(a,o),l.version=r.version}else{const{renderObjects:e}=l;for(let t=0,n=e.length;t<n;t++){const n=e[t];this._nodes.needsRefresh(n)&&(this._nodes.updateBefore(n),this._nodes.updateForRender(n),this._bindings.updateForRender(n),this._nodes.updateAfter(n))}}this.backend.addBundle(a,o)}render(e,t){if(!1===this._initialized)return console.warn("THREE.Renderer: .render() called before the backend is initialized. Try using .renderAsync() instead."),this.renderAsync(e,t);this._renderScene(e,t)}_getFrameBufferTarget(){const{currentToneMapping:e,currentColorSpace:t}=this;if(!1===(0!==e)&&!1===(t!==it))return null;const{width:n,height:r}=this.getDrawingBufferSize(AU),{depth:i,stencil:s}=this;let a=this._frameBufferTarget;return null===a&&(a=new tn(n,r,{depthBuffer:i,stencilBuffer:s,type:oe,format:pe,colorSpace:it,generateMipmaps:!1,minFilter:K,magFilter:K,samples:this.samples}),a.isPostProcessingRenderTarget=!0,this._frameBufferTarget=a),a.depthBuffer=i,a.stencilBuffer=s,a.setSize(n,r),a.viewport.copy(this._viewport),a.scissor.copy(this._scissor),a.viewport.multiplyScalar(this._pixelRatio),a.scissor.multiplyScalar(this._pixelRatio),a.scissorTest=this._scissorTest,a}_renderScene(e,t,n=!0){if(!0===this._isDeviceLost)return;const r=n?this._getFrameBufferTarget():null,i=this._nodes.nodeFrame,s=i.renderId,a=this._currentRenderContext,o=this._currentRenderObjectFunction,l=!0===e.isScene?e:cU,u=this._renderTarget,c=this._activeCubeFace,A=this._activeMipmapLevel;let h;null!==r?(h=r,this.setRenderTarget(h)):h=u;const d=this._renderContexts.get(e,t,h);this._currentRenderContext=d,this._currentRenderObjectFunction=this._renderObjectFunction||this.renderObject,this.info.calls++,this.info.render.calls++,this.info.render.frameCalls++,i.renderId=this.info.calls;const p=this.coordinateSystem;t.coordinateSystem!==p&&(t.coordinateSystem=p,t.updateProjectionMatrix()),!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld();let f=this._viewport,m=this._scissor,g=this._pixelRatio;null!==h&&(f=h.viewport,m=h.scissor,g=1),this.getDrawingBufferSize(AU),hU.set(0,0,AU.width,AU.height);const v=void 0===f.minDepth?0:f.minDepth,_=void 0===f.maxDepth?1:f.maxDepth;d.viewportValue.copy(f).multiplyScalar(g).floor(),d.viewportValue.width>>=A,d.viewportValue.height>>=A,d.viewportValue.minDepth=v,d.viewportValue.maxDepth=_,d.viewport=!1===d.viewportValue.equals(hU),d.scissorValue.copy(m).multiplyScalar(g).floor(),d.scissor=this._scissorTest&&!1===d.scissorValue.equals(hU),d.scissorValue.width>>=A,d.scissorValue.height>>=A,d.clippingContext||(d.clippingContext=new iU),d.clippingContext.updateGlobal(l,t),l.onBeforeRender(this,e,t,h),pU.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),dU.setFromProjectionMatrix(pU,p);const y=this._renderLists.get(e,t);if(y.begin(),this._projectObject(e,t,0,y,d.clippingContext),y.finish(),!0===this.sortObjects&&y.sort(this._opaqueSort,this._transparentSort),null!==h){this._textures.updateRenderTarget(h,A);const e=this._textures.get(h);d.textures=e.textures,d.depthTexture=e.depthTexture,d.width=e.width,d.height=e.height,d.renderTarget=h,d.depth=h.depthBuffer,d.stencil=h.stencilBuffer}else d.textures=null,d.depthTexture=null,d.width=this.domElement.width,d.height=this.domElement.height,d.depth=this.depth,d.stencil=this.stencil;d.width>>=A,d.height>>=A,d.activeCubeFace=c,d.activeMipmapLevel=A,d.occlusionQueryCount=y.occlusionQueryCount,this._nodes.updateScene(l),this._background.update(l,y,d),this.backend.beginRender(d);const{bundles:x,lightsNode:b,transparentDoublePass:S,transparent:T,opaque:w}=y;if(x.length>0&&this._renderBundles(x,l,b),!0===this.opaque&&w.length>0&&this._renderObjects(w,t,l,b),!0===this.transparent&&T.length>0&&this._renderTransparents(T,S,t,l,b),this.backend.finishRender(d),i.renderId=s,this._currentRenderContext=a,this._currentRenderObjectFunction=o,null!==r){this.setRenderTarget(u,c,A);const e=this._quad;this._nodes.hasOutputChange(h.texture)&&(e.material.fragmentNode=this._nodes.getOutputNode(h.texture),e.material.needsUpdate=!0),this._renderScene(e,e.camera,!1)}return l.onAfterRender(this,e,t,h),d}getMaxAnisotropy(){return this.backend.getMaxAnisotropy()}getActiveCubeFace(){return this._activeCubeFace}getActiveMipmapLevel(){return this._activeMipmapLevel}async setAnimationLoop(e){!1===this._initialized&&await this.init(),this._animation.setAnimationLoop(e)}async getArrayBufferAsync(e){return await this.backend.getArrayBufferAsync(e)}getContext(){return this.backend.getContext()}getPixelRatio(){return this._pixelRatio}getDrawingBufferSize(e){return e.set(this._width*this._pixelRatio,this._height*this._pixelRatio).floor()}getSize(e){return e.set(this._width,this._height)}setPixelRatio(e=1){this._pixelRatio!==e&&(this._pixelRatio=e,this.setSize(this._width,this._height,!1))}setDrawingBufferSize(e,t,n){this._width=e,this._height=t,this._pixelRatio=n,this.domElement.width=Math.floor(e*n),this.domElement.height=Math.floor(t*n),this.setViewport(0,0,e,t),this._initialized&&this.backend.updateSize()}setSize(e,t,n=!0){this._width=e,this._height=t,this.domElement.width=Math.floor(e*this._pixelRatio),this.domElement.height=Math.floor(t*this._pixelRatio),!0===n&&(this.domElement.style.width=e+"px",this.domElement.style.height=t+"px"),this.setViewport(0,0,e,t),this._initialized&&this.backend.updateSize()}setOpaqueSort(e){this._opaqueSort=e}setTransparentSort(e){this._transparentSort=e}getScissor(e){const t=this._scissor;return e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e}setScissor(e,t,n,r){const i=this._scissor;e.isVector4?i.copy(e):i.set(e,t,n,r)}getScissorTest(){return this._scissorTest}setScissorTest(e){this._scissorTest=e,this.backend.setScissorTest(e)}getViewport(e){return e.copy(this._viewport)}setViewport(e,t,n,r,i=0,s=1){const a=this._viewport;e.isVector4?a.copy(e):a.set(e,t,n,r),a.minDepth=i,a.maxDepth=s}getClearColor(e){return e.copy(this._clearColor)}setClearColor(e,t=1){this._clearColor.set(e),this._clearColor.a=t}getClearAlpha(){return this._clearColor.a}setClearAlpha(e){this._clearColor.a=e}getClearDepth(){return this._clearDepth}setClearDepth(e){this._clearDepth=e}getClearStencil(){return this._clearStencil}setClearStencil(e){this._clearStencil=e}isOccluded(e){const t=this._currentRenderContext;return t&&this.backend.isOccluded(t,e)}clear(e=!0,t=!0,n=!0){if(!1===this._initialized)return console.warn("THREE.Renderer: .clear() called before the backend is initialized. Try using .clearAsync() instead."),this.clearAsync(e,t,n);const r=this._renderTarget||this._getFrameBufferTarget();let i=null;if(null!==r&&(this._textures.updateRenderTarget(r),i=this._textures.get(r)),this.backend.clear(e,t,n,i),null!==r&&null===this._renderTarget){const e=this._quad;this._nodes.hasOutputChange(r.texture)&&(e.material.fragmentNode=this._nodes.getOutputNode(r.texture),e.material.needsUpdate=!0),this._renderScene(e,e.camera,!1)}}clearColor(){return this.clear(!0,!1,!1)}clearDepth(){return this.clear(!1,!0,!1)}clearStencil(){return this.clear(!1,!1,!0)}async clearAsync(e=!0,t=!0,n=!0){!1===this._initialized&&await this.init(),this.clear(e,t,n)}clearColorAsync(){return this.clearAsync(!0,!1,!1)}clearDepthAsync(){return this.clearAsync(!1,!0,!1)}clearStencilAsync(){return this.clearAsync(!1,!1,!0)}get currentToneMapping(){return null!==this._renderTarget?0:this.toneMapping}get currentColorSpace(){return null!==this._renderTarget?it:this.outputColorSpace}dispose(){this.info.dispose(),this.backend.dispose(),this._animation.dispose(),this._objects.dispose(),this._pipelines.dispose(),this._nodes.dispose(),this._bindings.dispose(),this._renderLists.dispose(),this._renderContexts.dispose(),this._textures.dispose(),this.setRenderTarget(null),this.setAnimationLoop(null)}setRenderTarget(e,t=0,n=0){this._renderTarget=e,this._activeCubeFace=t,this._activeMipmapLevel=n}getRenderTarget(){return this._renderTarget}setRenderObjectFunction(e){this._renderObjectFunction=e}getRenderObjectFunction(){return this._renderObjectFunction}compute(e){if(!0===this.isDeviceLost)return;if(!1===this._initialized)return console.warn("THREE.Renderer: .compute() called before the backend is initialized. Try using .computeAsync() instead."),this.computeAsync(e);const t=this._nodes.nodeFrame,n=t.renderId;this.info.calls++,this.info.compute.calls++,this.info.compute.frameCalls++,t.renderId=this.info.calls;const r=this.backend,i=this._pipelines,s=this._bindings,a=this._nodes,o=Array.isArray(e)?e:[e];if(void 0===o[0]||!0!==o[0].isComputeNode)throw new Error("THREE.Renderer: .compute() expects a ComputeNode.");r.beginCompute(e);for(const t of o){if(!1===i.has(t)){const e=()=>{t.removeEventListener("dispose",e),i.delete(t),s.delete(t),a.delete(t)};t.addEventListener("dispose",e);const n=t.onInitFunction;null!==n&&n.call(t,{renderer:this})}a.updateForCompute(t),s.updateForCompute(t);const n=s.getForCompute(t),o=i.getForCompute(t,n);r.compute(e,t,n,o)}r.finishCompute(e),t.renderId=n}async computeAsync(e){!1===this._initialized&&await this.init(),this.compute(e),await this.backend.resolveTimestampAsync(e,"compute")}async hasFeatureAsync(e){return!1===this._initialized&&await this.init(),this.backend.hasFeature(e)}hasFeature(e){return!1===this._initialized?(console.warn("THREE.Renderer: .hasFeature() called before the backend is initialized. Try using .hasFeatureAsync() instead."),!1):this.backend.hasFeature(e)}hasInitialized(){return this._initialized}async initTextureAsync(e){!1===this._initialized&&await this.init(),this._textures.updateTexture(e)}initTexture(e){if(!1===this._initialized)return console.warn("THREE.Renderer: .initTexture() called before the backend is initialized. Try using .initTextureAsync() instead."),!1;this._textures.updateTexture(e)}copyFramebufferToTexture(e,t=null){if(null!==t)if(t.isVector2)t=fU.set(t.x,t.y,e.image.width,e.image.height).floor();else{if(!t.isVector4)return void console.error("THREE.Renderer.copyFramebufferToTexture: Invalid rectangle.");t=fU.copy(t).floor()}else t=fU.set(0,0,e.image.width,e.image.height);let n,r=this._currentRenderContext;null!==r?n=r.renderTarget:(n=this._renderTarget||this._getFrameBufferTarget(),null!==n&&(this._textures.updateRenderTarget(n),r=this._textures.get(n))),this._textures.updateTexture(e,{renderTarget:n}),this.backend.copyFramebufferToTexture(e,r,t)}copyTextureToTexture(e,t,n=null,r=null,i=0){this._textures.updateTexture(e),this._textures.updateTexture(t),this.backend.copyTextureToTexture(e,t,n,r,i)}readRenderTargetPixelsAsync(e,t,n,r,i,s=0,a=0){return this.backend.copyTextureToBuffer(e.textures[s],t,n,r,i,a)}_projectObject(e,t,n,r,i){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder,e.isClippingGroup&&e.enabled&&(i=i.getGroupContext(e));else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)r.pushLight(e);else if(e.isSprite){if(!e.frustumCulled||dU.intersectsSprite(e)){!0===this.sortObjects&&fU.setFromMatrixPosition(e.matrixWorld).applyMatrix4(pU);const{geometry:t,material:s}=e;s.visible&&r.push(e,t,s,n,fU.z,null,i)}}else if(e.isLineLoop)console.error("THREE.Renderer: Objects of type THREE.LineLoop are not supported. Please use THREE.Line or THREE.LineSegments.");else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||dU.intersectsObject(e))){const{geometry:t,material:s}=e;if(!0===this.sortObjects&&(null===t.boundingSphere&&t.computeBoundingSphere(),fU.copy(t.boundingSphere.center).applyMatrix4(e.matrixWorld).applyMatrix4(pU)),Array.isArray(s)){const a=t.groups;for(let o=0,l=a.length;o<l;o++){const l=a[o],u=s[l.materialIndex];u&&u.visible&&r.push(e,t,u,n,fU.z,l,i)}}else s.visible&&r.push(e,t,s,n,fU.z,null,i)}if(!0===e.isBundleGroup&&void 0!==this.backend.beginBundle){const n=r;(r=this._renderLists.get(e,t)).begin(),n.pushBundle({bundleGroup:e,camera:t,renderList:r}),r.finish()}const s=e.children;for(let e=0,a=s.length;e<a;e++)this._projectObject(s[e],t,n,r,i)}_renderBundles(e,t,n){for(const r of e)this._renderBundle(r,t,n)}_renderTransparents(e,t,n,r,i){if(t.length>0){for(const{material:e}of t)e.side=1;this._renderObjects(t,n,r,i,"backSide");for(const{material:e}of t)e.side=0;this._renderObjects(e,n,r,i);for(const{material:e}of t)e.side=2}else this._renderObjects(e,n,r,i)}_renderObjects(e,t,n,r,i=null){for(let s=0,a=e.length;s<a;s++){const a=e[s],{object:o,geometry:l,material:u,group:c,clippingContext:A}=a;if(t.isArrayCamera){const e=t.cameras;for(let t=0,s=e.length;t<s;t++){const s=e[t];if(o.layers.test(s.layers)){const e=s.viewport,t=void 0===e.minDepth?0:e.minDepth,a=void 0===e.maxDepth?1:e.maxDepth,h=this._currentRenderContext.viewportValue;h.copy(e).multiplyScalar(this._pixelRatio).floor(),h.minDepth=t,h.maxDepth=a,this.backend.updateViewport(this._currentRenderContext),this._currentRenderObjectFunction(o,n,s,l,u,c,r,A,i)}}}else this._currentRenderObjectFunction(o,n,t,l,u,c,r,A,i)}}renderObject(e,t,n,r,i,s,a,o=null,l=null){let u,c,A;if(e.onBeforeRender(this,t,n,r,i,s),null!==t.overrideMaterial){const e=t.overrideMaterial;i.positionNode&&i.positionNode.isNode&&(u=e.positionNode,e.positionNode=i.positionNode),e.alphaTest=i.alphaTest,e.alphaMap=i.alphaMap,e.isShadowNodeMaterial&&(e.side=null===i.shadowSide?i.side:i.shadowSide,i.depthNode&&i.depthNode.isNode&&(A=e.depthNode,e.depthNode=i.depthNode),i.castShadowNode&&i.castShadowNode.isNode&&(c=e.colorNode,e.colorNode=i.castShadowNode)),i=e}!0===i.transparent&&2===i.side&&!1===i.forceSinglePass?(i.side=1,this._handleObjectFunction(e,i,t,n,a,s,o,"backSide"),i.side=0,this._handleObjectFunction(e,i,t,n,a,s,o,l),i.side=2):this._handleObjectFunction(e,i,t,n,a,s,o,l),void 0!==u&&(t.overrideMaterial.positionNode=u),void 0!==A&&(t.overrideMaterial.depthNode=A),void 0!==c&&(t.overrideMaterial.colorNode=c),e.onAfterRender(this,t,n,r,i,s)}_renderObjectDirect(e,t,n,r,i,s,a,o){const l=this._objects.get(e,t,n,r,i,this._currentRenderContext,a,o);l.drawRange=e.geometry.drawRange,l.group=s;const u=this._nodes.needsRefresh(l);if(u&&(this._nodes.updateBefore(l),this._geometries.updateForRender(l),this._nodes.updateForRender(l),this._bindings.updateForRender(l)),this._pipelines.updateForRender(l),null!==this._currentRenderBundle){this.backend.get(this._currentRenderBundle).renderObjects.push(l),l.bundle=this._currentRenderBundle.scene}this.backend.draw(l,this.info),u&&this._nodes.updateAfter(l)}_createObjectPipeline(e,t,n,r,i,s,a){const o=this._objects.get(e,t,n,r,i,this._currentRenderContext,s,a);this._nodes.updateBefore(o),this._geometries.updateForRender(o),this._nodes.updateForRender(o),this._bindings.updateForRender(o),this._pipelines.getForRender(o,this._compilationPromises),this._nodes.updateAfter(o)}get compile(){return this.compileAsync}}class gU{constructor(e=""){this.name=e,this.visibility=0}setVisibility(e){this.visibility|=e}clone(){return Object.assign(new this.constructor,this)}}let vU=class extends gU{constructor(e,t=null){super(e),this.isBuffer=!0,this.bytesPerElement=Float32Array.BYTES_PER_ELEMENT,this._buffer=t}get byteLength(){return(e=this._buffer.byteLength)+($P-e%$P)%$P;var e}get buffer(){return this._buffer}update(){return!0}};class _U extends vU{constructor(e,t=null){super(e,t),this.isUniformBuffer=!0}}let yU=0;class xU extends _U{constructor(e,t){super("UniformBuffer_"+yU++,e?e.value:null),this.nodeUniform=e,this.groupNode=t}get buffer(){return this.nodeUniform.value}}class bU extends _U{constructor(e){super(e),this.isUniformsGroup=!0,this._values=null,this.uniforms=[]}addUniform(e){return this.uniforms.push(e),this}removeUniform(e){const t=this.uniforms.indexOf(e);return-1!==t&&this.uniforms.splice(t,1),this}get values(){return null===this._values&&(this._values=Array.from(this.buffer)),this._values}get buffer(){let e=this._buffer;if(null===e){const t=this.byteLength;e=new Float32Array(new ArrayBuffer(t)),this._buffer=e}return e}get byteLength(){let e=0;for(let t=0,n=this.uniforms.length;t<n;t++){const n=this.uniforms[t],{boundary:r,itemSize:i}=n,s=e%$P;0!==s&&$P-s-r<0?e+=$P-s:s%r!=0&&(e+=s%r),n.offset=e/this.bytesPerElement,e+=i*this.bytesPerElement}return Math.ceil(e/$P)*$P}update(){let e=!1;for(const t of this.uniforms)!0===this.updateByType(t)&&(e=!0);return e}updateByType(e){return e.isNumberUniform?this.updateNumber(e):e.isVector2Uniform?this.updateVector2(e):e.isVector3Uniform?this.updateVector3(e):e.isVector4Uniform?this.updateVector4(e):e.isColorUniform?this.updateColor(e):e.isMatrix3Uniform?this.updateMatrix3(e):e.isMatrix4Uniform?this.updateMatrix4(e):void console.error("THREE.WebGPUUniformsGroup: Unsupported uniform type.",e)}updateNumber(e){let t=!1;const n=this.values,r=e.getValue(),i=e.offset,s=e.getType();if(n[i]!==r){this._getBufferForType(s)[i]=n[i]=r,t=!0}return t}updateVector2(e){let t=!1;const n=this.values,r=e.getValue(),i=e.offset,s=e.getType();if(n[i+0]!==r.x||n[i+1]!==r.y){const e=this._getBufferForType(s);e[i+0]=n[i+0]=r.x,e[i+1]=n[i+1]=r.y,t=!0}return t}updateVector3(e){let t=!1;const n=this.values,r=e.getValue(),i=e.offset,s=e.getType();if(n[i+0]!==r.x||n[i+1]!==r.y||n[i+2]!==r.z){const e=this._getBufferForType(s);e[i+0]=n[i+0]=r.x,e[i+1]=n[i+1]=r.y,e[i+2]=n[i+2]=r.z,t=!0}return t}updateVector4(e){let t=!1;const n=this.values,r=e.getValue(),i=e.offset,s=e.getType();if(n[i+0]!==r.x||n[i+1]!==r.y||n[i+2]!==r.z||n[i+4]!==r.w){const e=this._getBufferForType(s);e[i+0]=n[i+0]=r.x,e[i+1]=n[i+1]=r.y,e[i+2]=n[i+2]=r.z,e[i+3]=n[i+3]=r.w,t=!0}return t}updateColor(e){let t=!1;const n=this.values,r=e.getValue(),i=e.offset;if(n[i+0]!==r.r||n[i+1]!==r.g||n[i+2]!==r.b){const e=this.buffer;e[i+0]=n[i+0]=r.r,e[i+1]=n[i+1]=r.g,e[i+2]=n[i+2]=r.b,t=!0}return t}updateMatrix3(e){let t=!1;const n=this.values,r=e.getValue().elements,i=e.offset;if(n[i+0]!==r[0]||n[i+1]!==r[1]||n[i+2]!==r[2]||n[i+4]!==r[3]||n[i+5]!==r[4]||n[i+6]!==r[5]||n[i+8]!==r[6]||n[i+9]!==r[7]||n[i+10]!==r[8]){const e=this.buffer;e[i+0]=n[i+0]=r[0],e[i+1]=n[i+1]=r[1],e[i+2]=n[i+2]=r[2],e[i+4]=n[i+4]=r[3],e[i+5]=n[i+5]=r[4],e[i+6]=n[i+6]=r[5],e[i+8]=n[i+8]=r[6],e[i+9]=n[i+9]=r[7],e[i+10]=n[i+10]=r[8],t=!0}return t}updateMatrix4(e){let t=!1;const n=this.values,r=e.getValue().elements,i=e.offset;if(!1===function(e,t,n){for(let r=0,i=t.length;r<i;r++)if(e[n+r]!==t[r])return!1;return!0}(n,r,i)){this.buffer.set(r,i),function(e,t,n){for(let r=0,i=t.length;r<i;r++)e[n+r]=t[r]}(n,r,i),t=!0}return t}_getBufferForType(e){return"int"===e||"ivec2"===e||"ivec3"===e||"ivec4"===e?new Int32Array(this.buffer.buffer):"uint"===e||"uvec2"===e||"uvec3"===e||"uvec4"===e?new Uint32Array(this.buffer.buffer):this.buffer}}let SU=0;class TU extends bU{constructor(e,t){super(e),this.id=SU++,this.groupNode=t,this.isNodeUniformsGroup=!0}getNodes(){const e=[];for(const t of this.uniforms){const n=t.nodeUniform.node;if(!n)throw new Error("NodeUniformsGroup: Uniform has no node.");e.push(n)}return e}}let wU=0;class MU extends gU{constructor(e,t){super(e),this.id=wU++,this.texture=t,this.version=t?t.version:0,this.store=!1,this.generation=null,this.isSampledTexture=!0}needsBindingsUpdate(e){const{texture:t}=this;return e!==this.generation?(this.generation=e,!0):t.isVideoTexture}update(){const{texture:e,version:t}=this;return t!==e.version&&(this.version=e.version,!0)}}class EU extends MU{constructor(e,t,n,r=null){super(e,t?t.value:null),this.textureNode=t,this.groupNode=n,this.access=r}needsBindingsUpdate(e){return this.textureNode.value!==this.texture||super.needsBindingsUpdate(e)}update(){const{textureNode:e}=this;return this.texture!==e.value?(this.texture=e.value,!0):super.update()}}class CU extends EU{constructor(e,t,n,r){super(e,t,n,r),this.isSampledCubeTexture=!0}}class RU extends EU{constructor(e,t,n,r){super(e,t,n,r),this.isSampledTexture3D=!0}}const NU={atan2:"atan",textureDimensions:"textureSize",equals:"equal"},PU={low:"lowp",medium:"mediump",high:"highp"},DU={swizzleAssign:!0,storageBuffer:!1},LU="\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\nprecision highp sampler3D;\nprecision highp samplerCube;\nprecision highp sampler2DArray;\n\nprecision highp usampler2D;\nprecision highp usampler3D;\nprecision highp usamplerCube;\nprecision highp usampler2DArray;\n\nprecision highp isampler2D;\nprecision highp isampler3D;\nprecision highp isamplerCube;\nprecision highp isampler2DArray;\n\nprecision lowp sampler2DShadow;\n";class IU extends UI{constructor(e,t){super(e,t,new eU),this.uniformGroups={},this.transforms=[],this.extensions={},this.builtins={vertex:[],fragment:[],compute:[]},this.useComparisonMethod=!0}needsToWorkingColorSpace(e){return!0===e.isVideoTexture&&e.colorSpace!==nt}getMethod(e){return NU[e]||e}getOutputStructName(){return""}buildFunctionCode(e){const t=e.layout,n=this.flowShaderNode(e),r=[];for(const e of t.inputs)r.push(this.getType(e.type)+" "+e.name);return`${this.getType(t.type)} ${t.name}( ${r.join(", ")} ) {\n\n\t${n.vars}\n\n${n.code}\n\treturn ${n.result};\n\n}`}setupPBO(e){const t=e.value;if(void 0===t.pbo){const e=t.array,n=t.count*t.itemSize,{itemSize:r}=t,i=t.array.constructor.name.toLowerCase().includes("int");let s=i?ye:_e;2===r?s=i?be:xe:3===r?s=i?1032:de:4===r&&(s=i?Se:pe);const a={Float32Array:ae,Uint8Array:ee,Uint16Array:re,Uint32Array:se,Int8Array:te,Int16Array:ne,Int32Array:ie,Uint8ClampedArray:ee},o=Math.pow(2,Math.ceil(Math.log2(Math.sqrt(n/r))));let l=Math.ceil(n/r/o);o*l*r<n&&l++;const u=o*l*r,c=new e.constructor(u);c.set(e,0),t.array=c;const A=new Di(t.array,o,l,s,a[t.array.constructor.name]||ae);A.needsUpdate=!0,A.isPBOTexture=!0;const h=new IM(A,null,null);h.setPrecision("high"),t.pboNode=h,t.pbo=h.value,this.getUniformFromNode(t.pboNode,"texture",this.shaderStage,this.context.label)}}getPropertyName(e,t=this.shaderStage){return e.isNodeUniform&&!0!==e.node.isTextureNode&&!0!==e.node.isBufferNode?t.charAt(0)+"_"+e.name:super.getPropertyName(e,t)}generatePBO(e){const{node:t,indexNode:n}=e,r=t.value;if(this.renderer.backend.has(r)){this.renderer.backend.get(r).pbo=r.pbo}const i=this.getUniformFromNode(r.pboNode,"texture",this.shaderStage,this.context.label),s=this.getPropertyName(i);this.increaseUsage(n);const a=n.build(this,"uint"),o=this.getDataFromNode(e);let l=o.propertyName;if(void 0===l){const n=this.getVarFromNode(e);l=this.getPropertyName(n);const i=this.getDataFromNode(t);let u=i.propertySizeName;void 0===u&&(u=l+"Size",this.getVarFromNode(t,u,"uint"),this.addLineFlowCode(`${u} = uint( textureSize( ${s}, 0 ).x )`,e),i.propertySizeName=u);const{itemSize:c}=r,A="."+xb.join("").slice(0,c),h=`ivec2(${a} % ${u}, ${a} / ${u})`,d=this.generateTextureLoad(null,s,h,null,"0");let p="vec4";r.pbo.type===se?p="uvec4":r.pbo.type===ie&&(p="ivec4"),this.addLineFlowCode(`${l} = ${p}(${d})${A}`,e),o.propertyName=l}return l}generateTextureLoad(e,t,n,r,i="0"){return r?`texelFetch( ${t}, ivec3( ${n}, ${r} ), ${i} )`:`texelFetch( ${t}, ${n}, ${i} )`}generateTexture(e,t,n,r){return e.isDepthTexture?`texture( ${t}, ${n} ).x`:(r&&(n=`vec3( ${n}, ${r} )`),`texture( ${t}, ${n} )`)}generateTextureLevel(e,t,n,r){return`textureLod( ${t}, ${n}, ${r} )`}generateTextureBias(e,t,n,r){return`texture( ${t}, ${n}, ${r} )`}generateTextureGrad(e,t,n,r){return`textureGrad( ${t}, ${n}, ${r[0]}, ${r[1]} )`}generateTextureCompare(e,t,n,r,i,s=this.shaderStage){if("fragment"===s)return`texture( ${t}, vec3( ${n}, ${r} ) )`;console.error(`WebGPURenderer: THREE.DepthTexture.compareFunction() does not support ${s} shader.`)}getVars(e){const t=[],n=this.vars[e];if(void 0!==n)for(const e of n)t.push(`${this.getVar(e.type,e.name)};`);return t.join("\n\t")}getUniforms(e){const t=this.uniforms[e],n=[],r={};for(const i of t){let t=null,s=!1;if("texture"===i.type){const e=i.node.value;let n="";!0===e.isDataTexture&&(e.type===se?n="u":e.type===ie&&(n="i")),t=e.compareFunction?`sampler2DShadow ${i.name};`:!0===e.isDataArrayTexture||!0===e.isCompressedArrayTexture?`${n}sampler2DArray ${i.name};`:`${n}sampler2D ${i.name};`}else if("cubeTexture"===i.type)t=`samplerCube ${i.name};`;else if("texture3D"===i.type)t=`sampler3D ${i.name};`;else if("buffer"===i.type){const e=i.node,n=this.getType(e.bufferType),r=e.bufferCount,s=r>0?r:"";t=`${e.name} {\n\t${n} ${i.name}[${s}];\n};\n`}else{t=`${this.getVectorType(i.type)} ${this.getPropertyName(i,e)};`,s=!0}const a=i.node.precision;if(null!==a&&(t=PU[a]+" "+t),s){t="\t"+t;const e=i.groupNode.name;(r[e]||(r[e]=[])).push(t)}else t="uniform "+t,n.push(t)}let i="";for(const t in r){const n=r[t];i+=this._getGLSLUniformStruct(e+"_"+t,n.join("\n"))+"\n"}return i+=n.join("\n"),i}getTypeFromAttribute(e){let t=super.getTypeFromAttribute(e);if(/^[iu]/.test(t)&&e.gpuType!==ie){let n=e;e.isInterleavedBufferAttribute&&(n=e.data);const r=n.array;!1==(r instanceof Uint32Array||r instanceof Int32Array)&&(t=t.slice(1))}return t}getAttributes(e){let t="";if("vertex"===e||"compute"===e){const e=this.getAttributesArray();let n=0;for(const r of e)t+=`layout( location = ${n++} ) in ${r.type} ${r.name};\n`}return t}getStructMembers(e){const t=[],n=e.getMemberTypes();for(let e=0;e<n.length;e++){const r=n[e];t.push(`layout( location = ${e} ) out ${r} m${e};`)}return t.join("\n")}getStructs(e){const t=[],n=this.structs[e];if(0===n.length)return"layout( location = 0 ) out vec4 fragColor;\n";for(let e=0,r=n.length;e<r;e++){const r=n[e];let i="\n";i+=this.getStructMembers(r),i+="\n",t.push(i)}return t.join("\n\n")}getVaryings(e){let t="";const n=this.varyings;if("vertex"===e||"compute"===e)for(const r of n){"compute"===e&&(r.needsInterpolation=!0);const n=this.getType(r.type);t+=`${n.includes("int")||n.includes("uv")||n.includes("iv")?"flat ":""}${r.needsInterpolation?"out":"/*out*/"} ${n} ${r.name};\n`}else if("fragment"===e)for(const e of n)if(e.needsInterpolation){const n=this.getType(e.type);t+=`${n.includes("int")||n.includes("uv")||n.includes("iv")?"flat ":""}in ${n} ${e.name};\n`}for(const n of this.builtins[e])t+=`${n};\n`;return t}getVertexIndex(){return"uint( gl_VertexID )"}getInstanceIndex(){return"uint( gl_InstanceID )"}getInvocationLocalIndex(){return`uint( gl_InstanceID ) % ${this.object.workgroupSize.reduce(((e,t)=>e*t),1)}u`}getDrawIndex(){return this.renderer.backend.extensions.has("WEBGL_multi_draw")?"uint( gl_DrawID )":null}getFrontFacing(){return"gl_FrontFacing"}getFragCoord(){return"gl_FragCoord.xy"}getFragDepth(){return"gl_FragDepth"}enableExtension(e,t,n=this.shaderStage){const r=this.extensions[n]||(this.extensions[n]=new Map);!1===r.has(e)&&r.set(e,{name:e,behavior:t})}getExtensions(e){const t=[];if("vertex"===e){const t=this.renderer.backend.extensions;this.object.isBatchedMesh&&t.has("WEBGL_multi_draw")&&this.enableExtension("GL_ANGLE_multi_draw","require",e)}const n=this.extensions[e];if(void 0!==n)for(const{name:e,behavior:r}of n.values())t.push(`#extension ${e} : ${r}`);return t.join("\n")}getClipDistance(){return"gl_ClipDistance"}isAvailable(e){let t=DU[e];if(void 0===t){let n;switch(t=!1,e){case"float32Filterable":n="OES_texture_float_linear";break;case"clipDistance":n="WEBGL_clip_cull_distance"}if(void 0!==n){const e=this.renderer.backend.extensions;e.has(n)&&(e.get(n),t=!0)}DU[e]=t}return t}isFlipY(){return!0}enableHardwareClipping(e){this.enableExtension("GL_ANGLE_clip_cull_distance","require"),this.builtins.vertex.push(`out float gl_ClipDistance[ ${e} ]`)}registerTransform(e,t){this.transforms.push({varyingName:e,attributeNode:t})}getTransforms(){const e=this.transforms;let t="";for(let n=0;n<e.length;n++){const r=e[n],i=this.getPropertyName(r.attributeNode);t+=`${r.varyingName} = ${i};\n\t`}return t}_getGLSLUniformStruct(e,t){return`\nlayout( std140 ) uniform ${e} {\n${t}\n};`}_getGLSLVertexCode(e){return`#version 300 es\n\n${this.getSignature()}\n\n// extensions \n${e.extensions}\n\n// precision\n${LU}\n\n// uniforms\n${e.uniforms}\n\n// varyings\n${e.varyings}\n\n// attributes\n${e.attributes}\n\n// codes\n${e.codes}\n\nvoid main() {\n\n\t// vars\n\t${e.vars}\n\n\t// transforms\n\t${e.transforms}\n\n\t// flow\n\t${e.flow}\n\n\tgl_PointSize = 1.0;\n\n}\n`}_getGLSLFragmentCode(e){return`#version 300 es\n\n${this.getSignature()}\n\n// precision\n${LU}\n\n// uniforms\n${e.uniforms}\n\n// varyings\n${e.varyings}\n\n// codes\n${e.codes}\n\n${e.structs}\n\nvoid main() {\n\n\t// vars\n\t${e.vars}\n\n\t// flow\n\t${e.flow}\n\n}\n`}buildCode(){const e=null!==this.material?{fragment:{},vertex:{}}:{compute:{}};this.sortBindingGroups();for(const t in e){let n="// code\n\n";n+=this.flowCode[t];const r=this.flowNodes[t],i=r[r.length-1];for(const e of r){const r=this.getFlowData(e),s=e.name;s&&(n.length>0&&(n+="\n"),n+=`\t// flow -> ${s}\n\t`),n+=`${r.code}\n\t`,e===i&&"compute"!==t&&(n+="// result\n\t","vertex"===t?(n+="gl_Position = ",n+=`${r.result};`):"fragment"===t&&(e.outputNode.isOutputStructNode||(n+="fragColor = ",n+=`${r.result};`)))}const s=e[t];s.extensions=this.getExtensions(t),s.uniforms=this.getUniforms(t),s.attributes=this.getAttributes(t),s.varyings=this.getVaryings(t),s.vars=this.getVars(t),s.structs=this.getStructs(t),s.codes=this.getCodes(t),s.transforms=this.getTransforms(t),s.flow=n}null!==this.material?(this.vertexShader=this._getGLSLVertexCode(e.vertex),this.fragmentShader=this._getGLSLFragmentCode(e.fragment)):this.computeShader=this._getGLSLVertexCode(e.compute)}getUniformFromNode(e,t,n,r=null){const i=super.getUniformFromNode(e,t,n,r),s=this.getDataFromNode(e,n,this.globalCache);let a=s.uniformGPU;if(void 0===a){const r=e.groupNode,o=r.name,l=this.getBindGroupArray(o,n);if("texture"===t)a=new EU(i.name,i.node,r),l.push(a);else if("cubeTexture"===t)a=new CU(i.name,i.node,r),l.push(a);else if("texture3D"===t)a=new RU(i.name,i.node,r),l.push(a);else if("buffer"===t){e.name=`NodeBuffer_${e.id}`,i.name=`buffer${e.id}`;const t=new xU(e,r);t.name=e.name,l.push(t),a=t}else{const e=this.uniformGroups[n]||(this.uniformGroups[n]={});let s=e[o];void 0===s&&(s=new TU(n+"_"+o,r),e[o]=s,l.push(s)),a=this.getNodeUniform(i,t),s.addUniform(a)}s.uniformGPU=a}return i}}let UU=null,BU=null,OU=null;class FU{constructor(e={}){this.parameters=Object.assign({},e),this.data=new WeakMap,this.renderer=null,this.domElement=null}async init(e){this.renderer=e}begin(){}finish(){}draw(){}createProgram(){}destroyProgram(){}createBindings(){}updateBindings(){}createRenderPipeline(){}createComputePipeline(){}destroyPipeline(){}needsRenderUpdate(){}getRenderCacheKey(){}createNodeBuilder(){}createSampler(){}createDefaultTexture(){}createTexture(){}copyTextureToBuffer(){}createAttribute(){}createIndexAttribute(){}updateAttribute(){}destroyAttribute(){}getContext(){}updateSize(){}resolveTimestampAsync(){}hasFeatureAsync(){}hasFeature(){}getInstanceCount(e){const{object:t,geometry:n}=e;return n.isInstancedBufferGeometry?n.instanceCount:t.count>1?t.count:1}getDrawingBufferSize(){return UU=UU||new Lt,this.renderer.getDrawingBufferSize(UU)}getScissor(){return BU=BU||new en,this.renderer.getScissor(BU)}setScissorTest(){}getClearColor(){const e=this.renderer;return OU=OU||new yD,e.getClearColor(OU),OU.getRGB(OU,this.renderer.currentColorSpace),OU}getDomElement(){let e=this.domElement;return null===e&&(e=void 0!==this.parameters.canvas?this.parameters.canvas:Ft(),"setAttribute"in e&&e.setAttribute("data-engine",`three.js r${s} webgpu`),this.domElement=e),e}set(e,t){this.data.set(e,t)}get(e){let t=this.data.get(e);return void 0===t&&(t={},this.data.set(e,t)),t}has(e){return this.data.has(e)}delete(e){this.data.delete(e)}dispose(){}}let kU=0;class qU{constructor(e,t){this.buffers=[e.bufferGPU,t],this.type=e.type,this.bufferType=e.bufferType,this.pbo=e.pbo,this.byteLength=e.byteLength,this.bytesPerElement=e.BYTES_PER_ELEMENT,this.version=e.version,this.isInteger=e.isInteger,this.activeBufferIndex=0,this.baseId=e.id}get id(){return`${this.baseId}|${this.activeBufferIndex}`}get bufferGPU(){return this.buffers[this.activeBufferIndex]}get transformBuffer(){return this.buffers[1^this.activeBufferIndex]}switchBuffers(){this.activeBufferIndex^=1}}class GU{constructor(e){this.backend=e}createAttribute(e,t){const n=this.backend,{gl:r}=n,i=e.array,s=e.usage||r.STATIC_DRAW,a=e.isInterleavedBufferAttribute?e.data:e,o=n.get(a);let l,u=o.bufferGPU;if(void 0===u&&(u=this._createBuffer(r,t,i,s),o.bufferGPU=u,o.bufferType=t,o.version=a.version),i instanceof Float32Array)l=r.FLOAT;else if(i instanceof Uint16Array)l=e.isFloat16BufferAttribute?r.HALF_FLOAT:r.UNSIGNED_SHORT;else if(i instanceof Int16Array)l=r.SHORT;else if(i instanceof Uint32Array)l=r.UNSIGNED_INT;else if(i instanceof Int32Array)l=r.INT;else if(i instanceof Int8Array)l=r.BYTE;else if(i instanceof Uint8Array)l=r.UNSIGNED_BYTE;else{if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLBackend: Unsupported buffer data format: "+i);l=r.UNSIGNED_BYTE}let c={bufferGPU:u,bufferType:t,type:l,byteLength:i.byteLength,bytesPerElement:i.BYTES_PER_ELEMENT,version:e.version,pbo:e.pbo,isInteger:l===r.INT||l===r.UNSIGNED_INT||e.gpuType===ie,id:kU++};if(e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute){const e=this._createBuffer(r,t,i,s);c=new qU(c,e)}n.set(e,c)}updateAttribute(e){const t=this.backend,{gl:n}=t,r=e.array,i=e.isInterleavedBufferAttribute?e.data:e,s=t.get(i),a=s.bufferType,o=e.isInterleavedBufferAttribute?e.data.updateRanges:e.updateRanges;if(n.bindBuffer(a,s.bufferGPU),0===o.length)n.bufferSubData(a,0,r);else{for(let e=0,t=o.length;e<t;e++){const t=o[e];n.bufferSubData(a,t.start*r.BYTES_PER_ELEMENT,r,t.start,t.count)}i.clearUpdateRanges()}n.bindBuffer(a,null),s.version=i.version}destroyAttribute(e){const t=this.backend,{gl:n}=t;e.isInterleavedBufferAttribute&&t.delete(e.data);const r=t.get(e);n.deleteBuffer(r.bufferGPU),t.delete(e)}async getArrayBufferAsync(e){const t=this.backend,{gl:n}=t,r=e.isInterleavedBufferAttribute?e.data:e,{bufferGPU:i}=t.get(r),s=e.array,a=s.byteLength;n.bindBuffer(n.COPY_READ_BUFFER,i);const o=n.createBuffer();n.bindBuffer(n.COPY_WRITE_BUFFER,o),n.bufferData(n.COPY_WRITE_BUFFER,a,n.STREAM_READ),n.copyBufferSubData(n.COPY_READ_BUFFER,n.COPY_WRITE_BUFFER,0,0,a),await t.utils._clientWaitAsync();const l=new e.array.constructor(s.length);return n.bindBuffer(n.COPY_WRITE_BUFFER,o),n.getBufferSubData(n.COPY_WRITE_BUFFER,0,l),n.deleteBuffer(o),n.bindBuffer(n.COPY_READ_BUFFER,null),n.bindBuffer(n.COPY_WRITE_BUFFER,null),l.buffer}_createBuffer(e,t,n,r){const i=e.createBuffer();return e.bindBuffer(t,i),e.bufferData(t,n,r),e.bindBuffer(t,null),i}}let zU,VU,HU=!1;class jU{constructor(e){this.backend=e,this.gl=this.backend.gl,this.enabled={},this.currentFlipSided=null,this.currentCullFace=null,this.currentProgram=null,this.currentBlendingEnabled=!1,this.currentBlending=null,this.currentBlendSrc=null,this.currentBlendDst=null,this.currentBlendSrcAlpha=null,this.currentBlendDstAlpha=null,this.currentPremultipledAlpha=null,this.currentPolygonOffsetFactor=null,this.currentPolygonOffsetUnits=null,this.currentColorMask=null,this.currentDepthFunc=null,this.currentDepthMask=null,this.currentStencilFunc=null,this.currentStencilRef=null,this.currentStencilFuncMask=null,this.currentStencilFail=null,this.currentStencilZFail=null,this.currentStencilZPass=null,this.currentStencilMask=null,this.currentLineWidth=null,this.currentClippingPlanes=0,this.currentBoundFramebuffers={},this.currentDrawbuffers=new WeakMap,this.maxTextures=this.gl.getParameter(this.gl.MAX_TEXTURE_IMAGE_UNITS),this.currentTextureSlot=null,this.currentBoundTextures={},this.currentBoundBufferBases={},!1===HU&&(this._init(this.gl),HU=!0)}_init(e){zU={[p]:e.FUNC_ADD,[f]:e.FUNC_SUBTRACT,[m]:e.FUNC_REVERSE_SUBTRACT},VU={[g]:e.ZERO,[v]:e.ONE,[_]:e.SRC_COLOR,[x]:e.SRC_ALPHA,[E]:e.SRC_ALPHA_SATURATE,[w]:e.DST_COLOR,[S]:e.DST_ALPHA,[y]:e.ONE_MINUS_SRC_COLOR,[b]:e.ONE_MINUS_SRC_ALPHA,[M]:e.ONE_MINUS_DST_COLOR,[T]:e.ONE_MINUS_DST_ALPHA}}enable(e){const{enabled:t}=this;!0!==t[e]&&(this.gl.enable(e),t[e]=!0)}disable(e){const{enabled:t}=this;!1!==t[e]&&(this.gl.disable(e),t[e]=!1)}setFlipSided(e){if(this.currentFlipSided!==e){const{gl:t}=this;e?t.frontFace(t.CW):t.frontFace(t.CCW),this.currentFlipSided=e}}setCullFace(e){const{gl:t}=this;0!==e?(this.enable(t.CULL_FACE),e!==this.currentCullFace&&(1===e?t.cullFace(t.BACK):2===e?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):this.disable(t.CULL_FACE),this.currentCullFace=e}setLineWidth(e){const{currentLineWidth:t,gl:n}=this;e!==t&&(n.lineWidth(e),this.currentLineWidth=e)}setBlending(e,t,n,r,i,s,a,o){const{gl:l}=this;if(0!==e){if(!1===this.currentBlendingEnabled&&(this.enable(l.BLEND),this.currentBlendingEnabled=!0),5===e)i=i||t,s=s||n,a=a||r,t===this.currentBlendEquation&&i===this.currentBlendEquationAlpha||(l.blendEquationSeparate(zU[t],zU[i]),this.currentBlendEquation=t,this.currentBlendEquationAlpha=i),n===this.currentBlendSrc&&r===this.currentBlendDst&&s===this.currentBlendSrcAlpha&&a===this.currentBlendDstAlpha||(l.blendFuncSeparate(VU[n],VU[r],VU[s],VU[a]),this.currentBlendSrc=n,this.currentBlendDst=r,this.currentBlendSrcAlpha=s,this.currentBlendDstAlpha=a),this.currentBlending=e,this.currentPremultipledAlpha=!1;else if(e!==this.currentBlending||o!==this.currentPremultipledAlpha){if(this.currentBlendEquation===p&&this.currentBlendEquationAlpha===p||(l.blendEquation(l.FUNC_ADD),this.currentBlendEquation=p,this.currentBlendEquationAlpha=p),o)switch(e){case 1:l.blendFuncSeparate(l.ONE,l.ONE_MINUS_SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA);break;case 2:l.blendFunc(l.ONE,l.ONE);break;case 3:l.blendFuncSeparate(l.ZERO,l.ONE_MINUS_SRC_COLOR,l.ZERO,l.ONE);break;case 4:l.blendFuncSeparate(l.ZERO,l.SRC_COLOR,l.ZERO,l.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case 1:l.blendFuncSeparate(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA);break;case 2:l.blendFunc(l.SRC_ALPHA,l.ONE);break;case 3:l.blendFuncSeparate(l.ZERO,l.ONE_MINUS_SRC_COLOR,l.ZERO,l.ONE);break;case 4:l.blendFunc(l.ZERO,l.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}this.currentBlendSrc=null,this.currentBlendDst=null,this.currentBlendSrcAlpha=null,this.currentBlendDstAlpha=null,this.currentBlending=e,this.currentPremultipledAlpha=o}}else!0===this.currentBlendingEnabled&&(this.disable(l.BLEND),this.currentBlendingEnabled=!1)}setColorMask(e){this.currentColorMask!==e&&(this.gl.colorMask(e,e,e,e),this.currentColorMask=e)}setDepthTest(e){const{gl:t}=this;e?this.enable(t.DEPTH_TEST):this.disable(t.DEPTH_TEST)}setDepthMask(e){this.currentDepthMask!==e&&(this.gl.depthMask(e),this.currentDepthMask=e)}setDepthFunc(e){if(this.currentDepthFunc!==e){const{gl:t}=this;switch(e){case 0:t.depthFunc(t.NEVER);break;case 1:t.depthFunc(t.ALWAYS);break;case 2:t.depthFunc(t.LESS);break;case 3:default:t.depthFunc(t.LEQUAL);break;case 4:t.depthFunc(t.EQUAL);break;case 5:t.depthFunc(t.GEQUAL);break;case 6:t.depthFunc(t.GREATER);break;case 7:t.depthFunc(t.NOTEQUAL)}this.currentDepthFunc=e}}setStencilTest(e){const{gl:t}=this;e?this.enable(t.STENCIL_TEST):this.disable(t.STENCIL_TEST)}setStencilMask(e){this.currentStencilMask!==e&&(this.gl.stencilMask(e),this.currentStencilMask=e)}setStencilFunc(e,t,n){this.currentStencilFunc===e&&this.currentStencilRef===t&&this.currentStencilFuncMask===n||(this.gl.stencilFunc(e,t,n),this.currentStencilFunc=e,this.currentStencilRef=t,this.currentStencilFuncMask=n)}setStencilOp(e,t,n){this.currentStencilFail===e&&this.currentStencilZFail===t&&this.currentStencilZPass===n||(this.gl.stencilOp(e,t,n),this.currentStencilFail=e,this.currentStencilZFail=t,this.currentStencilZPass=n)}setMaterial(e,t,n){const{gl:r}=this;2===e.side?this.disable(r.CULL_FACE):this.enable(r.CULL_FACE);let i=1===e.side;t&&(i=!i),this.setFlipSided(i),1===e.blending&&!1===e.transparent?this.setBlending(0):this.setBlending(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),this.setDepthFunc(e.depthFunc),this.setDepthTest(e.depthTest),this.setDepthMask(e.depthWrite),this.setColorMask(e.colorWrite);const s=e.stencilWrite;if(this.setStencilTest(s),s&&(this.setStencilMask(e.stencilWriteMask),this.setStencilFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),this.setStencilOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),this.setPolygonOffset(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),!0===e.alphaToCoverage&&this.backend.renderer.samples>1?this.enable(r.SAMPLE_ALPHA_TO_COVERAGE):this.disable(r.SAMPLE_ALPHA_TO_COVERAGE),n>0&&this.currentClippingPlanes!==n){const e=12288;for(let t=0;t<8;t++)t<n?this.enable(e+t):this.disable(e+t)}}setPolygonOffset(e,t,n){const{gl:r}=this;e?(this.enable(r.POLYGON_OFFSET_FILL),this.currentPolygonOffsetFactor===t&&this.currentPolygonOffsetUnits===n||(r.polygonOffset(t,n),this.currentPolygonOffsetFactor=t,this.currentPolygonOffsetUnits=n)):this.disable(r.POLYGON_OFFSET_FILL)}useProgram(e){return this.currentProgram!==e&&(this.gl.useProgram(e),this.currentProgram=e,!0)}bindFramebuffer(e,t){const{gl:n,currentBoundFramebuffers:r}=this;return r[e]!==t&&(n.bindFramebuffer(e,t),r[e]=t,e===n.DRAW_FRAMEBUFFER&&(r[n.FRAMEBUFFER]=t),e===n.FRAMEBUFFER&&(r[n.DRAW_FRAMEBUFFER]=t),!0)}drawBuffers(e,t){const{gl:n}=this;let r=[],i=!1;if(null!==e.textures){r=this.currentDrawbuffers.get(t),void 0===r&&(r=[],this.currentDrawbuffers.set(t,r));const s=e.textures;if(r.length!==s.length||r[0]!==n.COLOR_ATTACHMENT0){for(let e=0,t=s.length;e<t;e++)r[e]=n.COLOR_ATTACHMENT0+e;r.length=s.length,i=!0}}else r[0]!==n.BACK&&(r[0]=n.BACK,i=!0);i&&n.drawBuffers(r)}activeTexture(e){const{gl:t,currentTextureSlot:n,maxTextures:r}=this;void 0===e&&(e=t.TEXTURE0+r-1),n!==e&&(t.activeTexture(e),this.currentTextureSlot=e)}bindTexture(e,t,n){const{gl:r,currentTextureSlot:i,currentBoundTextures:s,maxTextures:a}=this;void 0===n&&(n=null===i?r.TEXTURE0+a-1:i);let o=s[n];void 0===o&&(o={type:void 0,texture:void 0},s[n]=o),o.type===e&&o.texture===t||(i!==n&&(r.activeTexture(n),this.currentTextureSlot=n),r.bindTexture(e,t),o.type=e,o.texture=t)}bindBufferBase(e,t,n){const{gl:r}=this,i=`${e}-${t}`;return this.currentBoundBufferBases[i]!==n&&(r.bindBufferBase(e,t,n),this.currentBoundBufferBases[i]=n,!0)}unbindTexture(){const{gl:e,currentTextureSlot:t,currentBoundTextures:n}=this,r=n[t];void 0!==r&&void 0!==r.type&&(e.bindTexture(r.type,null),r.type=void 0,r.texture=void 0)}}class WU{constructor(e){this.backend=e,this.gl=this.backend.gl,this.extensions=e.extensions}convert(e,t=""){const{gl:n,extensions:r}=this;let i;if(e===ee)return n.UNSIGNED_BYTE;if(e===le)return n.UNSIGNED_SHORT_4_4_4_4;if(e===ue)return n.UNSIGNED_SHORT_5_5_5_1;if(e===Ae)return n.UNSIGNED_INT_5_9_9_9_REV;if(e===te)return n.BYTE;if(e===ne)return n.SHORT;if(e===re)return n.UNSIGNED_SHORT;if(e===ie)return n.INT;if(e===se)return n.UNSIGNED_INT;if(e===ae)return n.FLOAT;if(e===oe)return n.HALF_FLOAT;if(e===he)return n.ALPHA;if(e===de)return n.RGB;if(e===pe)return n.RGBA;if(e===fe)return n.LUMINANCE;if(e===me)return n.LUMINANCE_ALPHA;if(e===ge)return n.DEPTH_COMPONENT;if(e===ve)return n.DEPTH_STENCIL;if(e===_e)return n.RED;if(e===ye)return n.RED_INTEGER;if(e===xe)return n.RG;if(e===be)return n.RG_INTEGER;if(e===Se)return n.RGBA_INTEGER;if(e===Te||e===we||e===Me||e===Ee)if(t===rt){if(i=r.get("WEBGL_compressed_texture_s3tc_srgb"),null===i)return null;if(e===Te)return i.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(e===we)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(e===Me)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(e===Ee)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(i=r.get("WEBGL_compressed_texture_s3tc"),null===i)return null;if(e===Te)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===we)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===Me)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===Ee)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(e===Ce||e===Re||e===Ne||e===Pe){if(i=r.get("WEBGL_compressed_texture_pvrtc"),null===i)return null;if(e===Ce)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===Re)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===Ne)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===Pe)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(e===De||e===Le||e===Ie){if(i=r.get("WEBGL_compressed_texture_etc"),null===i)return null;if(e===De||e===Le)return t===rt?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2;if(e===Ie)return t===rt?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC}if(e===Ue||e===Be||e===Oe||e===Fe||e===ke||e===qe||e===Ge||e===ze||e===Ve||e===He||e===je||e===We||e===Xe||e===Qe){if(i=r.get("WEBGL_compressed_texture_astc"),null===i)return null;if(e===Ue)return t===rt?i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:i.COMPRESSED_RGBA_ASTC_4x4_KHR;if(e===Be)return t===rt?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:i.COMPRESSED_RGBA_ASTC_5x4_KHR;if(e===Oe)return t===rt?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:i.COMPRESSED_RGBA_ASTC_5x5_KHR;if(e===Fe)return t===rt?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:i.COMPRESSED_RGBA_ASTC_6x5_KHR;if(e===ke)return t===rt?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:i.COMPRESSED_RGBA_ASTC_6x6_KHR;if(e===qe)return t===rt?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:i.COMPRESSED_RGBA_ASTC_8x5_KHR;if(e===Ge)return t===rt?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:i.COMPRESSED_RGBA_ASTC_8x6_KHR;if(e===ze)return t===rt?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:i.COMPRESSED_RGBA_ASTC_8x8_KHR;if(e===Ve)return t===rt?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:i.COMPRESSED_RGBA_ASTC_10x5_KHR;if(e===He)return t===rt?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:i.COMPRESSED_RGBA_ASTC_10x6_KHR;if(e===je)return t===rt?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:i.COMPRESSED_RGBA_ASTC_10x8_KHR;if(e===We)return t===rt?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:i.COMPRESSED_RGBA_ASTC_10x10_KHR;if(e===Xe)return t===rt?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:i.COMPRESSED_RGBA_ASTC_12x10_KHR;if(e===Qe)return t===rt?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:i.COMPRESSED_RGBA_ASTC_12x12_KHR}if(e===Ye){if(i=r.get("EXT_texture_compression_bptc"),null===i)return null;if(e===Ye)return t===rt?i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:i.COMPRESSED_RGBA_BPTC_UNORM_EXT}if(e===Ze||e===Je||e===et||e===tt){if(i=r.get("EXT_texture_compression_rgtc"),null===i)return null;if(e===Ye)return i.COMPRESSED_RED_RGTC1_EXT;if(e===Je)return i.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(e===et)return i.COMPRESSED_RED_GREEN_RGTC2_EXT;if(e===tt)return i.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return e===ce?n.UNSIGNED_INT_24_8:void 0!==n[e]?n[e]:null}_clientWaitAsync(){const{gl:e}=this,t=e.fenceSync(e.SYNC_GPU_COMMANDS_COMPLETE,0);return e.flush(),new Promise(((n,r)=>{!function i(){const s=e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0);if(s===e.WAIT_FAILED)return e.deleteSync(t),void r();s!==e.TIMEOUT_EXPIRED?(e.deleteSync(t),n()):requestAnimationFrame(i)}()}))}}let XU,QU,YU,$U=!1;class KU{constructor(e){this.backend=e,this.gl=e.gl,this.extensions=e.extensions,this.defaultTextures={},!1===$U&&(this._init(this.gl),$U=!0)}_init(e){XU={[j]:e.REPEAT,[W]:e.CLAMP_TO_EDGE,[X]:e.MIRRORED_REPEAT},QU={[Q]:e.NEAREST,[Y]:e.NEAREST_MIPMAP_NEAREST,[$]:e.NEAREST_MIPMAP_LINEAR,[K]:e.LINEAR,[Z]:e.LINEAR_MIPMAP_NEAREST,[J]:e.LINEAR_MIPMAP_LINEAR},YU={[lt]:e.NEVER,[ft]:e.ALWAYS,[ut]:e.LESS,[At]:e.LEQUAL,[ct]:e.EQUAL,[pt]:e.GEQUAL,[ht]:e.GREATER,[dt]:e.NOTEQUAL}}filterFallback(e){const{gl:t}=this;return e===Q||e===Y||e===$?t.NEAREST:t.LINEAR}getGLTextureType(e){const{gl:t}=this;let n;return n=!0===e.isCubeTexture?t.TEXTURE_CUBE_MAP:!0===e.isDataArrayTexture||!0===e.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:!0===e.isData3DTexture?t.TEXTURE_3D:t.TEXTURE_2D,n}getInternalFormat(e,t,n,r,i=!1){const{gl:s,extensions:a}=this;if(null!==e){if(void 0!==s[e])return s[e];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+e+"'")}let o=t;return t===s.RED&&(n===s.FLOAT&&(o=s.R32F),n===s.HALF_FLOAT&&(o=s.R16F),n===s.UNSIGNED_BYTE&&(o=s.R8),n===s.UNSIGNED_SHORT&&(o=s.R16),n===s.UNSIGNED_INT&&(o=s.R32UI),n===s.BYTE&&(o=s.R8I),n===s.SHORT&&(o=s.R16I),n===s.INT&&(o=s.R32I)),t===s.RED_INTEGER&&(n===s.UNSIGNED_BYTE&&(o=s.R8UI),n===s.UNSIGNED_SHORT&&(o=s.R16UI),n===s.UNSIGNED_INT&&(o=s.R32UI),n===s.BYTE&&(o=s.R8I),n===s.SHORT&&(o=s.R16I),n===s.INT&&(o=s.R32I)),t===s.RG&&(n===s.FLOAT&&(o=s.RG32F),n===s.HALF_FLOAT&&(o=s.RG16F),n===s.UNSIGNED_BYTE&&(o=s.RG8),n===s.UNSIGNED_SHORT&&(o=s.RG16),n===s.UNSIGNED_INT&&(o=s.RG32UI),n===s.BYTE&&(o=s.RG8I),n===s.SHORT&&(o=s.RG16I),n===s.INT&&(o=s.RG32I)),t===s.RG_INTEGER&&(n===s.UNSIGNED_BYTE&&(o=s.RG8UI),n===s.UNSIGNED_SHORT&&(o=s.RG16UI),n===s.UNSIGNED_INT&&(o=s.RG32UI),n===s.BYTE&&(o=s.RG8I),n===s.SHORT&&(o=s.RG16I),n===s.INT&&(o=s.RG32I)),t===s.RGB&&(n===s.FLOAT&&(o=s.RGB32F),n===s.HALF_FLOAT&&(o=s.RGB16F),n===s.UNSIGNED_BYTE&&(o=s.RGB8),n===s.UNSIGNED_SHORT&&(o=s.RGB16),n===s.UNSIGNED_INT&&(o=s.RGB32UI),n===s.BYTE&&(o=s.RGB8I),n===s.SHORT&&(o=s.RGB16I),n===s.INT&&(o=s.RGB32I),n===s.UNSIGNED_BYTE&&(o=r===rt&&!1===i?s.SRGB8:s.RGB8),n===s.UNSIGNED_SHORT_5_6_5&&(o=s.RGB565),n===s.UNSIGNED_SHORT_5_5_5_1&&(o=s.RGB5_A1),n===s.UNSIGNED_SHORT_4_4_4_4&&(o=s.RGB4),n===s.UNSIGNED_INT_5_9_9_9_REV&&(o=s.RGB9_E5)),t===s.RGB_INTEGER&&(n===s.UNSIGNED_BYTE&&(o=s.RGB8UI),n===s.UNSIGNED_SHORT&&(o=s.RGB16UI),n===s.UNSIGNED_INT&&(o=s.RGB32UI),n===s.BYTE&&(o=s.RGB8I),n===s.SHORT&&(o=s.RGB16I),n===s.INT&&(o=s.RGB32I)),t===s.RGBA&&(n===s.FLOAT&&(o=s.RGBA32F),n===s.HALF_FLOAT&&(o=s.RGBA16F),n===s.UNSIGNED_BYTE&&(o=s.RGBA8),n===s.UNSIGNED_SHORT&&(o=s.RGBA16),n===s.UNSIGNED_INT&&(o=s.RGBA32UI),n===s.BYTE&&(o=s.RGBA8I),n===s.SHORT&&(o=s.RGBA16I),n===s.INT&&(o=s.RGBA32I),n===s.UNSIGNED_BYTE&&(o=r===rt&&!1===i?s.SRGB8_ALPHA8:s.RGBA8),n===s.UNSIGNED_SHORT_4_4_4_4&&(o=s.RGBA4),n===s.UNSIGNED_SHORT_5_5_5_1&&(o=s.RGB5_A1)),t===s.RGBA_INTEGER&&(n===s.UNSIGNED_BYTE&&(o=s.RGBA8UI),n===s.UNSIGNED_SHORT&&(o=s.RGBA16UI),n===s.UNSIGNED_INT&&(o=s.RGBA32UI),n===s.BYTE&&(o=s.RGBA8I),n===s.SHORT&&(o=s.RGBA16I),n===s.INT&&(o=s.RGBA32I)),t===s.DEPTH_COMPONENT&&(n===s.UNSIGNED_INT&&(o=s.DEPTH24_STENCIL8),n===s.FLOAT&&(o=s.DEPTH_COMPONENT32F)),t===s.DEPTH_STENCIL&&n===s.UNSIGNED_INT_24_8&&(o=s.DEPTH24_STENCIL8),o!==s.R16F&&o!==s.R32F&&o!==s.RG16F&&o!==s.RG32F&&o!==s.RGBA16F&&o!==s.RGBA32F||a.get("EXT_color_buffer_float"),o}setTextureParameters(e,t){const{gl:n,extensions:r,backend:i}=this;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,t.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,t.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE),n.texParameteri(e,n.TEXTURE_WRAP_S,XU[t.wrapS]),n.texParameteri(e,n.TEXTURE_WRAP_T,XU[t.wrapT]),e!==n.TEXTURE_3D&&e!==n.TEXTURE_2D_ARRAY||n.texParameteri(e,n.TEXTURE_WRAP_R,XU[t.wrapR]),n.texParameteri(e,n.TEXTURE_MAG_FILTER,QU[t.magFilter]);const s=void 0!==t.mipmaps&&t.mipmaps.length>0,a=t.minFilter===K&&s?J:t.minFilter;if(n.texParameteri(e,n.TEXTURE_MIN_FILTER,QU[a]),t.compareFunction&&(n.texParameteri(e,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(e,n.TEXTURE_COMPARE_FUNC,YU[t.compareFunction])),!0===r.has("EXT_texture_filter_anisotropic")){if(t.magFilter===Q)return;if(t.minFilter!==$&&t.minFilter!==J)return;if(t.type===ae&&!1===r.has("OES_texture_float_linear"))return;if(t.anisotropy>1){const s=r.get("EXT_texture_filter_anisotropic");n.texParameterf(e,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(t.anisotropy,i.getMaxAnisotropy()))}}}createDefaultTexture(e){const{gl:t,backend:n,defaultTextures:r}=this,i=this.getGLTextureType(e);let s=r[i];void 0===s&&(s=t.createTexture(),n.state.bindTexture(i,s),t.texParameteri(i,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(i,t.TEXTURE_MAG_FILTER,t.NEAREST),r[i]=s),n.set(e,{textureGPU:s,glTextureType:i,isDefault:!0})}createTexture(e,t){const{gl:n,backend:r}=this,{levels:i,width:s,height:a,depth:o}=t,l=r.utils.convert(e.format,e.colorSpace),u=r.utils.convert(e.type),c=this.getInternalFormat(e.internalFormat,l,u,e.colorSpace,e.isVideoTexture),A=n.createTexture(),h=this.getGLTextureType(e);r.state.bindTexture(h,A),this.setTextureParameters(h,e),e.isDataArrayTexture||e.isCompressedArrayTexture?n.texStorage3D(n.TEXTURE_2D_ARRAY,i,c,s,a,o):e.isData3DTexture?n.texStorage3D(n.TEXTURE_3D,i,c,s,a,o):e.isVideoTexture||n.texStorage2D(h,i,c,s,a),r.set(e,{textureGPU:A,glTextureType:h,glFormat:l,glType:u,glInternalFormat:c})}copyBufferToTexture(e,t){const{gl:n,backend:r}=this,{textureGPU:i,glTextureType:s,glFormat:a,glType:o}=r.get(t),{width:l,height:u}=t.source.data;n.bindBuffer(n.PIXEL_UNPACK_BUFFER,e),r.state.bindTexture(s,i),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),n.texSubImage2D(s,0,0,0,l,u,a,o,0),n.bindBuffer(n.PIXEL_UNPACK_BUFFER,null),r.state.unbindTexture()}updateTexture(e,t){const{gl:n}=this,{width:r,height:i}=t,{textureGPU:s,glTextureType:a,glFormat:o,glType:l,glInternalFormat:u}=this.backend.get(e);if(e.isRenderTargetTexture||void 0===s)return;const c=e=>e.isDataTexture?e.image.data:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||e instanceof OffscreenCanvas?e:e.data;if(this.backend.state.bindTexture(a,s),this.setTextureParameters(a,e),e.isCompressedTexture){const r=e.mipmaps,i=t.image;for(let t=0;t<r.length;t++){const s=r[t];e.isCompressedArrayTexture?e.format!==n.RGBA?null!==o?n.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,t,0,0,0,s.width,s.height,i.depth,o,s.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texSubImage3D(n.TEXTURE_2D_ARRAY,t,0,0,0,s.width,s.height,i.depth,o,l,s.data):null!==o?n.compressedTexSubImage2D(n.TEXTURE_2D,t,0,0,s.width,s.height,o,s.data):console.warn("Unsupported compressed texture format")}}else if(e.isCubeTexture){const e=t.images;for(let t=0;t<6;t++){const s=c(e[t]);n.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,r,i,o,l,s)}}else if(e.isDataArrayTexture){const e=t.image;n.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,e.width,e.height,e.depth,o,l,e.data)}else if(e.isData3DTexture){const e=t.image;n.texSubImage3D(n.TEXTURE_3D,0,0,0,0,e.width,e.height,e.depth,o,l,e.data)}else if(e.isVideoTexture)e.update(),n.texImage2D(a,0,u,o,l,t.image);else{const e=c(t.image);n.texSubImage2D(a,0,0,0,r,i,o,l,e)}}generateMipmaps(e){const{gl:t,backend:n}=this,{textureGPU:r,glTextureType:i}=n.get(e);n.state.bindTexture(i,r),t.generateMipmap(i)}deallocateRenderBuffers(e){const{gl:t,backend:n}=this;if(e){const r=n.get(e);if(r.renderBufferStorageSetup=void 0,r.framebuffers){for(const e in r.framebuffers)t.deleteFramebuffer(r.framebuffers[e]);delete r.framebuffers}if(r.depthRenderbuffer&&(t.deleteRenderbuffer(r.depthRenderbuffer),delete r.depthRenderbuffer),r.stencilRenderbuffer&&(t.deleteRenderbuffer(r.stencilRenderbuffer),delete r.stencilRenderbuffer),r.msaaFrameBuffer&&(t.deleteFramebuffer(r.msaaFrameBuffer),delete r.msaaFrameBuffer),r.msaaRenderbuffers){for(let e=0;e<r.msaaRenderbuffers.length;e++)t.deleteRenderbuffer(r.msaaRenderbuffers[e]);delete r.msaaRenderbuffers}}}destroyTexture(e){const{gl:t,backend:n}=this,{textureGPU:r,renderTarget:i}=n.get(e);this.deallocateRenderBuffers(i),t.deleteTexture(r),n.delete(e)}copyTextureToTexture(e,t,n=null,r=null,i=0){const{gl:s,backend:a}=this,{state:o}=this.backend,{textureGPU:l,glTextureType:u,glType:c,glFormat:A}=a.get(t);let h,d,p,f,m,g;null!==n?(h=n.max.x-n.min.x,d=n.max.y-n.min.y,p=n.min.x,f=n.min.y):(h=e.image.width,d=e.image.height,p=0,f=0),null!==r?(m=r.x,g=r.y):(m=0,g=0),o.bindTexture(u,l),s.pixelStorei(s.UNPACK_ALIGNMENT,t.unpackAlignment),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,t.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,t.unpackAlignment);const v=s.getParameter(s.UNPACK_ROW_LENGTH),_=s.getParameter(s.UNPACK_IMAGE_HEIGHT),y=s.getParameter(s.UNPACK_SKIP_PIXELS),x=s.getParameter(s.UNPACK_SKIP_ROWS),b=s.getParameter(s.UNPACK_SKIP_IMAGES),S=e.isCompressedTexture?e.mipmaps[i]:e.image;if(s.pixelStorei(s.UNPACK_ROW_LENGTH,S.width),s.pixelStorei(s.UNPACK_IMAGE_HEIGHT,S.height),s.pixelStorei(s.UNPACK_SKIP_PIXELS,p),s.pixelStorei(s.UNPACK_SKIP_ROWS,f),e.isRenderTargetTexture||e.isDepthTexture){const n=a.get(e),r=a.get(t),i=a.get(n.renderTarget),l=a.get(r.renderTarget),u=i.framebuffers[n.cacheKey],c=l.framebuffers[r.cacheKey];o.bindFramebuffer(s.READ_FRAMEBUFFER,u),o.bindFramebuffer(s.DRAW_FRAMEBUFFER,c);let A=s.COLOR_BUFFER_BIT;e.isDepthTexture&&(A=s.DEPTH_BUFFER_BIT),s.blitFramebuffer(p,f,h,d,m,g,h,d,A,s.NEAREST),o.bindFramebuffer(s.READ_FRAMEBUFFER,null),o.bindFramebuffer(s.DRAW_FRAMEBUFFER,null)}else e.isDataTexture?s.texSubImage2D(s.TEXTURE_2D,i,m,g,h,d,A,c,S.data):e.isCompressedTexture?s.compressedTexSubImage2D(s.TEXTURE_2D,i,m,g,S.width,S.height,A,S.data):s.texSubImage2D(s.TEXTURE_2D,i,m,g,h,d,A,c,S);s.pixelStorei(s.UNPACK_ROW_LENGTH,v),s.pixelStorei(s.UNPACK_IMAGE_HEIGHT,_),s.pixelStorei(s.UNPACK_SKIP_PIXELS,y),s.pixelStorei(s.UNPACK_SKIP_ROWS,x),s.pixelStorei(s.UNPACK_SKIP_IMAGES,b),0===i&&t.generateMipmaps&&s.generateMipmap(s.TEXTURE_2D),o.unbindTexture()}copyFramebufferToTexture(e,t,n){const{gl:r}=this,{state:i}=this.backend,{textureGPU:s}=this.backend.get(e),{x:a,y:o,z:l,w:u}=n,c=!0===e.isDepthTexture||t.renderTarget&&t.renderTarget.samples>0,A=t.renderTarget?t.renderTarget.height:this.backend.gerDrawingBufferSize().y;if(c){const n=0!==a||0!==o;let c,h;if(!0===e.isDepthTexture?(c=r.DEPTH_BUFFER_BIT,h=r.DEPTH_ATTACHMENT,t.stencil&&(c|=r.STENCIL_BUFFER_BIT)):(c=r.COLOR_BUFFER_BIT,h=r.COLOR_ATTACHMENT0),n){const e=this.backend.get(t.renderTarget),n=e.framebuffers[t.getCacheKey()],h=e.msaaFrameBuffer;i.bindFramebuffer(r.DRAW_FRAMEBUFFER,n),i.bindFramebuffer(r.READ_FRAMEBUFFER,h);const d=A-o-u;r.blitFramebuffer(a,d,a+l,d+u,a,d,a+l,d+u,c,r.NEAREST),i.bindFramebuffer(r.READ_FRAMEBUFFER,n),i.bindTexture(r.TEXTURE_2D,s),r.copyTexSubImage2D(r.TEXTURE_2D,0,0,0,a,d,l,u),i.unbindTexture()}else{const e=r.createFramebuffer();i.bindFramebuffer(r.DRAW_FRAMEBUFFER,e),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,h,r.TEXTURE_2D,s,0),r.blitFramebuffer(0,0,l,u,0,0,l,u,c,r.NEAREST),r.deleteFramebuffer(e)}}else i.bindTexture(r.TEXTURE_2D,s),r.copyTexSubImage2D(r.TEXTURE_2D,0,0,0,a,A-u-o,l,u),i.unbindTexture();e.generateMipmaps&&this.generateMipmaps(e),this.backend._setFramebuffer(t)}setupRenderBufferStorage(e,t){const{gl:n}=this,r=t.renderTarget,{samples:i,depthTexture:s,depthBuffer:a,stencilBuffer:o,width:l,height:u}=r;if(n.bindRenderbuffer(n.RENDERBUFFER,e),a&&!o){let t=n.DEPTH_COMPONENT24;i>0?(s&&s.isDepthTexture&&s.type===n.FLOAT&&(t=n.DEPTH_COMPONENT32F),n.renderbufferStorageMultisample(n.RENDERBUFFER,i,t,l,u)):n.renderbufferStorage(n.RENDERBUFFER,t,l,u),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,e)}else a&&o&&(i>0?n.renderbufferStorageMultisample(n.RENDERBUFFER,i,n.DEPTH24_STENCIL8,l,u):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,l,u),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,e))}async copyTextureToBuffer(e,t,n,r,i,s){const{backend:a,gl:o}=this,{textureGPU:l,glFormat:u,glType:c}=this.backend.get(e),A=o.createFramebuffer();o.bindFramebuffer(o.READ_FRAMEBUFFER,A);const h=e.isCubeTexture?o.TEXTURE_CUBE_MAP_POSITIVE_X+s:o.TEXTURE_2D;o.framebufferTexture2D(o.READ_FRAMEBUFFER,o.COLOR_ATTACHMENT0,h,l,0);const d=this._getTypedArrayType(c),p=r*i*this._getBytesPerTexel(c,u),f=o.createBuffer();o.bindBuffer(o.PIXEL_PACK_BUFFER,f),o.bufferData(o.PIXEL_PACK_BUFFER,p,o.STREAM_READ),o.readPixels(t,n,r,i,u,c,0),o.bindBuffer(o.PIXEL_PACK_BUFFER,null),await a.utils._clientWaitAsync();const m=new d(p/d.BYTES_PER_ELEMENT);return o.bindBuffer(o.PIXEL_PACK_BUFFER,f),o.getBufferSubData(o.PIXEL_PACK_BUFFER,0,m),o.bindBuffer(o.PIXEL_PACK_BUFFER,null),o.deleteFramebuffer(A),m}_getTypedArrayType(e){const{gl:t}=this;if(e===t.UNSIGNED_BYTE)return Uint8Array;if(e===t.UNSIGNED_SHORT_4_4_4_4)return Uint16Array;if(e===t.UNSIGNED_SHORT_5_5_5_1)return Uint16Array;if(e===t.UNSIGNED_SHORT_5_6_5)return Uint16Array;if(e===t.UNSIGNED_SHORT)return Uint16Array;if(e===t.UNSIGNED_INT)return Uint32Array;if(e===t.HALF_FLOAT)return Uint16Array;if(e===t.FLOAT)return Float32Array;throw new Error(`Unsupported WebGL type: ${e}`)}_getBytesPerTexel(e,t){const{gl:n}=this;let r=0;return e===n.UNSIGNED_BYTE&&(r=1),e!==n.UNSIGNED_SHORT_4_4_4_4&&e!==n.UNSIGNED_SHORT_5_5_5_1&&e!==n.UNSIGNED_SHORT_5_6_5&&e!==n.UNSIGNED_SHORT&&e!==n.HALF_FLOAT||(r=2),e!==n.UNSIGNED_INT&&e!==n.FLOAT||(r=4),t===n.RGBA?4*r:t===n.RGB?3*r:t===n.ALPHA?r:void 0}}class ZU{constructor(e){this.backend=e,this.gl=this.backend.gl,this.availableExtensions=this.gl.getSupportedExtensions(),this.extensions={}}get(e){let t=this.extensions[e];return void 0===t&&(t=this.gl.getExtension(e),this.extensions[e]=t),t}has(e){return this.availableExtensions.includes(e)}}class JU{constructor(e){this.backend=e,this.maxAnisotropy=null}getMaxAnisotropy(){if(null!==this.maxAnisotropy)return this.maxAnisotropy;const e=this.backend.gl,t=this.backend.extensions;if(!0===t.has("EXT_texture_filter_anisotropic")){const n=t.get("EXT_texture_filter_anisotropic");this.maxAnisotropy=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else this.maxAnisotropy=0;return this.maxAnisotropy}}const eB={WEBGL_multi_draw:"WEBGL_multi_draw",WEBGL_compressed_texture_astc:"texture-compression-astc",WEBGL_compressed_texture_etc:"texture-compression-etc2",WEBGL_compressed_texture_etc1:"texture-compression-etc1",WEBGL_compressed_texture_pvrtc:"texture-compression-pvrtc",WEBKIT_WEBGL_compressed_texture_pvrtc:"texture-compression-pvrtc",WEBGL_compressed_texture_s3tc:"texture-compression-bc",EXT_texture_compression_bptc:"texture-compression-bptc",EXT_disjoint_timer_query_webgl2:"timestamp-query"};class tB{constructor(e){this.gl=e.gl,this.extensions=e.extensions,this.info=e.renderer.info,this.mode=null,this.index=0,this.type=null,this.object=null}render(e,t){const{gl:n,mode:r,object:i,type:s,info:a,index:o}=this;0!==o?n.drawElements(r,t,s,e):n.drawArrays(r,e,t),a.update(i,t,r,1)}renderInstances(e,t,n){const{gl:r,mode:i,type:s,index:a,object:o,info:l}=this;0!==n&&(0!==a?r.drawElementsInstanced(i,t,s,e,n):r.drawArraysInstanced(i,e,t,n),l.update(o,t,i,n))}renderMultiDraw(e,t,n){const{extensions:r,mode:i,object:s,info:a}=this;if(0===n)return;const o=r.get("WEBGL_multi_draw");if(null===o)for(let r=0;r<n;r++)this.render(e[r],t[r]);else{0!==this.index?o.multiDrawElementsWEBGL(i,t,0,this.type,e,0,n):o.multiDrawArraysWEBGL(i,e,0,t,0,n);let r=0;for(let e=0;e<n;e++)r+=t[e];a.update(s,r,i,1)}}renderMultiDrawInstances(e,t,n,r){const{extensions:i,mode:s,object:a,info:o}=this;if(0===n)return;const l=i.get("WEBGL_multi_draw");if(null===l)for(let i=0;i<n;i++)this.renderInstances(e[i],t[i],r[i]);else{0!==this.index?l.multiDrawElementsInstancedWEBGL(s,t,0,this.type,e,0,r,0,n):l.multiDrawArraysInstancedWEBGL(s,e,0,t,0,r,0,n);let i=0;for(let e=0;e<n;e++)i+=t[e]*r[e];o.update(a,i,s,1)}}}class nB extends FU{constructor(e={}){super(e),this.isWebGLBackend=!0}init(e){super.init(e);const t=this.parameters,n=void 0!==t.context?t.context:e.domElement.getContext("webgl2");function r(t){t.preventDefault();const n={api:"WebGL",message:t.statusMessage||"Unknown reason",reason:null,originalEvent:t};e.onDeviceLost(n)}this._onContextLost=r,e.domElement.addEventListener("webglcontextlost",r,!1),this.gl=n,this.extensions=new ZU(this),this.capabilities=new JU(this),this.attributeUtils=new GU(this),this.textureUtils=new KU(this),this.bufferRenderer=new tB(this),this.state=new jU(this),this.utils=new WU(this),this.vaoCache={},this.transformFeedbackCache={},this.discard=!1,this.trackTimestamp=!0===t.trackTimestamp,this.extensions.get("EXT_color_buffer_float"),this.extensions.get("WEBGL_clip_cull_distance"),this.extensions.get("OES_texture_float_linear"),this.extensions.get("EXT_color_buffer_half_float"),this.extensions.get("WEBGL_multisampled_render_to_texture"),this.extensions.get("WEBGL_render_shared_exponent"),this.extensions.get("WEBGL_multi_draw"),this.disjoint=this.extensions.get("EXT_disjoint_timer_query_webgl2"),this.parallel=this.extensions.get("KHR_parallel_shader_compile"),this._knownBindings=new WeakSet,this._currentContext=null}get coordinateSystem(){return _t}async getArrayBufferAsync(e){return await this.attributeUtils.getArrayBufferAsync(e)}async waitForGPU(){await this.utils._clientWaitAsync()}initTimestampQuery(e){if(!this.disjoint||!this.trackTimestamp)return;const t=this.get(e);if(this.queryRunning)return t.queryQueue||(t.queryQueue=[]),void t.queryQueue.push(e);t.activeQuery&&(this.gl.endQuery(this.disjoint.TIME_ELAPSED_EXT),t.activeQuery=null),t.activeQuery=this.gl.createQuery(),null!==t.activeQuery&&(this.gl.beginQuery(this.disjoint.TIME_ELAPSED_EXT,t.activeQuery),this.queryRunning=!0)}prepareTimestampBuffer(e){if(!this.disjoint||!this.trackTimestamp)return;const t=this.get(e);if(t.activeQuery&&(this.gl.endQuery(this.disjoint.TIME_ELAPSED_EXT),t.gpuQueries||(t.gpuQueries=[]),t.gpuQueries.push({query:t.activeQuery}),t.activeQuery=null,this.queryRunning=!1,t.queryQueue&&t.queryQueue.length>0)){const e=t.queryQueue.shift();this.initTimestampQuery(e)}}async resolveTimestampAsync(e,t="render"){if(!this.disjoint||!this.trackTimestamp)return;const n=this.get(e);n.gpuQueries||(n.gpuQueries=[]);for(let e=0;e<n.gpuQueries.length;e++){const r=n.gpuQueries[e],i=this.gl.getQueryParameter(r.query,this.gl.QUERY_RESULT_AVAILABLE),s=this.gl.getParameter(this.disjoint.GPU_DISJOINT_EXT);if(i&&!s){const i=this.gl.getQueryParameter(r.query,this.gl.QUERY_RESULT),s=Number(i)/1e6;this.gl.deleteQuery(r.query),n.gpuQueries.splice(e,1),e--,this.renderer.info.updateTimestamp(t,s)}}}getContext(){return this.gl}beginRender(e){const{gl:t}=this,n=this.get(e);if(this.initTimestampQuery(e),n.previousContext=this._currentContext,this._currentContext=e,this._setFramebuffer(e),this.clear(e.clearColor,e.clearDepth,e.clearStencil,e,!1),e.viewport?this.updateViewport(e):t.viewport(0,0,t.drawingBufferWidth,t.drawingBufferHeight),e.scissor){const{x:n,y:r,width:i,height:s}=e.scissorValue;t.scissor(n,e.height-s-r,i,s)}const r=e.occlusionQueryCount;r>0&&(n.currentOcclusionQueries=n.occlusionQueries,n.currentOcclusionQueryObjects=n.occlusionQueryObjects,n.lastOcclusionObject=null,n.occlusionQueries=new Array(r),n.occlusionQueryObjects=new Array(r),n.occlusionQueryIndex=0)}finishRender(e){const{gl:t,state:n}=this,r=this.get(e),i=r.previousContext,s=e.occlusionQueryCount;s>0&&(s>r.occlusionQueryIndex&&t.endQuery(t.ANY_SAMPLES_PASSED),this.resolveOccludedAsync(e));const a=e.textures;if(null!==a)for(let e=0;e<a.length;e++){const t=a[e];t.generateMipmaps&&this.generateMipmaps(t)}if(this._currentContext=i,null!==e.textures&&e.renderTarget){const r=this.get(e.renderTarget),{samples:i}=e.renderTarget;if(i>0){const i=r.framebuffers[e.getCacheKey()],s=t.COLOR_BUFFER_BIT,a=r.msaaFrameBuffer,o=e.textures;n.bindFramebuffer(t.READ_FRAMEBUFFER,a),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,i);for(let n=0;n<o.length;n++)if(e.scissor){const{x:n,y:i,width:a,height:o}=e.scissorValue,l=e.height-o-i;t.blitFramebuffer(n,l,n+a,l+o,n,l,n+a,l+o,s,t.NEAREST),t.invalidateSubFramebuffer(t.READ_FRAMEBUFFER,r.invalidationArray,n,l,a,o)}else t.blitFramebuffer(0,0,e.width,e.height,0,0,e.width,e.height,s,t.NEAREST),t.invalidateFramebuffer(t.READ_FRAMEBUFFER,r.invalidationArray)}}null!==i&&(this._setFramebuffer(i),i.viewport?this.updateViewport(i):t.viewport(0,0,t.drawingBufferWidth,t.drawingBufferHeight)),this.prepareTimestampBuffer(e)}resolveOccludedAsync(e){const t=this.get(e),{currentOcclusionQueries:n,currentOcclusionQueryObjects:r}=t;if(n&&r){const e=new WeakSet,{gl:i}=this;t.currentOcclusionQueryObjects=null,t.currentOcclusionQueries=null;const s=()=>{let a=0;for(let t=0;t<n.length;t++){const s=n[t];null!==s&&(i.getQueryParameter(s,i.QUERY_RESULT_AVAILABLE)&&(i.getQueryParameter(s,i.QUERY_RESULT)>0&&e.add(r[t]),n[t]=null,i.deleteQuery(s),a++))}a<n.length?requestAnimationFrame(s):t.occluded=e};s()}}isOccluded(e,t){const n=this.get(e);return n.occluded&&n.occluded.has(t)}updateViewport(e){const t=this.gl,{x:n,y:r,width:i,height:s}=e.viewportValue;t.viewport(n,e.height-s-r,i,s)}setScissorTest(e){const t=this.gl;e?t.enable(t.SCISSOR_TEST):t.disable(t.SCISSOR_TEST)}clear(e,t,n,r=null,i=!0){const{gl:s}=this;if(null===r){const e=this.getClearColor();e.r*=e.a,e.g*=e.a,e.b*=e.a,r={textures:null,clearColorValue:e}}let a=0;if(e&&(a|=s.COLOR_BUFFER_BIT),t&&(a|=s.DEPTH_BUFFER_BIT),n&&(a|=s.STENCIL_BUFFER_BIT),0!==a){let o;if(r.clearColorValue?o=r.clearColorValue:(o=this.getClearColor(),o.r*=o.a,o.g*=o.a,o.b*=o.a),t&&this.state.setDepthMask(!0),null===r.textures)s.clearColor(o.r,o.g,o.b,o.a),s.clear(a);else{if(i&&this._setFramebuffer(r),e)for(let e=0;e<r.textures.length;e++)s.clearBufferfv(s.COLOR,e,[o.r,o.g,o.b,o.a]);t&&n?s.clearBufferfi(s.DEPTH_STENCIL,0,1,0):t?s.clearBufferfv(s.DEPTH,0,[1]):n&&s.clearBufferiv(s.STENCIL,0,[0])}}}beginCompute(e){const{state:t,gl:n}=this;t.bindFramebuffer(n.FRAMEBUFFER,null),this.initTimestampQuery(e)}compute(e,t,n,r){const{state:i,gl:s}=this;this.discard||(s.enable(s.RASTERIZER_DISCARD),this.discard=!0);const{programGPU:a,transformBuffers:o,attributes:l}=this.get(r),u=this._getVaoKey(null,l),c=this.vaoCache[u];void 0===c?this._createVao(null,l):s.bindVertexArray(c),i.useProgram(a),this._bindUniforms(n);const A=this._getTransformFeedback(o);s.bindTransformFeedback(s.TRANSFORM_FEEDBACK,A),s.beginTransformFeedback(s.POINTS),l[0].isStorageInstancedBufferAttribute?s.drawArraysInstanced(s.POINTS,0,1,t.count):s.drawArrays(s.POINTS,0,t.count),s.endTransformFeedback(),s.bindTransformFeedback(s.TRANSFORM_FEEDBACK,null);for(let e=0;e<o.length;e++){const t=o[e];t.pbo&&this.textureUtils.copyBufferToTexture(t.transformBuffer,t.pbo),t.switchBuffers()}}finishCompute(e){const t=this.gl;this.discard=!1,t.disable(t.RASTERIZER_DISCARD),this.prepareTimestampBuffer(e),this._currentContext&&this._setFramebuffer(this._currentContext)}draw(e){const{object:t,pipeline:n,material:r,context:i,hardwareClippingPlanes:s}=e,{programGPU:a}=this.get(n),{gl:o,state:l}=this,u=this.get(i),c=e.getDrawParameters();if(null===c)return;this._bindUniforms(e.getBindings());const A=t.isMesh&&t.matrixWorld.determinant()<0;l.setMaterial(r,A,s),l.useProgram(a);const h=this.get(e);let d=h.staticVao;if(void 0===d||h.geometryId!==e.geometry.id){const t=this._getVaoKey(e.getIndex(),e.getAttributes());if(d=this.vaoCache[t],void 0===d){let t;({vaoGPU:d,staticVao:t}=this._createVao(e.getIndex(),e.getAttributes())),t&&(h.staticVao=d,h.geometryId=e.geometry.id)}}o.bindVertexArray(d);const p=e.getIndex(),f=u.lastOcclusionObject;if(f!==t&&void 0!==f){if(null!==f&&!0===f.occlusionTest&&(o.endQuery(o.ANY_SAMPLES_PASSED),u.occlusionQueryIndex++),!0===t.occlusionTest){const e=o.createQuery();o.beginQuery(o.ANY_SAMPLES_PASSED,e),u.occlusionQueries[u.occlusionQueryIndex]=e,u.occlusionQueryObjects[u.occlusionQueryIndex]=t}u.lastOcclusionObject=t}const m=this.bufferRenderer;t.isPoints?m.mode=o.POINTS:t.isLineSegments?m.mode=o.LINES:t.isLine?m.mode=o.LINE_STRIP:t.isLineLoop?m.mode=o.LINE_LOOP:!0===r.wireframe?(l.setLineWidth(r.wireframeLinewidth*this.renderer.getPixelRatio()),m.mode=o.LINES):m.mode=o.TRIANGLES;const{vertexCount:g,instanceCount:v}=c;let{firstVertex:_}=c;if(m.object=t,null!==p){_*=p.array.BYTES_PER_ELEMENT;const e=this.get(p);m.index=p.count,m.type=e.type}else m.index=0;t.isBatchedMesh?null!==t._multiDrawInstances?m.renderMultiDrawInstances(t._multiDrawStarts,t._multiDrawCounts,t._multiDrawCount,t._multiDrawInstances):this.hasFeature("WEBGL_multi_draw")?m.renderMultiDraw(t._multiDrawStarts,t._multiDrawCounts,t._multiDrawCount):qt("THREE.WebGLRenderer: WEBGL_multi_draw not supported."):v>1?m.renderInstances(_,g,v):m.render(_,g),o.bindVertexArray(null)}needsRenderUpdate(){return!1}getRenderCacheKey(){return""}createDefaultTexture(e){this.textureUtils.createDefaultTexture(e)}createTexture(e,t){this.textureUtils.createTexture(e,t)}updateTexture(e,t){this.textureUtils.updateTexture(e,t)}generateMipmaps(e){this.textureUtils.generateMipmaps(e)}destroyTexture(e){this.textureUtils.destroyTexture(e)}copyTextureToBuffer(e,t,n,r,i,s){return this.textureUtils.copyTextureToBuffer(e,t,n,r,i,s)}createSampler(){}destroySampler(){}createNodeBuilder(e,t){return new IU(e,t)}createProgram(e){const t=this.gl,{stage:n,code:r}=e,i="fragment"===n?t.createShader(t.FRAGMENT_SHADER):t.createShader(t.VERTEX_SHADER);t.shaderSource(i,r),t.compileShader(i),this.set(e,{shaderGPU:i})}destroyProgram(){console.warn("Abstract class.")}createRenderPipeline(e,t){const n=this.gl,r=e.pipeline,{fragmentProgram:i,vertexProgram:s}=r,a=n.createProgram(),o=this.get(i).shaderGPU,l=this.get(s).shaderGPU;if(n.attachShader(a,o),n.attachShader(a,l),n.linkProgram(a),this.set(r,{programGPU:a,fragmentShader:o,vertexShader:l}),null!==t&&this.parallel){const i=new Promise((t=>{const i=this.parallel,s=()=>{n.getProgramParameter(a,i.COMPLETION_STATUS_KHR)?(this._completeCompile(e,r),t()):requestAnimationFrame(s)};s()}));t.push(i)}else this._completeCompile(e,r)}_handleSource(e,t){const n=e.split("\n"),r=[],i=Math.max(t-6,0),s=Math.min(t+6,n.length);for(let e=i;e<s;e++){const i=e+1;r.push(`${i===t?">":" "} ${i}: ${n[e]}`)}return r.join("\n")}_getShaderErrors(e,t,n){const r=e.getShaderParameter(t,e.COMPILE_STATUS),i=e.getShaderInfoLog(t).trim();if(r&&""===i)return"";const s=/ERROR: 0:(\d+)/.exec(i);if(s){const r=parseInt(s[1]);return n.toUpperCase()+"\n\n"+i+"\n\n"+this._handleSource(e.getShaderSource(t),r)}return i}_logProgramError(e,t,n){if(this.renderer.debug.checkShaderErrors){const r=this.gl,i=r.getProgramInfoLog(e).trim();if(!1===r.getProgramParameter(e,r.LINK_STATUS))if("function"==typeof this.renderer.debug.onShaderError)this.renderer.debug.onShaderError(r,e,n,t);else{const s=this._getShaderErrors(r,n,"vertex"),a=this._getShaderErrors(r,t,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(e,r.VALIDATE_STATUS)+"\n\nProgram Info Log: "+i+"\n"+s+"\n"+a)}else""!==i&&console.warn("THREE.WebGLProgram: Program Info Log:",i)}}_completeCompile(e,t){const{state:n,gl:r}=this,i=this.get(t),{programGPU:s,fragmentShader:a,vertexShader:o}=i;!1===r.getProgramParameter(s,r.LINK_STATUS)&&this._logProgramError(s,a,o),n.useProgram(s);const l=e.getBindings();this._setupBindings(l,s),this.set(t,{programGPU:s})}createComputePipeline(e,t){const{state:n,gl:r}=this,i={stage:"fragment",code:"#version 300 es\nprecision highp float;\nvoid main() {}"};this.createProgram(i);const{computeProgram:s}=e,a=r.createProgram(),o=this.get(i).shaderGPU,l=this.get(s).shaderGPU,u=s.transforms,c=[],A=[];for(let e=0;e<u.length;e++){const t=u[e];c.push(t.varyingName),A.push(t.attributeNode)}r.attachShader(a,o),r.attachShader(a,l),r.transformFeedbackVaryings(a,c,r.SEPARATE_ATTRIBS),r.linkProgram(a),!1===r.getProgramParameter(a,r.LINK_STATUS)&&this._logProgramError(a,o,l),n.useProgram(a),this._setupBindings(t,a);const h=s.attributes,d=[],p=[];for(let e=0;e<h.length;e++){const t=h[e].node.attribute;d.push(t),this.has(t)||this.attributeUtils.createAttribute(t,r.ARRAY_BUFFER)}for(let e=0;e<A.length;e++){const t=A[e].attribute;this.has(t)||this.attributeUtils.createAttribute(t,r.ARRAY_BUFFER);const n=this.get(t);p.push(n)}this.set(e,{programGPU:a,transformBuffers:p,attributes:d})}createBindings(e,t){if(!1===this._knownBindings.has(t)){this._knownBindings.add(t);let e=0,n=0;for(const r of t){this.set(r,{textures:n,uniformBuffers:e});for(const t of r.bindings)t.isUniformBuffer&&e++,t.isSampledTexture&&n++}}this.updateBindings(e,t)}updateBindings(e){const{gl:t}=this,n=this.get(e);let r=n.uniformBuffers,i=n.textures;for(const n of e.bindings)if(n.isUniformsGroup||n.isUniformBuffer){const e=n.buffer,i=t.createBuffer();t.bindBuffer(t.UNIFORM_BUFFER,i),t.bufferData(t.UNIFORM_BUFFER,e,t.DYNAMIC_DRAW),this.set(n,{index:r++,bufferGPU:i})}else if(n.isSampledTexture){const{textureGPU:e,glTextureType:t}=this.get(n.texture);this.set(n,{index:i++,textureGPU:e,glTextureType:t})}}updateBinding(e){const t=this.gl;if(e.isUniformsGroup||e.isUniformBuffer){const n=this.get(e).bufferGPU,r=e.buffer;t.bindBuffer(t.UNIFORM_BUFFER,n),t.bufferData(t.UNIFORM_BUFFER,r,t.DYNAMIC_DRAW)}}createIndexAttribute(e){const t=this.gl;this.attributeUtils.createAttribute(e,t.ELEMENT_ARRAY_BUFFER)}createAttribute(e){if(this.has(e))return;const t=this.gl;this.attributeUtils.createAttribute(e,t.ARRAY_BUFFER)}createStorageAttribute(e){if(this.has(e))return;const t=this.gl;this.attributeUtils.createAttribute(e,t.ARRAY_BUFFER)}updateAttribute(e){this.attributeUtils.updateAttribute(e)}destroyAttribute(e){this.attributeUtils.destroyAttribute(e)}updateSize(){}hasFeature(e){const t=Object.keys(eB).filter((t=>eB[t]===e)),n=this.extensions;for(let e=0;e<t.length;e++)if(n.has(t[e]))return!0;return!1}getMaxAnisotropy(){return this.capabilities.getMaxAnisotropy()}copyTextureToTexture(e,t,n,r,i){this.textureUtils.copyTextureToTexture(e,t,n,r,i)}copyFramebufferToTexture(e,t,n){this.textureUtils.copyFramebufferToTexture(e,t,n)}_setFramebuffer(e){const{gl:t,state:n}=this;let r=null;if(null!==e.textures){const i=e.renderTarget,s=this.get(i),{samples:a,depthBuffer:o,stencilBuffer:l}=i,u=!0===i.isWebGLCubeRenderTarget;let c=s.msaaFrameBuffer,A=s.depthRenderbuffer;const h=mD(e);let d;if(u?(s.cubeFramebuffers||(s.cubeFramebuffers={}),d=s.cubeFramebuffers[h]):(s.framebuffers||(s.framebuffers={}),d=s.framebuffers[h]),void 0===d){d=t.createFramebuffer(),n.bindFramebuffer(t.FRAMEBUFFER,d);const r=e.textures;if(u){s.cubeFramebuffers[h]=d;const{textureGPU:e}=this.get(r[0]),n=this.renderer._activeCubeFace;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+n,e,0)}else{s.framebuffers[h]=d;for(let n=0;n<r.length;n++){const i=r[n],s=this.get(i);s.renderTarget=e.renderTarget,s.cacheKey=h;const a=t.COLOR_ATTACHMENT0+n;t.framebufferTexture2D(t.FRAMEBUFFER,a,t.TEXTURE_2D,s.textureGPU,0)}n.drawBuffers(e,d)}if(null!==e.depthTexture){const n=this.get(e.depthTexture),r=l?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;n.renderTarget=e.renderTarget,n.cacheKey=h,t.framebufferTexture2D(t.FRAMEBUFFER,r,t.TEXTURE_2D,n.textureGPU,0)}}if(a>0){if(void 0===c){const r=[];c=t.createFramebuffer(),n.bindFramebuffer(t.FRAMEBUFFER,c);const i=[],u=e.textures;for(let n=0;n<u.length;n++){if(i[n]=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,i[n]),r.push(t.COLOR_ATTACHMENT0+n),o){const e=l?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;r.push(e)}const s=e.textures[n],u=this.get(s);t.renderbufferStorageMultisample(t.RENDERBUFFER,a,u.glInternalFormat,e.width,e.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+n,t.RENDERBUFFER,i[n])}if(s.msaaFrameBuffer=c,s.msaaRenderbuffers=i,void 0===A){A=t.createRenderbuffer(),this.textureUtils.setupRenderBufferStorage(A,e),s.depthRenderbuffer=A;const n=l?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;r.push(n)}s.invalidationArray=r}r=s.msaaFrameBuffer}else r=d}n.bindFramebuffer(t.FRAMEBUFFER,r)}_getVaoKey(e,t){let n=[];if(null!==e){n+=":"+this.get(e).id}for(let e=0;e<t.length;e++){n+=":"+this.get(t[e]).id}return n}_createVao(e,t){const{gl:n}=this,r=n.createVertexArray();let i="",s=!0;if(n.bindVertexArray(r),null!==e){const t=this.get(e);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.bufferGPU),i+=":"+t.id}for(let e=0;e<t.length;e++){const r=t[e],a=this.get(r);let o,l;i+=":"+a.id,n.bindBuffer(n.ARRAY_BUFFER,a.bufferGPU),n.enableVertexAttribArray(e),(r.isStorageBufferAttribute||r.isStorageInstancedBufferAttribute)&&(s=!1),!0===r.isInterleavedBufferAttribute?(o=r.data.stride*a.bytesPerElement,l=r.offset*a.bytesPerElement):(o=0,l=0),a.isInteger?n.vertexAttribIPointer(e,r.itemSize,a.type,o,l):n.vertexAttribPointer(e,r.itemSize,a.type,r.normalized,o,l),r.isInstancedBufferAttribute&&!r.isInterleavedBufferAttribute?n.vertexAttribDivisor(e,r.meshPerAttribute):r.isInterleavedBufferAttribute&&r.data.isInstancedInterleavedBuffer&&n.vertexAttribDivisor(e,r.data.meshPerAttribute)}return n.bindBuffer(n.ARRAY_BUFFER,null),this.vaoCache[i]=r,{vaoGPU:r,staticVao:s}}_getTransformFeedback(e){let t="";for(let n=0;n<e.length;n++)t+=":"+e[n].id;let n=this.transformFeedbackCache[t];if(void 0!==n)return n;const{gl:r}=this;n=r.createTransformFeedback(),r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,n);for(let t=0;t<e.length;t++){const n=e[t];r.bindBufferBase(r.TRANSFORM_FEEDBACK_BUFFER,t,n.transformBuffer)}return r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,null),this.transformFeedbackCache[t]=n,n}_setupBindings(e,t){const n=this.gl;for(const r of e)for(const e of r.bindings){const r=this.get(e).index;if(e.isUniformsGroup||e.isUniformBuffer){const i=n.getUniformBlockIndex(t,e.name);n.uniformBlockBinding(t,i,r)}else if(e.isSampledTexture){const i=n.getUniformLocation(t,e.name);n.uniform1i(i,r)}}}_bindUniforms(e){const{gl:t,state:n}=this;for(const r of e)for(const e of r.bindings){const r=this.get(e),i=r.index;e.isUniformsGroup||e.isUniformBuffer?n.bindBufferBase(t.UNIFORM_BUFFER,i,r.bufferGPU):e.isSampledTexture&&n.bindTexture(r.glTextureType,r.textureGPU,t.TEXTURE0+i)}}dispose(){this.renderer.domElement.removeEventListener("webglcontextlost",this._onContextLost)}}const rB="point-list",iB="line-list",sB="line-strip",aB="triangle-list",oB="triangle-strip",lB="never",uB="less",cB="equal",AB="less-equal",hB="greater",dB="not-equal",pB="greater-equal",fB="always",mB="store",gB="load",vB="clear",_B="ccw",yB="none",xB="front",bB="back",SB="uint16",TB="uint32",wB={R8Unorm:"r8unorm",R8Snorm:"r8snorm",R8Uint:"r8uint",R8Sint:"r8sint",R16Uint:"r16uint",R16Sint:"r16sint",R16Float:"r16float",RG8Unorm:"rg8unorm",RG8Snorm:"rg8snorm",RG8Uint:"rg8uint",RG8Sint:"rg8sint",R32Uint:"r32uint",R32Sint:"r32sint",R32Float:"r32float",RG16Uint:"rg16uint",RG16Sint:"rg16sint",RG16Float:"rg16float",RGBA8Unorm:"rgba8unorm",RGBA8UnormSRGB:"rgba8unorm-srgb",RGBA8Snorm:"rgba8snorm",RGBA8Uint:"rgba8uint",RGBA8Sint:"rgba8sint",BGRA8Unorm:"bgra8unorm",BGRA8UnormSRGB:"bgra8unorm-srgb",RGB9E5UFloat:"rgb9e5ufloat",RGB10A2Unorm:"rgb10a2unorm",RG11B10uFloat:"rgb10a2unorm",RG32Uint:"rg32uint",RG32Sint:"rg32sint",RG32Float:"rg32float",RGBA16Uint:"rgba16uint",RGBA16Sint:"rgba16sint",RGBA16Float:"rgba16float",RGBA32Uint:"rgba32uint",RGBA32Sint:"rgba32sint",RGBA32Float:"rgba32float",Stencil8:"stencil8",Depth16Unorm:"depth16unorm",Depth24Plus:"depth24plus",Depth24PlusStencil8:"depth24plus-stencil8",Depth32Float:"depth32float",Depth32FloatStencil8:"depth32float-stencil8",BC1RGBAUnorm:"bc1-rgba-unorm",BC1RGBAUnormSRGB:"bc1-rgba-unorm-srgb",BC2RGBAUnorm:"bc2-rgba-unorm",BC2RGBAUnormSRGB:"bc2-rgba-unorm-srgb",BC3RGBAUnorm:"bc3-rgba-unorm",BC3RGBAUnormSRGB:"bc3-rgba-unorm-srgb",BC4RUnorm:"bc4-r-unorm",BC4RSnorm:"bc4-r-snorm",BC5RGUnorm:"bc5-rg-unorm",BC5RGSnorm:"bc5-rg-snorm",BC6HRGBUFloat:"bc6h-rgb-ufloat",BC6HRGBFloat:"bc6h-rgb-float",BC7RGBAUnorm:"bc7-rgba-unorm",BC7RGBAUnormSRGB:"bc7-rgba-srgb",ETC2RGB8Unorm:"etc2-rgb8unorm",ETC2RGB8UnormSRGB:"etc2-rgb8unorm-srgb",ETC2RGB8A1Unorm:"etc2-rgb8a1unorm",ETC2RGB8A1UnormSRGB:"etc2-rgb8a1unorm-srgb",ETC2RGBA8Unorm:"etc2-rgba8unorm",ETC2RGBA8UnormSRGB:"etc2-rgba8unorm-srgb",EACR11Unorm:"eac-r11unorm",EACR11Snorm:"eac-r11snorm",EACRG11Unorm:"eac-rg11unorm",EACRG11Snorm:"eac-rg11snorm",ASTC4x4Unorm:"astc-4x4-unorm",ASTC4x4UnormSRGB:"astc-4x4-unorm-srgb",ASTC5x4Unorm:"astc-5x4-unorm",ASTC5x4UnormSRGB:"astc-5x4-unorm-srgb",ASTC5x5Unorm:"astc-5x5-unorm",ASTC5x5UnormSRGB:"astc-5x5-unorm-srgb",ASTC6x5Unorm:"astc-6x5-unorm",ASTC6x5UnormSRGB:"astc-6x5-unorm-srgb",ASTC6x6Unorm:"astc-6x6-unorm",ASTC6x6UnormSRGB:"astc-6x6-unorm-srgb",ASTC8x5Unorm:"astc-8x5-unorm",ASTC8x5UnormSRGB:"astc-8x5-unorm-srgb",ASTC8x6Unorm:"astc-8x6-unorm",ASTC8x6UnormSRGB:"astc-8x6-unorm-srgb",ASTC8x8Unorm:"astc-8x8-unorm",ASTC8x8UnormSRGB:"astc-8x8-unorm-srgb",ASTC10x5Unorm:"astc-10x5-unorm",ASTC10x5UnormSRGB:"astc-10x5-unorm-srgb",ASTC10x6Unorm:"astc-10x6-unorm",ASTC10x6UnormSRGB:"astc-10x6-unorm-srgb",ASTC10x8Unorm:"astc-10x8-unorm",ASTC10x8UnormSRGB:"astc-10x8-unorm-srgb",ASTC10x10Unorm:"astc-10x10-unorm",ASTC10x10UnormSRGB:"astc-10x10-unorm-srgb",ASTC12x10Unorm:"astc-12x10-unorm",ASTC12x10UnormSRGB:"astc-12x10-unorm-srgb",ASTC12x12Unorm:"astc-12x12-unorm",ASTC12x12UnormSRGB:"astc-12x12-unorm-srgb"},MB="clamp-to-edge",EB="repeat",CB="mirror-repeat",RB="linear",NB="nearest",PB="zero",DB="one",LB="src",IB="one-minus-src",UB="src-alpha",BB="one-minus-src-alpha",OB="dst",FB="one-minus-dst",kB="dst-alpha",qB="one-minus-dst-alpha",GB="src-alpha-saturated",zB="constant",VB="one-minus-constant",HB="add",jB="subtract",WB="reverse-subtract",XB="min",QB="max",YB=0,$B=15,KB="keep",ZB="zero",JB="replace",eO="invert",tO="increment-clamp",nO="decrement-clamp",rO="increment-wrap",iO="decrement-wrap",sO="storage",aO="read-only-storage",oO="write-only",lO="read-only",uO="read-write",cO="float",AO="unfilterable-float",hO="depth",dO="sint",pO="uint",fO="2d",mO="3d",gO="2d",vO="2d-array",_O="cube",yO="3d",xO="all",bO="vertex",SO="instance",TO={DepthClipControl:"depth-clip-control",Depth32FloatStencil8:"depth32float-stencil8",TextureCompressionBC:"texture-compression-bc",TextureCompressionETC2:"texture-compression-etc2",TextureCompressionASTC:"texture-compression-astc",TimestampQuery:"timestamp-query",IndirectFirstInstance:"indirect-first-instance",ShaderF16:"shader-f16",RG11B10UFloat:"rg11b10ufloat-renderable",BGRA8UNormStorage:"bgra8unorm-storage",Float32Filterable:"float32-filterable",ClipDistances:"clip-distances",DualSourceBlending:"dual-source-blending",Subgroups:"subgroups"};class wO extends gU{constructor(e,t){super(e),this.texture=t,this.version=t?t.version:0,this.isSampler=!0}}class MO extends wO{constructor(e,t,n){super(e,t?t.value:null),this.textureNode=t,this.groupNode=n}update(){this.texture=this.textureNode.value}}class EO extends vU{constructor(e,t){super(e,t?t.array:null),this.attribute=t,this.isStorageBuffer=!0}}let CO=0;class RO extends EO{constructor(e,t){super("StorageBuffer_"+CO++,e?e.value:null),this.nodeUniform=e,this.access=e?e.access:vb,this.groupNode=t}get buffer(){return this.nodeUniform.value}}class NO extends jP{constructor(e){super(),this.device=e;this.mipmapSampler=e.createSampler({minFilter:RB}),this.flipYSampler=e.createSampler({minFilter:NB}),this.transferPipelines={},this.flipYPipelines={},this.mipmapVertexShaderModule=e.createShaderModule({label:"mipmapVertex",code:"\nstruct VarysStruct {\n\t@builtin( position ) Position: vec4<f32>,\n\t@location( 0 ) vTex : vec2<f32>\n};\n\n@vertex\nfn main( @builtin( vertex_index ) vertexIndex : u32 ) -> VarysStruct {\n\n\tvar Varys : VarysStruct;\n\n\tvar pos = array< vec2<f32>, 4 >(\n\t\tvec2<f32>( -1.0, 1.0 ),\n\t\tvec2<f32>( 1.0, 1.0 ),\n\t\tvec2<f32>( -1.0, -1.0 ),\n\t\tvec2<f32>( 1.0, -1.0 )\n\t);\n\n\tvar tex = array< vec2<f32>, 4 >(\n\t\tvec2<f32>( 0.0, 0.0 ),\n\t\tvec2<f32>( 1.0, 0.0 ),\n\t\tvec2<f32>( 0.0, 1.0 ),\n\t\tvec2<f32>( 1.0, 1.0 )\n\t);\n\n\tVarys.vTex = tex[ vertexIndex ];\n\tVarys.Position = vec4<f32>( pos[ vertexIndex ], 0.0, 1.0 );\n\n\treturn Varys;\n\n}\n"}),this.mipmapFragmentShaderModule=e.createShaderModule({label:"mipmapFragment",code:"\n@group( 0 ) @binding( 0 )\nvar imgSampler : sampler;\n\n@group( 0 ) @binding( 1 )\nvar img : texture_2d<f32>;\n\n@fragment\nfn main( @location( 0 ) vTex : vec2<f32> ) -> @location( 0 ) vec4<f32> {\n\n\treturn textureSample( img, imgSampler, vTex );\n\n}\n"}),this.flipYFragmentShaderModule=e.createShaderModule({label:"flipYFragment",code:"\n@group( 0 ) @binding( 0 )\nvar imgSampler : sampler;\n\n@group( 0 ) @binding( 1 )\nvar img : texture_2d<f32>;\n\n@fragment\nfn main( @location( 0 ) vTex : vec2<f32> ) -> @location( 0 ) vec4<f32> {\n\n\treturn textureSample( img, imgSampler, vec2( vTex.x, 1.0 - vTex.y ) );\n\n}\n"})}getTransferPipeline(e){let t=this.transferPipelines[e];return void 0===t&&(t=this.device.createRenderPipeline({label:`mipmap-${e}`,vertex:{module:this.mipmapVertexShaderModule,entryPoint:"main"},fragment:{module:this.mipmapFragmentShaderModule,entryPoint:"main",targets:[{format:e}]},primitive:{topology:oB,stripIndexFormat:TB},layout:"auto"}),this.transferPipelines[e]=t),t}getFlipYPipeline(e){let t=this.flipYPipelines[e];return void 0===t&&(t=this.device.createRenderPipeline({label:`flipY-${e}`,vertex:{module:this.mipmapVertexShaderModule,entryPoint:"main"},fragment:{module:this.flipYFragmentShaderModule,entryPoint:"main",targets:[{format:e}]},primitive:{topology:oB,stripIndexFormat:TB},layout:"auto"}),this.flipYPipelines[e]=t),t}flipY(e,t,n=0){const r=t.format,{width:i,height:s}=t.size,a=this.getTransferPipeline(r),o=this.getFlipYPipeline(r),l=this.device.createTexture({size:{width:i,height:s,depthOrArrayLayers:1},format:r,usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING}),u=e.createView({baseMipLevel:0,mipLevelCount:1,dimension:gO,baseArrayLayer:n}),c=l.createView({baseMipLevel:0,mipLevelCount:1,dimension:gO,baseArrayLayer:0}),A=this.device.createCommandEncoder({}),h=(e,t,n)=>{const r=e.getBindGroupLayout(0),i=this.device.createBindGroup({layout:r,entries:[{binding:0,resource:this.flipYSampler},{binding:1,resource:t}]}),s=A.beginRenderPass({colorAttachments:[{view:n,loadOp:vB,storeOp:mB,clearValue:[0,0,0,0]}]});s.setPipeline(e),s.setBindGroup(0,i),s.draw(4,1,0,0),s.end()};h(a,u,c),h(o,c,u),this.device.queue.submit([A.finish()]),l.destroy()}generateMipmaps(e,t,n=0){const r=this.get(e);void 0===r.useCount&&(r.useCount=0,r.layers=[]);const i=r.layers[n]||this._mipmapCreateBundles(e,t,n),s=this.device.createCommandEncoder({});this._mipmapRunBundles(s,i),this.device.queue.submit([s.finish()]),0!==r.useCount&&(r.layers[n]=i),r.useCount++}_mipmapCreateBundles(e,t,n){const r=this.getTransferPipeline(t.format),i=r.getBindGroupLayout(0);let s=e.createView({baseMipLevel:0,mipLevelCount:1,dimension:gO,baseArrayLayer:n});const a=[];for(let o=1;o<t.mipLevelCount;o++){const l=this.device.createBindGroup({layout:i,entries:[{binding:0,resource:this.mipmapSampler},{binding:1,resource:s}]}),u=e.createView({baseMipLevel:o,mipLevelCount:1,dimension:gO,baseArrayLayer:n}),c={colorAttachments:[{view:u,loadOp:vB,storeOp:mB,clearValue:[0,0,0,0]}]},A=this.device.createRenderBundleEncoder({colorFormats:[t.format]});A.setPipeline(r),A.setBindGroup(0,l),A.draw(4,1,0,0),a.push({renderBundles:[A.finish()],passDescriptor:c}),s=u}return a}_mipmapRunBundles(e,t){const n=t.length;for(let r=0;r<n;r++){const n=t[r],i=e.beginRenderPass(n.passDescriptor);i.executeBundles(n.renderBundles),i.end()}}}const PO={[lt]:"never",[ut]:"less",[ct]:"equal",[At]:"less-equal",[ht]:"greater",[pt]:"greater-equal",[ft]:"always",[dt]:"not-equal"},DO=[0,1,3,2,4,5];class LO{constructor(e){this.backend=e,this._passUtils=null,this.defaultTexture={},this.defaultCubeTexture={},this.defaultVideoFrame=null,this.colorBuffer=null,this.depthTexture=new rs,this.depthTexture.name="depthBuffer"}createSampler(e){const t=this.backend,n=t.device,r=t.get(e),i={addressModeU:this._convertAddressMode(e.wrapS),addressModeV:this._convertAddressMode(e.wrapT),addressModeW:this._convertAddressMode(e.wrapR),magFilter:this._convertFilterMode(e.magFilter),minFilter:this._convertFilterMode(e.minFilter),mipmapFilter:this._convertFilterMode(e.minFilter),maxAnisotropy:1};i.magFilter===RB&&i.minFilter===RB&&i.mipmapFilter===RB&&(i.maxAnisotropy=e.anisotropy),e.isDepthTexture&&null!==e.compareFunction&&(i.compare=PO[e.compareFunction]),r.sampler=n.createSampler(i)}createDefaultTexture(e){let t;const n=IO(e);e.isCubeTexture?t=this._getDefaultCubeTextureGPU(n):e.isVideoTexture?this.backend.get(e).externalTexture=this._getDefaultVideoFrame():t=this._getDefaultTextureGPU(n),this.backend.get(e).texture=t}createTexture(e,t={}){const n=this.backend,r=n.get(e);if(r.initialized)throw new Error("WebGPUTextureUtils: Texture already initialized.");void 0===t.needsMipmaps&&(t.needsMipmaps=!1),void 0===t.levels&&(t.levels=1),void 0===t.depth&&(t.depth=1);const{width:i,height:s,depth:a,levels:o}=t;e.isFramebufferTexture&&(t.renderTarget?t.format=this.backend.utils.getCurrentColorFormat(t.renderTarget):t.format=this.backend.utils.getPreferredCanvasFormat());const l=this._getDimension(e),u=e.internalFormat||t.format||IO(e,n.device);r.format=u;let c=void 0!==t.sampleCount?t.sampleCount:1;c=n.utils.getSampleCount(c);const A=e.isRenderTargetTexture&&!e.isMultisampleRenderTargetTexture?1:c;let h=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC;!0===e.isStorageTexture&&(h|=GPUTextureUsage.STORAGE_BINDING),!0!==e.isCompressedTexture&&!0!==e.isCompressedArrayTexture&&(h|=GPUTextureUsage.RENDER_ATTACHMENT);const d={label:e.name,size:{width:i,height:s,depthOrArrayLayers:a},mipLevelCount:o,sampleCount:A,dimension:l,format:u,usage:h};if(e.isVideoTexture){const t=e.source.data,n=new VideoFrame(t);d.size.width=n.displayWidth,d.size.height=n.displayHeight,n.close(),r.externalTexture=t}else{if(void 0===u)return console.warn("WebGPURenderer: Texture format not supported."),this.createDefaultTexture(e);r.texture=n.device.createTexture(d)}if(e.isRenderTargetTexture&&c>1&&!e.isMultisampleRenderTargetTexture){const e=Object.assign({},d);e.label=e.label+"-msaa",e.sampleCount=c,r.msaaTexture=n.device.createTexture(e)}r.initialized=!0,r.textureDescriptorGPU=d}destroyTexture(e){const t=this.backend,n=t.get(e);void 0!==n.texture&&n.texture.destroy(),void 0!==n.msaaTexture&&n.msaaTexture.destroy(),t.delete(e)}destroySampler(e){delete this.backend.get(e).sampler}generateMipmaps(e){const t=this.backend.get(e);if(e.isCubeTexture)for(let e=0;e<6;e++)this._generateMipmaps(t.texture,t.textureDescriptorGPU,e);else{const n=e.image.depth||1;for(let e=0;e<n;e++)this._generateMipmaps(t.texture,t.textureDescriptorGPU,e)}}getColorBuffer(){this.colorBuffer&&this.colorBuffer.destroy();const e=this.backend,{width:t,height:n}=e.getDrawingBufferSize();return this.colorBuffer=e.device.createTexture({label:"colorBuffer",size:{width:t,height:n,depthOrArrayLayers:1},sampleCount:e.utils.getSampleCount(e.renderer.samples),format:e.utils.getPreferredCanvasFormat(),usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC}),this.colorBuffer}getDepthBuffer(e=!0,t=!1){const n=this.backend,{width:r,height:i}=n.getDrawingBufferSize(),s=this.depthTexture,a=n.get(s).texture;let o,l;if(t?(o=ve,l=ce):e&&(o=ge,l=se),void 0!==a){if(s.image.width===r&&s.image.height===i&&s.format===o&&s.type===l)return a;this.destroyTexture(s)}return s.name="depthBuffer",s.format=o,s.type=l,s.image.width=r,s.image.height=i,this.createTexture(s,{sampleCount:n.utils.getSampleCount(n.renderer.samples),width:r,height:i}),n.get(s).texture}updateTexture(e,t){const n=this.backend.get(e),{textureDescriptorGPU:r}=n;if(!e.isRenderTargetTexture&&void 0!==r){if(e.isDataTexture)this._copyBufferToTexture(t.image,n.texture,r,0,e.flipY);else if(e.isDataArrayTexture||e.isData3DTexture)for(let i=0;i<t.image.depth;i++)this._copyBufferToTexture(t.image,n.texture,r,i,e.flipY,i);else if(e.isCompressedTexture||e.isCompressedArrayTexture)this._copyCompressedBufferToTexture(e.mipmaps,n.texture,r);else if(e.isCubeTexture)this._copyCubeMapToTexture(t.images,n.texture,r,e.flipY);else if(e.isVideoTexture){const t=e.source.data;n.externalTexture=t}else this._copyImageToTexture(t.image,n.texture,r,0,e.flipY);n.version=e.version,e.onUpdate&&e.onUpdate(e)}}async copyTextureToBuffer(e,t,n,r,i,s){const a=this.backend.device,o=this.backend.get(e),l=o.texture,u=o.textureDescriptorGPU.format,c=this._getBytesPerTexel(u);let A=r*c;A=256*Math.ceil(A/256);const h=a.createBuffer({size:r*i*c,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),d=a.createCommandEncoder();d.copyTextureToBuffer({texture:l,origin:{x:t,y:n,z:s}},{buffer:h,bytesPerRow:A},{width:r,height:i});const p=this._getTypedArrayType(u);a.queue.submit([d.finish()]),await h.mapAsync(GPUMapMode.READ);return new p(h.getMappedRange())}_isEnvironmentTexture(e){const t=e.mapping;return t===z||t===V||t===q||t===G}_getDefaultTextureGPU(e){let t=this.defaultTexture[e];if(void 0===t){const n=new Jt;n.minFilter=Q,n.magFilter=Q,this.createTexture(n,{width:1,height:1,format:e}),this.defaultTexture[e]=t=n}return this.backend.get(t).texture}_getDefaultCubeTextureGPU(e){let t=this.defaultTexture[e];if(void 0===t){const n=new wi;n.minFilter=Q,n.magFilter=Q,this.createTexture(n,{width:1,height:1,depth:6}),this.defaultCubeTexture[e]=t=n}return this.backend.get(t).texture}_getDefaultVideoFrame(){let e=this.defaultVideoFrame;if(null===e){const t={timestamp:0,codedWidth:1,codedHeight:1,format:"RGBA"};this.defaultVideoFrame=e=new VideoFrame(new Uint8Array([0,0,0,255]),t)}return e}_copyCubeMapToTexture(e,t,n,r){for(let i=0;i<6;i++){const s=e[i],a=!0===r?DO[i]:i;s.isDataTexture?this._copyBufferToTexture(s.image,t,n,a,r):this._copyImageToTexture(s,t,n,a,r)}}_copyImageToTexture(e,t,n,r,i){this.backend.device.queue.copyExternalImageToTexture({source:e},{texture:t,mipLevel:0,origin:{x:0,y:0,z:r}},{width:e.width,height:e.height,depthOrArrayLayers:1}),!0===i&&this._flipY(t,n,r)}_getPassUtils(){let e=this._passUtils;return null===e&&(this._passUtils=e=new NO(this.backend.device)),e}_generateMipmaps(e,t,n=0){this._getPassUtils().generateMipmaps(e,t,n)}_flipY(e,t,n=0){this._getPassUtils().flipY(e,t,n)}_copyBufferToTexture(e,t,n,r,i,s=0){const a=this.backend.device,o=e.data,l=this._getBytesPerTexel(n.format),u=e.width*l;a.queue.writeTexture({texture:t,mipLevel:0,origin:{x:0,y:0,z:r}},o,{offset:e.width*e.height*l*s,bytesPerRow:u},{width:e.width,height:e.height,depthOrArrayLayers:1}),!0===i&&this._flipY(t,n,r)}_copyCompressedBufferToTexture(e,t,n){const r=this.backend.device,i=this._getBlockData(n.format),s=n.size.depthOrArrayLayers>1;for(let a=0;a<e.length;a++){const o=e[a],l=o.width,u=o.height,c=s?n.size.depthOrArrayLayers:1,A=Math.ceil(l/i.width)*i.byteLength,h=A*Math.ceil(u/i.height);for(let e=0;e<c;e++)r.queue.writeTexture({texture:t,mipLevel:a,origin:{x:0,y:0,z:e}},o.data,{offset:e*h,bytesPerRow:A,rowsPerImage:Math.ceil(u/i.height)},{width:Math.ceil(l/i.width)*i.width,height:Math.ceil(u/i.height)*i.height,depthOrArrayLayers:1})}}_getBlockData(e){return e===wB.BC1RGBAUnorm||e===wB.BC1RGBAUnormSRGB?{byteLength:8,width:4,height:4}:e===wB.BC2RGBAUnorm||e===wB.BC2RGBAUnormSRGB||e===wB.BC3RGBAUnorm||e===wB.BC3RGBAUnormSRGB?{byteLength:16,width:4,height:4}:e===wB.BC4RUnorm||e===wB.BC4RSNorm?{byteLength:8,width:4,height:4}:e===wB.BC5RGUnorm||e===wB.BC5RGSnorm||e===wB.BC6HRGBUFloat||e===wB.BC6HRGBFloat||e===wB.BC7RGBAUnorm||e===wB.BC7RGBAUnormSRGB?{byteLength:16,width:4,height:4}:e===wB.ETC2RGB8Unorm||e===wB.ETC2RGB8UnormSRGB||e===wB.ETC2RGB8A1Unorm||e===wB.ETC2RGB8A1UnormSRGB?{byteLength:8,width:4,height:4}:e===wB.ETC2RGBA8Unorm||e===wB.ETC2RGBA8UnormSRGB?{byteLength:16,width:4,height:4}:e===wB.EACR11Unorm||e===wB.EACR11Snorm?{byteLength:8,width:4,height:4}:e===wB.EACRG11Unorm||e===wB.EACRG11Snorm||e===wB.ASTC4x4Unorm||e===wB.ASTC4x4UnormSRGB?{byteLength:16,width:4,height:4}:e===wB.ASTC5x4Unorm||e===wB.ASTC5x4UnormSRGB?{byteLength:16,width:5,height:4}:e===wB.ASTC5x5Unorm||e===wB.ASTC5x5UnormSRGB?{byteLength:16,width:5,height:5}:e===wB.ASTC6x5Unorm||e===wB.ASTC6x5UnormSRGB?{byteLength:16,width:6,height:5}:e===wB.ASTC6x6Unorm||e===wB.ASTC6x6UnormSRGB?{byteLength:16,width:6,height:6}:e===wB.ASTC8x5Unorm||e===wB.ASTC8x5UnormSRGB?{byteLength:16,width:8,height:5}:e===wB.ASTC8x6Unorm||e===wB.ASTC8x6UnormSRGB?{byteLength:16,width:8,height:6}:e===wB.ASTC8x8Unorm||e===wB.ASTC8x8UnormSRGB?{byteLength:16,width:8,height:8}:e===wB.ASTC10x5Unorm||e===wB.ASTC10x5UnormSRGB?{byteLength:16,width:10,height:5}:e===wB.ASTC10x6Unorm||e===wB.ASTC10x6UnormSRGB?{byteLength:16,width:10,height:6}:e===wB.ASTC10x8Unorm||e===wB.ASTC10x8UnormSRGB?{byteLength:16,width:10,height:8}:e===wB.ASTC10x10Unorm||e===wB.ASTC10x10UnormSRGB?{byteLength:16,width:10,height:10}:e===wB.ASTC12x10Unorm||e===wB.ASTC12x10UnormSRGB?{byteLength:16,width:12,height:10}:e===wB.ASTC12x12Unorm||e===wB.ASTC12x12UnormSRGB?{byteLength:16,width:12,height:12}:void 0}_convertAddressMode(e){let t=MB;return e===j?t=EB:e===X&&(t=CB),t}_convertFilterMode(e){let t=RB;return e!==Q&&e!==Y&&e!==$||(t=NB),t}_getBytesPerTexel(e){return e===wB.R8Unorm||e===wB.R8Snorm||e===wB.R8Uint||e===wB.R8Sint?1:e===wB.R16Uint||e===wB.R16Sint||e===wB.R16Float||e===wB.RG8Unorm||e===wB.RG8Snorm||e===wB.RG8Uint||e===wB.RG8Sint?2:e===wB.R32Uint||e===wB.R32Sint||e===wB.R32Float||e===wB.RG16Uint||e===wB.RG16Sint||e===wB.RG16Float||e===wB.RGBA8Unorm||e===wB.RGBA8UnormSRGB||e===wB.RGBA8Snorm||e===wB.RGBA8Uint||e===wB.RGBA8Sint||e===wB.BGRA8Unorm||e===wB.BGRA8UnormSRGB||e===wB.RGB9E5UFloat||e===wB.RGB10A2Unorm||e===wB.RG11B10UFloat||e===wB.Depth32Float||e===wB.Depth24Plus||e===wB.Depth24PlusStencil8||e===wB.Depth32FloatStencil8?4:e===wB.RG32Uint||e===wB.RG32Sint||e===wB.RG32Float||e===wB.RGBA16Uint||e===wB.RGBA16Sint||e===wB.RGBA16Float?8:e===wB.RGBA32Uint||e===wB.RGBA32Sint||e===wB.RGBA32Float?16:void 0}_getTypedArrayType(e){return e===wB.R8Uint?Uint8Array:e===wB.R8Sint?Int8Array:e===wB.R8Unorm?Uint8Array:e===wB.R8Snorm?Int8Array:e===wB.RG8Uint?Uint8Array:e===wB.RG8Sint?Int8Array:e===wB.RG8Unorm?Uint8Array:e===wB.RG8Snorm?Int8Array:e===wB.RGBA8Uint?Uint8Array:e===wB.RGBA8Sint?Int8Array:e===wB.RGBA8Unorm?Uint8Array:e===wB.RGBA8Snorm?Int8Array:e===wB.R16Uint?Uint16Array:e===wB.R16Sint?Int16Array:e===wB.RG16Uint?Uint16Array:e===wB.RG16Sint?Int16Array:e===wB.RGBA16Uint?Uint16Array:e===wB.RGBA16Sint?Int16Array:e===wB.R16Float||e===wB.RG16Float||e===wB.RGBA16Float?Uint16Array:e===wB.R32Uint?Uint32Array:e===wB.R32Sint?Int32Array:e===wB.R32Float?Float32Array:e===wB.RG32Uint?Uint32Array:e===wB.RG32Sint?Int32Array:e===wB.RG32Float?Float32Array:e===wB.RGBA32Uint?Uint32Array:e===wB.RGBA32Sint?Int32Array:e===wB.RGBA32Float?Float32Array:e===wB.BGRA8Unorm||e===wB.BGRA8UnormSRGB?Uint8Array:e===wB.RGB10A2Unorm||e===wB.RGB9E5UFloat||e===wB.RG11B10UFloat?Uint32Array:e===wB.Depth32Float?Float32Array:e===wB.Depth24Plus||e===wB.Depth24PlusStencil8?Uint32Array:e===wB.Depth32FloatStencil8?Float32Array:void 0}_getDimension(e){let t;return t=e.isData3DTexture?mO:fO,t}}function IO(e,t=null){const n=e.format,r=e.type,i=e.colorSpace;let s;if(!0===e.isCompressedTexture||!0===e.isCompressedArrayTexture)switch(n){case we:s=i===rt?wB.BC1RGBAUnormSRGB:wB.BC1RGBAUnorm;break;case Me:s=i===rt?wB.BC2RGBAUnormSRGB:wB.BC2RGBAUnorm;break;case Ee:s=i===rt?wB.BC3RGBAUnormSRGB:wB.BC3RGBAUnorm;break;case Le:s=i===rt?wB.ETC2RGB8UnormSRGB:wB.ETC2RGB8Unorm;break;case Ie:s=i===rt?wB.ETC2RGBA8UnormSRGB:wB.ETC2RGBA8Unorm;break;case Ue:s=i===rt?wB.ASTC4x4UnormSRGB:wB.ASTC4x4Unorm;break;case Be:s=i===rt?wB.ASTC5x4UnormSRGB:wB.ASTC5x4Unorm;break;case Oe:s=i===rt?wB.ASTC5x5UnormSRGB:wB.ASTC5x5Unorm;break;case Fe:s=i===rt?wB.ASTC6x5UnormSRGB:wB.ASTC6x5Unorm;break;case ke:s=i===rt?wB.ASTC6x6UnormSRGB:wB.ASTC6x6Unorm;break;case qe:s=i===rt?wB.ASTC8x5UnormSRGB:wB.ASTC8x5Unorm;break;case Ge:s=i===rt?wB.ASTC8x6UnormSRGB:wB.ASTC8x6Unorm;break;case ze:s=i===rt?wB.ASTC8x8UnormSRGB:wB.ASTC8x8Unorm;break;case Ve:s=i===rt?wB.ASTC10x5UnormSRGB:wB.ASTC10x5Unorm;break;case He:s=i===rt?wB.ASTC10x6UnormSRGB:wB.ASTC10x6Unorm;break;case je:s=i===rt?wB.ASTC10x8UnormSRGB:wB.ASTC10x8Unorm;break;case We:s=i===rt?wB.ASTC10x10UnormSRGB:wB.ASTC10x10Unorm;break;case Xe:s=i===rt?wB.ASTC12x10UnormSRGB:wB.ASTC12x10Unorm;break;case Qe:s=i===rt?wB.ASTC12x12UnormSRGB:wB.ASTC12x12Unorm;break;case pe:s=i===rt?wB.RGBA8UnormSRGB:wB.RGBA8Unorm;break;default:console.error("WebGPURenderer: Unsupported texture format.",n)}else switch(n){case pe:switch(r){case te:s=wB.RGBA8Snorm;break;case ne:s=wB.RGBA16Sint;break;case re:s=wB.RGBA16Uint;break;case se:s=wB.RGBA32Uint;break;case ie:s=wB.RGBA32Sint;break;case ee:s=i===rt?wB.RGBA8UnormSRGB:wB.RGBA8Unorm;break;case oe:s=wB.RGBA16Float;break;case ae:s=wB.RGBA32Float;break;default:console.error("WebGPURenderer: Unsupported texture type with RGBAFormat.",r)}break;case de:if(r===Ae)s=wB.RGB9E5UFloat;else console.error("WebGPURenderer: Unsupported texture type with RGBFormat.",r);break;case _e:switch(r){case te:s=wB.R8Snorm;break;case ne:s=wB.R16Sint;break;case re:s=wB.R16Uint;break;case se:s=wB.R32Uint;break;case ie:s=wB.R32Sint;break;case ee:s=wB.R8Unorm;break;case oe:s=wB.R16Float;break;case ae:s=wB.R32Float;break;default:console.error("WebGPURenderer: Unsupported texture type with RedFormat.",r)}break;case xe:switch(r){case te:s=wB.RG8Snorm;break;case ne:s=wB.RG16Sint;break;case re:s=wB.RG16Uint;break;case se:s=wB.RG32Uint;break;case ie:s=wB.RG32Sint;break;case ee:s=wB.RG8Unorm;break;case oe:s=wB.RG16Float;break;case ae:s=wB.RG32Float;break;default:console.error("WebGPURenderer: Unsupported texture type with RGFormat.",r)}break;case ge:switch(r){case re:s=wB.Depth16Unorm;break;case se:s=wB.Depth24Plus;break;case ae:s=wB.Depth32Float;break;default:console.error("WebGPURenderer: Unsupported texture type with DepthFormat.",r)}break;case ve:switch(r){case ce:s=wB.Depth24PlusStencil8;break;case ae:t&&!1===t.features.has(TO.Depth32FloatStencil8)&&console.error('WebGPURenderer: Depth textures with DepthStencilFormat + FloatType can only be used with the "depth32float-stencil8" GPU feature.'),s=wB.Depth32FloatStencil8;break;default:console.error("WebGPURenderer: Unsupported texture type with DepthStencilFormat.",r)}break;case ye:switch(r){case ie:s=wB.R32Sint;break;case se:s=wB.R32Uint;break;default:console.error("WebGPURenderer: Unsupported texture type with RedIntegerFormat.",r)}break;case be:switch(r){case ie:s=wB.RG32Sint;break;case se:s=wB.RG32Uint;break;default:console.error("WebGPURenderer: Unsupported texture type with RGIntegerFormat.",r)}break;case Se:switch(r){case ie:s=wB.RGBA32Sint;break;case se:s=wB.RGBA32Uint;break;default:console.error("WebGPURenderer: Unsupported texture type with RGBAIntegerFormat.",r)}break;default:console.error("WebGPURenderer: Unsupported texture format.",n)}return s}const UO=/^[fn]*\s*([a-z_0-9]+)?\s*\(([\s\S]*?)\)\s*[\-\>]*\s*([a-z_0-9]+(?:<[\s\S]+?>)?)/i,BO=/([a-z_0-9]+)\s*:\s*([a-z_0-9]+(?:<[\s\S]+?>)?)/gi,OO={f32:"float",i32:"int",u32:"uint",bool:"bool","vec2<f32>":"vec2","vec2<i32>":"ivec2","vec2<u32>":"uvec2","vec2<bool>":"bvec2",vec2f:"vec2",vec2i:"ivec2",vec2u:"uvec2",vec2b:"bvec2","vec3<f32>":"vec3","vec3<i32>":"ivec3","vec3<u32>":"uvec3","vec3<bool>":"bvec3",vec3f:"vec3",vec3i:"ivec3",vec3u:"uvec3",vec3b:"bvec3","vec4<f32>":"vec4","vec4<i32>":"ivec4","vec4<u32>":"uvec4","vec4<bool>":"bvec4",vec4f:"vec4",vec4i:"ivec4",vec4u:"uvec4",vec4b:"bvec4","mat2x2<f32>":"mat2",mat2x2f:"mat2","mat3x3<f32>":"mat3",mat3x3f:"mat3","mat4x4<f32>":"mat4",mat4x4f:"mat4",sampler:"sampler",texture_1d:"texture",texture_2d:"texture",texture_2d_array:"texture",texture_multisampled_2d:"cubeTexture",texture_depth_2d:"depthTexture",texture_3d:"texture3D",texture_cube:"cubeTexture",texture_cube_array:"cubeTexture",texture_storage_1d:"storageTexture",texture_storage_2d:"storageTexture",texture_storage_2d_array:"storageTexture",texture_storage_3d:"storageTexture"};class FO extends YI{constructor(e){const{type:t,inputs:n,name:r,inputsCode:i,blockCode:s,outputType:a}=(e=>{const t=(e=e.trim()).match(UO);if(null!==t&&4===t.length){const n=t[2],r=[];let i=null;for(;null!==(i=BO.exec(n));)r.push({name:i[1],type:i[2]});const s=[];for(let e=0;e<r.length;e++){const{name:t,type:n}=r[e];let i=n;i.startsWith("ptr")?i="pointer":(i.startsWith("texture")&&(i=n.split("<")[0]),i=OO[i]),s.push(new OI(i,t))}const a=e.substring(t[0].length),o=t[3]||"void",l=void 0!==t[1]?t[1]:"";return{type:OO[o]||o,inputs:s,name:l,inputsCode:n,blockCode:a,outputType:o}}throw new Error("FunctionNode: Function is not a WGSL code.")})(e);super(t,n,r),this.inputsCode=i,this.blockCode=s,this.outputType=a}getCode(e=this.name){const t="void"!==this.outputType?"-> "+this.outputType:"";return`fn ${e} ( ${this.inputsCode.trim()} ) ${t}`+this.blockCode}}class kO extends QI{parseFunction(e){return new FO(e)}}const qO="undefined"!=typeof self?self.GPUShaderStage:{VERTEX:1,FRAGMENT:2,COMPUTE:4},GO={[mb]:"read",[gb]:"write",[vb]:"read_write"},zO={[j]:"repeat",[W]:"clamp",[X]:"mirror"},VO={vertex:qO?qO.VERTEX:1,fragment:qO?qO.FRAGMENT:2,compute:qO?qO.COMPUTE:4},HO={instance:!0,swizzleAssign:!1,storageBuffer:!0},jO={"^^":"tsl_xor"},WO={float:"f32",int:"i32",uint:"u32",bool:"bool",color:"vec3<f32>",vec2:"vec2<f32>",ivec2:"vec2<i32>",uvec2:"vec2<u32>",bvec2:"vec2<bool>",vec3:"vec3<f32>",ivec3:"vec3<i32>",uvec3:"vec3<u32>",bvec3:"vec3<bool>",vec4:"vec4<f32>",ivec4:"vec4<i32>",uvec4:"vec4<u32>",bvec4:"vec4<bool>",mat2:"mat2x2<f32>",mat3:"mat3x3<f32>",mat4:"mat4x4<f32>"},XO={},QO={tsl_xor:new YD("fn tsl_xor( a : bool, b : bool ) -> bool { return ( a || b ) && !( a && b ); }"),mod_float:new YD("fn tsl_mod_float( x : f32, y : f32 ) -> f32 { return x - y * floor( x / y ); }"),mod_vec2:new YD("fn tsl_mod_vec2( x : vec2f, y : vec2f ) -> vec2f { return x - y * floor( x / y ); }"),mod_vec3:new YD("fn tsl_mod_vec3( x : vec3f, y : vec3f ) -> vec3f { return x - y * floor( x / y ); }"),mod_vec4:new YD("fn tsl_mod_vec4( x : vec4f, y : vec4f ) -> vec4f { return x - y * floor( x / y ); }"),equals_bool:new YD("fn tsl_equals_bool( a : bool, b : bool ) -> bool { return a == b; }"),equals_bvec2:new YD("fn tsl_equals_bvec2( a : vec2f, b : vec2f ) -> vec2<bool> { return vec2<bool>( a.x == b.x, a.y == b.y ); }"),equals_bvec3:new YD("fn tsl_equals_bvec3( a : vec3f, b : vec3f ) -> vec3<bool> { return vec3<bool>( a.x == b.x, a.y == b.y, a.z == b.z ); }"),equals_bvec4:new YD("fn tsl_equals_bvec4( a : vec4f, b : vec4f ) -> vec4<bool> { return vec4<bool>( a.x == b.x, a.y == b.y, a.z == b.z, a.w == b.w ); }"),repeatWrapping_float:new YD("fn tsl_repeatWrapping_float( coord: f32 ) -> f32 { return fract( coord ); }"),mirrorWrapping_float:new YD("fn tsl_mirrorWrapping_float( coord: f32 ) -> f32 { let mirrored = fract( coord * 0.5 ) * 2.0; return 1.0 - abs( 1.0 - mirrored ); }"),clampWrapping_float:new YD("fn tsl_clampWrapping_float( coord: f32 ) -> f32 { return clamp( coord, 0.0, 1.0 ); }"),biquadraticTexture:new YD("\nfn tsl_biquadraticTexture( map : texture_2d<f32>, coord : vec2f, iRes : vec2u, level : u32 ) -> vec4f {\n\n\tlet res = vec2f( iRes );\n\n\tlet uvScaled = coord * res;\n\tlet uvWrapping = ( ( uvScaled % res ) + res ) % res;\n\n\t// https://www.shadertoy.com/view/WtyXRy\n\n\tlet uv = uvWrapping - 0.5;\n\tlet iuv = floor( uv );\n\tlet f = fract( uv );\n\n\tlet rg1 = textureLoad( map, vec2u( iuv + vec2( 0.5, 0.5 ) ) % iRes, level );\n\tlet rg2 = textureLoad( map, vec2u( iuv + vec2( 1.5, 0.5 ) ) % iRes, level );\n\tlet rg3 = textureLoad( map, vec2u( iuv + vec2( 0.5, 1.5 ) ) % iRes, level );\n\tlet rg4 = textureLoad( map, vec2u( iuv + vec2( 1.5, 1.5 ) ) % iRes, level );\n\n\treturn mix( mix( rg1, rg2, f.x ), mix( rg3, rg4, f.x ), f.y );\n\n}\n")},YO={dFdx:"dpdx",dFdy:"- dpdy",mod_float:"tsl_mod_float",mod_vec2:"tsl_mod_vec2",mod_vec3:"tsl_mod_vec3",mod_vec4:"tsl_mod_vec4",equals_bool:"tsl_equals_bool",equals_bvec2:"tsl_equals_bvec2",equals_bvec3:"tsl_equals_bvec3",equals_bvec4:"tsl_equals_bvec4",inversesqrt:"inverseSqrt",bitcast:"bitcast<f32>"};"undefined"!=typeof navigator&&/Windows/g.test(navigator.userAgent)&&(QO.pow_float=new YD("fn tsl_pow_float( a : f32, b : f32 ) -> f32 { return select( -pow( -a, b ), pow( a, b ), a > 0.0 ); }"),QO.pow_vec2=new YD("fn tsl_pow_vec2( a : vec2f, b : vec2f ) -> vec2f { return vec2f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ) ); }",[QO.pow_float]),QO.pow_vec3=new YD("fn tsl_pow_vec3( a : vec3f, b : vec3f ) -> vec3f { return vec3f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ), tsl_pow_float( a.z, b.z ) ); }",[QO.pow_float]),QO.pow_vec4=new YD("fn tsl_pow_vec4( a : vec4f, b : vec4f ) -> vec4f { return vec4f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ), tsl_pow_float( a.z, b.z ), tsl_pow_float( a.w, b.w ) ); }",[QO.pow_float]),YO.pow_float="tsl_pow_float",YO.pow_vec2="tsl_pow_vec2",YO.pow_vec3="tsl_pow_vec3",YO.pow_vec4="tsl_pow_vec4");let $O="";!0!==("undefined"!=typeof navigator&&/Firefox|Deno/g.test(navigator.userAgent))&&($O+="diagnostic( off, derivative_uniformity );\n");class KO extends UI{constructor(e,t){super(e,t,new kO),this.uniformGroups={},this.builtins={},this.directives={},this.scopedArrays=new Map}needsToWorkingColorSpace(e){return!0===e.isVideoTexture&&e.colorSpace!==nt}_generateTextureSample(e,t,n,r,i=this.shaderStage){return"fragment"===i?r?`textureSample( ${t}, ${t}_sampler, ${n}, ${r} )`:`textureSample( ${t}, ${t}_sampler, ${n} )`:this.isFilteredTexture(e)?this.generateFilteredTexture(e,t,n):this.generateTextureLod(e,t,n,r,"0")}_generateVideoSample(e,t,n=this.shaderStage){if("fragment"===n)return`textureSampleBaseClampToEdge( ${e}, ${e}_sampler, vec2<f32>( ${t}.x, 1.0 - ${t}.y ) )`;console.error(`WebGPURenderer: THREE.VideoTexture does not support ${n} shader.`)}_generateTextureSampleLevel(e,t,n,r,i,s=this.shaderStage){return"fragment"===s&&!1===this.isUnfilterable(e)?`textureSampleLevel( ${t}, ${t}_sampler, ${n}, ${r} )`:this.isFilteredTexture(e)?this.generateFilteredTexture(e,t,n,r):this.generateTextureLod(e,t,n,i,r)}generateWrapFunction(e){const t=`tsl_coord_${zO[e.wrapS]}S_${zO[e.wrapT]}T`;let n=XO[t];if(void 0===n){const r=[];let i=`fn ${t}( coord : vec2f ) -> vec2f {\n\n\treturn vec2f(\n`;const s=(e,t)=>{e===j?(r.push(QO.repeatWrapping_float),i+=`\t\ttsl_repeatWrapping_float( coord.${t} )`):e===W?(r.push(QO.clampWrapping_float),i+=`\t\ttsl_clampWrapping_float( coord.${t} )`):e===X?(r.push(QO.mirrorWrapping_float),i+=`\t\ttsl_mirrorWrapping_float( coord.${t} )`):(i+=`\t\tcoord.${t}`,console.warn(`WebGPURenderer: Unsupported texture wrap type "${e}" for vertex shader.`))};s(e.wrapS,"x"),i+=",\n",s(e.wrapT,"y"),i+="\n\t);\n\n}\n",XO[t]=n=new YD(i,r)}return n.build(this),t}generateTextureDimension(e,t,n){const r=this.getDataFromNode(e,this.shaderStage,this.globalCache);void 0===r.dimensionsSnippet&&(r.dimensionsSnippet={});let i=r.dimensionsSnippet[n];if(void 0===r.dimensionsSnippet[n]){let s;s=!0===e.isMultisampleRenderTargetTexture?t:`${t}, u32( ${n} )`,i=new Kw(new TM(`textureDimensions( ${s} )`,"uvec2")),r.dimensionsSnippet[n]=i}return i.build(this)}generateFilteredTexture(e,t,n,r="0u"){this._include("biquadraticTexture");return`tsl_biquadraticTexture( ${t}, ${this.generateWrapFunction(e)}( ${n} ), ${this.generateTextureDimension(e,t,r)}, u32( ${r} ) )`}generateTextureLod(e,t,n,r,i="0u"){const s=`vec2u( ${this.generateWrapFunction(e)}( ${n} ) * vec2f( ${this.generateTextureDimension(e,t,i)} ) )`;return this.generateTextureLoad(e,t,s,r,i)}generateTextureLoad(e,t,n,r,i="0u"){return!0===e.isVideoTexture||!0===e.isStorageTexture?`textureLoad( ${t}, ${n} )`:r?`textureLoad( ${t}, ${n}, ${r}, u32( ${i} ) )`:`textureLoad( ${t}, ${n}, u32( ${i} ) )`}generateTextureStore(e,t,n,r){return`textureStore( ${t}, ${n}, ${r} )`}isSampleCompare(e){return!0===e.isDepthTexture&&null!==e.compareFunction}isUnfilterable(e){return"float"!==this.getComponentTypeFromTexture(e)||!this.isAvailable("float32Filterable")&&!0===e.isDataTexture&&e.type===ae||!1===this.isSampleCompare(e)&&e.minFilter===Q&&e.magFilter===Q||!0===e.isMultisampleRenderTargetTexture}generateTexture(e,t,n,r,i=this.shaderStage){let s=null;return s=!0===e.isVideoTexture?this._generateVideoSample(t,n,i):this.isUnfilterable(e)?this.generateTextureLod(e,t,n,r,"0",i):this._generateTextureSample(e,t,n,r,i),s}generateTextureGrad(e,t,n,r,i,s=this.shaderStage){if("fragment"===s)return`textureSampleGrad( ${t}, ${t}_sampler, ${n}, ${r[0]}, ${r[1]} )`;console.error(`WebGPURenderer: THREE.TextureNode.gradient() does not support ${s} shader.`)}generateTextureCompare(e,t,n,r,i,s=this.shaderStage){if("fragment"===s)return`textureSampleCompare( ${t}, ${t}_sampler, ${n}, ${r} )`;console.error(`WebGPURenderer: THREE.DepthTexture.compareFunction() does not support ${s} shader.`)}generateTextureLevel(e,t,n,r,i,s=this.shaderStage){let a=null;return a=!0===e.isVideoTexture?this._generateVideoSample(t,n,s):this._generateTextureSampleLevel(e,t,n,r,i,s),a}generateTextureBias(e,t,n,r,i,s=this.shaderStage){if("fragment"===s)return`textureSampleBias( ${t}, ${t}_sampler, ${n}, ${r} )`;console.error(`WebGPURenderer: THREE.TextureNode.biasNode does not support ${s} shader.`)}getPropertyName(e,t=this.shaderStage){if(!0===e.isNodeVarying&&!0===e.needsInterpolation){if("vertex"===t)return`varyings.${e.name}`}else if(!0===e.isNodeUniform){const t=e.name,n=e.type;return"texture"===n||"cubeTexture"===n||"storageTexture"===n||"texture3D"===n?t:"buffer"===n||"storageBuffer"===n||"indirectStorageBuffer"===n?`NodeBuffer_${e.id}.${t}`:e.groupNode.name+"."+t}return super.getPropertyName(e)}getOutputStructName(){return"output"}_getUniformGroupCount(e){return Object.keys(this.uniforms[e]).length}getFunctionOperator(e){const t=jO[e];return void 0!==t?(this._include(t),t):null}getNodeAccess(e,t){return"compute"!==t?mb:e.access}getStorageAccess(e,t){return GO[this.getNodeAccess(e,t)]}getUniformFromNode(e,t,n,r=null){const i=super.getUniformFromNode(e,t,n,r),s=this.getDataFromNode(e,n,this.globalCache);if(void 0===s.uniformGPU){let r;const a=e.groupNode,o=a.name,l=this.getBindGroupArray(o,n);if("texture"===t||"cubeTexture"===t||"storageTexture"===t||"texture3D"===t){let s=null;const o=this.getNodeAccess(e,n);if("texture"===t||"storageTexture"===t?s=new EU(i.name,i.node,a,o):"cubeTexture"===t?s=new CU(i.name,i.node,a,o):"texture3D"===t&&(s=new RU(i.name,i.node,a,o)),s.store=!0===e.isStorageTextureNode,s.setVisibility(VO[n]),"fragment"===n&&!1===this.isUnfilterable(e.value)&&!1===s.store){const e=new MO(`${i.name}_sampler`,i.node,a);e.setVisibility(VO[n]),l.push(e,s),r=[e,s]}else l.push(s),r=[s]}else if("buffer"===t||"storageBuffer"===t||"indirectStorageBuffer"===t){const i=new("buffer"===t?xU:RO)(e,a);i.setVisibility(VO[n]),l.push(i),r=i}else{const e=this.uniformGroups[n]||(this.uniformGroups[n]={});let s=e[o];void 0===s&&(s=new TU(o,a),s.setVisibility(VO[n]),e[o]=s,l.push(s)),r=this.getNodeUniform(i,t),s.addUniform(r)}s.uniformGPU=r}return i}getBuiltin(e,t,n,r=this.shaderStage){const i=this.builtins[r]||(this.builtins[r]=new Map);return!1===i.has(e)&&i.set(e,{name:e,property:t,type:n}),t}hasBuiltin(e,t=this.shaderStage){return void 0!==this.builtins[t]&&this.builtins[t].has(e)}getVertexIndex(){return"vertex"===this.shaderStage?this.getBuiltin("vertex_index","vertexIndex","u32","attribute"):"vertexIndex"}buildFunctionCode(e){const t=e.layout,n=this.flowShaderNode(e),r=[];for(const e of t.inputs)r.push(e.name+" : "+this.getType(e.type));let i=`fn ${t.name}( ${r.join(", ")} ) -> ${this.getType(t.type)} {\n${n.vars}\n${n.code}\n`;return n.result&&(i+=`\treturn ${n.result};\n`),i+="\n}\n",i}getInstanceIndex(){return"vertex"===this.shaderStage?this.getBuiltin("instance_index","instanceIndex","u32","attribute"):"instanceIndex"}getInvocationLocalIndex(){return this.getBuiltin("local_invocation_index","invocationLocalIndex","u32","attribute")}getSubgroupSize(){return this.enableSubGroups(),this.getBuiltin("subgroup_size","subgroupSize","u32","attribute")}getInvocationSubgroupIndex(){return this.enableSubGroups(),this.getBuiltin("subgroup_invocation_id","invocationSubgroupIndex","u32","attribute")}getSubgroupIndex(){return this.enableSubGroups(),this.getBuiltin("subgroup_id","subgroupIndex","u32","attribute")}getDrawIndex(){return null}getFrontFacing(){return this.getBuiltin("front_facing","isFront","bool")}getFragCoord(){return this.getBuiltin("position","fragCoord","vec4<f32>")+".xy"}getFragDepth(){return"output."+this.getBuiltin("frag_depth","depth","f32","output")}getClipDistance(){return"varyings.hw_clip_distances"}isFlipY(){return!1}enableDirective(e,t=this.shaderStage){(this.directives[t]||(this.directives[t]=new Set)).add(e)}getDirectives(e){const t=[],n=this.directives[e];if(void 0!==n)for(const e of n)t.push(`enable ${e};`);return t.join("\n")}enableSubGroups(){this.enableDirective("subgroups")}enableSubgroupsF16(){this.enableDirective("subgroups-f16")}enableClipDistances(){this.enableDirective("clip_distances")}enableShaderF16(){this.enableDirective("f16")}enableDualSourceBlending(){this.enableDirective("dual_source_blending")}enableHardwareClipping(e){this.enableClipDistances(),this.getBuiltin("clip_distances","hw_clip_distances",`array<f32, ${e} >`,"vertex")}getBuiltins(e){const t=[],n=this.builtins[e];if(void 0!==n)for(const{name:e,property:r,type:i}of n.values())t.push(`@builtin( ${e} ) ${r} : ${i}`);return t.join(",\n\t")}getScopedArray(e,t,n,r){return!1===this.scopedArrays.has(e)&&this.scopedArrays.set(e,{name:e,scope:t,bufferType:n,bufferCount:r}),e}getScopedArrays(e){if("compute"!==e)return;const t=[];for(const{name:e,scope:n,bufferType:r,bufferCount:i}of this.scopedArrays.values()){const s=this.getType(r);t.push(`var<${n}> ${e}: array< ${s}, ${i} >;`)}return t.join("\n")}getAttributes(e){const t=[];if("compute"===e&&(this.getBuiltin("global_invocation_id","id","vec3<u32>","attribute"),this.getBuiltin("workgroup_id","workgroupId","vec3<u32>","attribute"),this.getBuiltin("local_invocation_id","localId","vec3<u32>","attribute"),this.getBuiltin("num_workgroups","numWorkgroups","vec3<u32>","attribute"),this.renderer.hasFeature("subgroups")&&(this.enableDirective("subgroups",e),this.getBuiltin("subgroup_size","subgroupSize","u32","attribute"))),"vertex"===e||"compute"===e){const e=this.getBuiltins("attribute");e&&t.push(e);const n=this.getAttributesArray();for(let e=0,r=n.length;e<r;e++){const r=n[e],i=r.name,s=this.getType(r.type);t.push(`@location( ${e} ) ${i} : ${s}`)}}return t.join(",\n\t")}getStructMembers(e){const t=[],n=e.getMemberTypes();for(let e=0;e<n.length;e++){const r=n[e];t.push(`\t@location( ${e} ) m${e} : ${r}<f32>`)}const r=this.getBuiltins("output");return r&&t.push("\t"+r),t.join(",\n")}getStructs(e){const t=[],n=this.structs[e];for(let e=0,r=n.length;e<r;e++){const r=n[e],i=r.name;let s=`struct ${i} {\n`;s+=this.getStructMembers(r),s+="\n}",t.push(s),t.push(`\nvar<private> output : ${i};\n\n`)}return t.join("\n\n")}getVar(e,t){return`var ${t} : ${this.getType(e)}`}getVars(e){const t=[],n=this.vars[e];if(void 0!==n)for(const e of n)t.push(`\t${this.getVar(e.type,e.name)};`);return`\n${t.join("\n")}\n`}getVaryings(e){const t=[];if("vertex"===e&&this.getBuiltin("position","Vertex","vec4<f32>","vertex"),"vertex"===e||"fragment"===e){const n=this.varyings,r=this.vars[e];for(let i=0;i<n.length;i++){const s=n[i];if(s.needsInterpolation){let e=`@location( ${i} )`;/^(int|uint|ivec|uvec)/.test(s.type)&&(e+=" @interpolate( flat )"),t.push(`${e} ${s.name} : ${this.getType(s.type)}`)}else"vertex"===e&&!1===r.includes(s)&&r.push(s)}}const n=this.getBuiltins(e);n&&t.push(n);const r=t.join(",\n\t");return"vertex"===e?this._getWGSLStruct("VaryingsStruct","\t"+r):r}getUniforms(e){const t=this.uniforms[e],n=[],r=[],i=[],s={};for(const i of t){const t=i.groupNode.name,a=this.bindingsIndexes[t];if("texture"===i.type||"cubeTexture"===i.type||"storageTexture"===i.type||"texture3D"===i.type){const t=i.node.value;let r;"fragment"===e&&!1===this.isUnfilterable(t)&&!0!==i.node.isStorageTextureNode&&(this.isSampleCompare(t)?n.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var ${i.name}_sampler : sampler_comparison;`):n.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var ${i.name}_sampler : sampler;`));let s="";if(!0===t.isMultisampleRenderTargetTexture&&(s="_multisampled"),!0===t.isCubeTexture)r="texture_cube<f32>";else if(!0===t.isDataArrayTexture||!0===t.isCompressedArrayTexture)r="texture_2d_array<f32>";else if(!0===t.isDepthTexture)r=`texture_depth${s}_2d`;else if(!0===t.isVideoTexture)r="texture_external";else if(!0===t.isData3DTexture)r="texture_3d<f32>";else if(!0===i.node.isStorageTextureNode){r=`texture_storage_2d<${IO(t)}, ${this.getStorageAccess(i.node,e)}>`}else{r=`texture${s}_2d<${this.getComponentTypeFromTexture(t).charAt(0)}32>`}n.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var ${i.name} : ${r};`)}else if("buffer"===i.type||"storageBuffer"===i.type||"indirectStorageBuffer"===i.type){const t=i.node,n=this.getType(t.bufferType),s=t.bufferCount,o=s>0&&"buffer"===i.type?", "+s:"",l=t.isAtomic?`atomic<${n}>`:`${n}`,u=`\t${i.name} : array< ${l}${o} >\n`,c=t.isStorageBufferNode?`storage, ${this.getStorageAccess(t,e)}`:"uniform";r.push(this._getWGSLStructBinding("NodeBuffer_"+t.id,u,c,a.binding++,a.group))}else{const e=this.getType(this.getVectorType(i.type)),t=i.groupNode.name;(s[t]||(s[t]={index:a.binding++,id:a.group,snippets:[]})).snippets.push(`\t${i.name} : ${e}`)}}for(const e in s){const t=s[e];i.push(this._getWGSLStructBinding(e,t.snippets.join(",\n"),"uniform",t.index,t.id))}let a=n.join("\n");return a+=r.join("\n"),a+=i.join("\n"),a}buildCode(){const e=null!==this.material?{fragment:{},vertex:{}}:{compute:{}};this.sortBindingGroups();for(const t in e){const n=e[t];n.uniforms=this.getUniforms(t),n.attributes=this.getAttributes(t),n.varyings=this.getVaryings(t),n.structs=this.getStructs(t),n.vars=this.getVars(t),n.codes=this.getCodes(t),n.directives=this.getDirectives(t),n.scopedArrays=this.getScopedArrays(t);let r="// code\n\n";r+=this.flowCode[t];const i=this.flowNodes[t],s=i[i.length-1],a=s.outputNode,o=void 0!==a&&!0===a.isOutputStructNode;for(const e of i){const i=this.getFlowData(e),l=e.name;if(l&&(r.length>0&&(r+="\n"),r+=`\t// flow -> ${l}\n\t`),r+=`${i.code}\n\t`,e===s&&"compute"!==t)if(r+="// result\n\n\t","vertex"===t)r+=`varyings.Vertex = ${i.result};`;else if("fragment"===t)if(o)n.returnType=a.nodeType,r+=`return ${i.result};`;else{let e="\t@location(0) color: vec4<f32>";const t=this.getBuiltins("output");t&&(e+=",\n\t"+t),n.returnType="OutputStruct",n.structs+=this._getWGSLStruct("OutputStruct",e),n.structs+="\nvar<private> output : OutputStruct;\n\n",r+=`output.color = ${i.result};\n\n\treturn output;`}}n.flow=r}null!==this.material?(this.vertexShader=this._getWGSLVertexCode(e.vertex),this.fragmentShader=this._getWGSLFragmentCode(e.fragment)):this.computeShader=this._getWGSLComputeCode(e.compute,(this.object.workgroupSize||[64]).join(", "))}getMethod(e,t=null){let n;return null!==t&&(n=this._getWGSLMethod(e+"_"+t)),void 0===n&&(n=this._getWGSLMethod(e)),n||e}getType(e){return WO[e]||e}isAvailable(e){let t=HO[e];return void 0===t&&("float32Filterable"===e?t=this.renderer.hasFeature("float32-filterable"):"clipDistance"===e&&(t=this.renderer.hasFeature("clip-distances")),HO[e]=t),t}_getWGSLMethod(e){return void 0!==QO[e]&&this._include(e),YO[e]}_include(e){const t=QO[e];return t.build(this),null!==this.currentFunctionNode&&this.currentFunctionNode.includes.push(t),t}_getWGSLVertexCode(e){return`${this.getSignature()}\n// directives\n${e.directives}\n\n// uniforms\n${e.uniforms}\n\n// varyings\n${e.varyings}\nvar<private> varyings : VaryingsStruct;\n\n// codes\n${e.codes}\n\n@vertex\nfn main( ${e.attributes} ) -> VaryingsStruct {\n\n\t// vars\n\t${e.vars}\n\n\t// flow\n\t${e.flow}\n\n\treturn varyings;\n\n}\n`}_getWGSLFragmentCode(e){return`${this.getSignature()}\n// global\n${$O}\n\n// uniforms\n${e.uniforms}\n\n// structs\n${e.structs}\n\n// codes\n${e.codes}\n\n@fragment\nfn main( ${e.varyings} ) -> ${e.returnType} {\n\n\t// vars\n\t${e.vars}\n\n\t// flow\n\t${e.flow}\n\n}\n`}_getWGSLComputeCode(e,t){return`${this.getSignature()}\n// directives\n${e.directives}\n\n// system\nvar<private> instanceIndex : u32;\n\n// locals\n${e.scopedArrays}\n\n// uniforms\n${e.uniforms}\n\n// codes\n${e.codes}\n\n@compute @workgroup_size( ${t} )\nfn main( ${e.attributes} ) {\n\n\t// system\n\tinstanceIndex = id.x + id.y * numWorkgroups.x * u32(${t}) + id.z * numWorkgroups.x * numWorkgroups.y * u32(${t});\n\n\t// vars\n\t${e.vars}\n\n\t// flow\n\t${e.flow}\n\n}\n`}_getWGSLStruct(e,t){return`\nstruct ${e} {\n${t}\n};`}_getWGSLStructBinding(e,t,n,r=0,i=0){const s=e+"Struct";return`${this._getWGSLStruct(s,t)}\n@binding( ${r} ) @group( ${i} )\nvar<${n}> ${e} : ${s};`}}class ZO{constructor(e){this.backend=e}getCurrentDepthStencilFormat(e){let t;return null!==e.depthTexture?t=this.getTextureFormatGPU(e.depthTexture):e.depth&&e.stencil?t=wB.Depth24PlusStencil8:e.depth&&(t=wB.Depth24Plus),t}getTextureFormatGPU(e){return this.backend.get(e).format}getCurrentColorFormat(e){let t;return t=null!==e.textures?this.getTextureFormatGPU(e.textures[0]):this.getPreferredCanvasFormat(),t}getCurrentColorSpace(e){return null!==e.textures?e.textures[0].colorSpace:this.backend.renderer.outputColorSpace}getPrimitiveTopology(e,t){return e.isPoints?rB:e.isLineSegments||e.isMesh&&!0===t.wireframe?iB:e.isLine?sB:e.isMesh?aB:void 0}getSampleCount(e){let t=1;return e>1&&(t=Math.pow(2,Math.floor(Math.log2(e))),2===t&&(t=4)),t}getSampleCountRenderContext(e){return null!==e.textures?this.getSampleCount(e.sampleCount):this.getSampleCount(this.backend.renderer.samples)}getPreferredCanvasFormat(){return navigator.userAgent.includes("Quest")?wB.BGRA8Unorm:navigator.gpu.getPreferredCanvasFormat()}}const JO=new Map([[Int8Array,["sint8","snorm8"]],[Uint8Array,["uint8","unorm8"]],[Int16Array,["sint16","snorm16"]],[Uint16Array,["uint16","unorm16"]],[Int32Array,["sint32","snorm32"]],[Uint32Array,["uint32","unorm32"]],[Float32Array,["float32"]]]),eF=new Map([[Vr,["float16"]]]),tF=new Map([[Int32Array,"sint32"],[Int16Array,"sint32"],[Uint32Array,"uint32"],[Uint16Array,"uint32"],[Float32Array,"float32"]]);class nF{constructor(e){this.backend=e}createAttribute(e,t){const n=this._getBufferAttribute(e),r=this.backend,i=r.get(n);let s=i.buffer;if(void 0===s){const a=r.device;let o=n.array;if(!1===e.normalized&&(o.constructor===Int16Array||o.constructor===Uint16Array)){const e=new Uint32Array(o.length);for(let t=0;t<o.length;t++)e[t]=o[t];o=e}if(n.array=o,(n.isStorageBufferAttribute||n.isStorageInstancedBufferAttribute)&&3===n.itemSize){o=new o.constructor(4*n.count);for(let e=0;e<n.count;e++)o.set(n.array.subarray(3*e,3*e+3),4*e);n.itemSize=4,n.array=o}const l=o.byteLength+(4-o.byteLength%4)%4;s=a.createBuffer({label:n.name,size:l,usage:t,mappedAtCreation:!0}),new o.constructor(s.getMappedRange()).set(o),s.unmap(),i.buffer=s}}updateAttribute(e){const t=this._getBufferAttribute(e),n=this.backend,r=n.device,i=n.get(t).buffer,s=t.array,a=this._isTypedArray(s),o=t.updateRanges;if(0===o.length)r.queue.writeBuffer(i,0,s,0);else{const e=a?1:s.BYTES_PER_ELEMENT;for(let t=0,n=o.length;t<n;t++){const n=o[t],a=n.start*e,l=n.count*e;r.queue.writeBuffer(i,0,s,a,l)}t.clearUpdateRanges()}}createShaderVertexBuffers(e){const t=e.getAttributes(),n=new Map;for(let e=0;e<t.length;e++){const r=t[e],i=r.array.BYTES_PER_ELEMENT,s=this._getBufferAttribute(r);let a=n.get(s);if(void 0===a){let e,t;!0===r.isInterleavedBufferAttribute?(e=r.data.stride*i,t=r.data.isInstancedInterleavedBuffer?SO:bO):(e=r.itemSize*i,t=r.isInstancedBufferAttribute?SO:bO),!1!==r.normalized||r.array.constructor!==Int16Array&&r.array.constructor!==Uint16Array||(e=4),a={arrayStride:e,attributes:[],stepMode:t},n.set(s,a)}const o=this._getVertexFormat(r),l=!0===r.isInterleavedBufferAttribute?r.offset*i:0;a.attributes.push({shaderLocation:e,offset:l,format:o})}return Array.from(n.values())}destroyAttribute(e){const t=this.backend;t.get(this._getBufferAttribute(e)).buffer.destroy(),t.delete(e)}async getArrayBufferAsync(e){const t=this.backend,n=t.device,r=t.get(this._getBufferAttribute(e)).buffer,i=r.size,s=n.createBuffer({label:e.name,size:i,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),a=n.createCommandEncoder({});a.copyBufferToBuffer(r,0,s,0,i),s.unmap();const o=a.finish();n.queue.submit([o]),await s.mapAsync(GPUMapMode.READ);return s.getMappedRange()}_getVertexFormat(e){const{itemSize:t,normalized:n}=e,r=e.array.constructor,i=e.constructor;let s;if(1==t)s=tF.get(r);else{const e=(eF.get(i)||JO.get(r))[n?1:0];if(e){const n=r.BYTES_PER_ELEMENT*t,i=4*Math.floor((n+3)/4)/r.BYTES_PER_ELEMENT;if(i%1)throw new Error("THREE.WebGPUAttributeUtils: Bad vertex format item size.");s=`${e}x${i}`}}return s||console.error("THREE.WebGPUAttributeUtils: Vertex format not supported yet."),s}_isTypedArray(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}_getBufferAttribute(e){return e.isInterleavedBufferAttribute&&(e=e.data),e}}class rF{constructor(e){this.backend=e,this.bindGroupLayoutCache=new WeakMap}createBindingsLayout(e){const t=this.backend.device,n=[];let r=0;for(const t of e.bindings){const e={binding:r++,visibility:t.visibility};if(t.isUniformBuffer||t.isStorageBuffer){const n={};t.isStorageBuffer&&(4&t.visibility&&(t.access===vb||t.access===gb)?n.type=sO:n.type=aO),e.buffer=n}else if(t.isSampler){const n={};t.texture.isDepthTexture&&null!==t.texture.compareFunction&&(n.type="comparison"),e.sampler=n}else if(t.isSampledTexture&&t.texture.isVideoTexture)e.externalTexture={};else if(t.isSampledTexture&&t.store){const n={};n.format=this.backend.get(t.texture).texture.format;const r=t.access;n.access=r===vb?uO:r===gb?oO:lO,e.storageTexture=n}else if(t.isSampledTexture){const n={};if(!0===t.texture.isMultisampleRenderTargetTexture&&(n.multisampled=!0),t.texture.isDepthTexture)n.sampleType=hO;else if(t.texture.isDataTexture||t.texture.isDataArrayTexture||t.texture.isData3DTexture){const e=t.texture.type;e===ie?n.sampleType=dO:e===se?n.sampleType=pO:e===ae&&(this.backend.hasFeature("float32-filterable")?n.sampleType=cO:n.sampleType=AO)}t.isSampledCubeTexture?n.viewDimension=_O:t.texture.isDataArrayTexture||t.texture.isCompressedArrayTexture?n.viewDimension=vO:t.isSampledTexture3D&&(n.viewDimension=yO),e.texture=n}else console.error(`WebGPUBindingUtils: Unsupported binding "${t}".`);n.push(e)}return t.createBindGroupLayout({entries:n})}createBindings(e,t,n,r=0){const{backend:i,bindGroupLayoutCache:s}=this,a=i.get(e);let o,l=s.get(e.bindingsReference);void 0===l&&(l=this.createBindingsLayout(e),s.set(e.bindingsReference,l)),n>0&&(void 0===a.groups&&(a.groups=[],a.versions=[]),a.versions[n]===r&&(o=a.groups[n])),void 0===o&&(o=this.createBindGroup(e,l),n>0&&(a.groups[n]=o,a.versions[n]=r)),a.group=o,a.layout=l}updateBinding(e){const t=this.backend,n=t.device,r=e.buffer,i=t.get(e).buffer;n.queue.writeBuffer(i,0,r,0)}createBindGroup(e,t){const n=this.backend,r=n.device;let i=0;const s=[];for(const t of e.bindings){if(t.isUniformBuffer){const e=n.get(t);if(void 0===e.buffer){const n=t.byteLength,i=GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST,s=r.createBuffer({label:"bindingBuffer_"+t.name,size:n,usage:i});e.buffer=s}s.push({binding:i,resource:{buffer:e.buffer}})}else if(t.isStorageBuffer){const e=n.get(t);if(void 0===e.buffer){const r=t.attribute;e.buffer=n.get(r).buffer}s.push({binding:i,resource:{buffer:e.buffer}})}else if(t.isSampler){const e=n.get(t.texture);s.push({binding:i,resource:e.sampler})}else if(t.isSampledTexture){const e=n.get(t.texture);let a;if(void 0!==e.externalTexture)a=r.importExternalTexture({source:e.externalTexture});else{const n=t.store?1:e.texture.mipLevelCount,r=`view-${e.texture.width}-${e.texture.height}-${n}`;if(a=e[r],void 0===a){const i=xO;let s;s=t.isSampledCubeTexture?_O:t.isSampledTexture3D?yO:t.texture.isDataArrayTexture||t.texture.isCompressedArrayTexture?vO:gO,a=e[r]=e.texture.createView({aspect:i,dimension:s,mipLevelCount:n})}}s.push({binding:i,resource:a})}i++}return r.createBindGroup({label:"bindGroup_"+e.name,layout:t,entries:s})}}class iF{constructor(e){this.backend=e}_getSampleCount(e){return this.backend.utils.getSampleCountRenderContext(e)}createRenderPipeline(e,t){const{object:n,material:r,geometry:i,pipeline:s}=e,{vertexProgram:a,fragmentProgram:o}=s,l=this.backend,u=l.device,c=l.utils,A=l.get(s),h=[];for(const t of e.getBindings()){const e=l.get(t);h.push(e.layout)}const d=l.attributeUtils.createShaderVertexBuffers(e);let p;!0===r.transparent&&0!==r.blending&&(p=this._getBlending(r));let f={};!0===r.stencilWrite&&(f={compare:this._getStencilCompare(r),failOp:this._getStencilOperation(r.stencilFail),depthFailOp:this._getStencilOperation(r.stencilZFail),passOp:this._getStencilOperation(r.stencilZPass)});const m=this._getColorWriteMask(r),g=[];if(null!==e.context.textures){const t=e.context.textures;for(let e=0;e<t.length;e++){const n=c.getTextureFormatGPU(t[e]);g.push({format:n,blend:p,writeMask:m})}}else{const t=c.getCurrentColorFormat(e.context);g.push({format:t,blend:p,writeMask:m})}const v=l.get(a).module,_=l.get(o).module,y=this._getPrimitiveState(n,i,r),x=this._getDepthCompare(r),b=c.getCurrentDepthStencilFormat(e.context),S=this._getSampleCount(e.context),T={label:`renderPipeline_${r.name||r.type}_${r.id}`,vertex:Object.assign({},v,{buffers:d}),fragment:Object.assign({},_,{targets:g}),primitive:y,multisample:{count:S,alphaToCoverageEnabled:r.alphaToCoverage&&S>1},layout:u.createPipelineLayout({bindGroupLayouts:h})},w={},M=e.context.depth,E=e.context.stencil;if(!0!==M&&!0!==E||(!0===M&&(w.format=b,w.depthWriteEnabled=r.depthWrite,w.depthCompare=x),!0===E&&(w.stencilFront=f,w.stencilBack={},w.stencilReadMask=r.stencilFuncMask,w.stencilWriteMask=r.stencilWriteMask),T.depthStencil=w),null===t)A.pipeline=u.createRenderPipeline(T);else{const e=new Promise((e=>{u.createRenderPipelineAsync(T).then((t=>{A.pipeline=t,e()}))}));t.push(e)}}createBundleEncoder(e){const t=this.backend,{utils:n,device:r}=t,i=n.getCurrentDepthStencilFormat(e),s={label:"renderBundleEncoder",colorFormats:[n.getCurrentColorFormat(e)],depthStencilFormat:i,sampleCount:this._getSampleCount(e)};return r.createRenderBundleEncoder(s)}createComputePipeline(e,t){const n=this.backend,r=n.device,i=n.get(e.computeProgram).module,s=n.get(e),a=[];for(const e of t){const t=n.get(e);a.push(t.layout)}s.pipeline=r.createComputePipeline({compute:i,layout:r.createPipelineLayout({bindGroupLayouts:a})})}_getBlending(e){let t,n;const r=e.blending,i=e.blendSrc,s=e.blendDst,a=e.blendEquation;if(5===r){const r=null!==e.blendSrcAlpha?e.blendSrcAlpha:i,o=null!==e.blendDstAlpha?e.blendDstAlpha:s,l=null!==e.blendEquationAlpha?e.blendEquationAlpha:a;t={srcFactor:this._getBlendFactor(i),dstFactor:this._getBlendFactor(s),operation:this._getBlendOperation(a)},n={srcFactor:this._getBlendFactor(r),dstFactor:this._getBlendFactor(o),operation:this._getBlendOperation(l)}}else{const i=(e,r,i,s)=>{t={srcFactor:e,dstFactor:r,operation:HB},n={srcFactor:i,dstFactor:s,operation:HB}};if(e.premultipliedAlpha)switch(r){case 1:i(DB,BB,DB,BB);break;case 2:i(DB,DB,DB,DB);break;case 3:i(PB,IB,PB,DB);break;case 4:i(PB,LB,PB,UB)}else switch(r){case 1:i(UB,BB,DB,BB);break;case 2:i(UB,DB,UB,DB);break;case 3:i(PB,IB,PB,DB);break;case 4:i(PB,LB,PB,LB)}}if(void 0!==t&&void 0!==n)return{color:t,alpha:n};console.error("THREE.WebGPURenderer: Invalid blending: ",r)}_getBlendFactor(e){let t;switch(e){case 200:t=PB;break;case 201:t=DB;break;case 202:t=LB;break;case 203:t=IB;break;case x:t=UB;break;case b:t=BB;break;case 208:t=OB;break;case 209:t=FB;break;case 206:t=kB;break;case 207:t=qB;break;case 210:t=GB;break;case 211:t=zB;break;case 212:t=VB;break;default:console.error("THREE.WebGPURenderer: Blend factor not supported.",e)}return t}_getStencilCompare(e){let t;const n=e.stencilFunc;switch(n){case 512:t=lB;break;case 519:t=fB;break;case 513:t=uB;break;case 515:t=AB;break;case 514:t=cB;break;case 518:t=pB;break;case 516:t=hB;break;case 517:t=dB;break;default:console.error("THREE.WebGPURenderer: Invalid stencil function.",n)}return t}_getStencilOperation(e){let t;switch(e){case ot:t=KB;break;case 0:t=ZB;break;case 7681:t=JB;break;case 5386:t=eO;break;case 7682:t=tO;break;case 7683:t=nO;break;case 34055:t=rO;break;case 34056:t=iO;break;default:console.error("THREE.WebGPURenderer: Invalid stencil operation.",t)}return t}_getBlendOperation(e){let t;switch(e){case p:t=HB;break;case 101:t=jB;break;case 102:t=WB;break;case 103:t=XB;break;case 104:t=QB;break;default:console.error("THREE.WebGPUPipelineUtils: Blend equation not supported.",e)}return t}_getPrimitiveState(e,t,n){const r={},i=this.backend.utils;switch(r.topology=i.getPrimitiveTopology(e,n),null!==t.index&&!0===e.isLine&&!0!==e.isLineSegments&&(r.stripIndexFormat=t.index.array instanceof Uint16Array?SB:TB),n.side){case 0:r.frontFace=_B,r.cullMode=bB;break;case 1:r.frontFace=_B,r.cullMode=xB;break;case 2:r.frontFace=_B,r.cullMode=yB;break;default:console.error("THREE.WebGPUPipelineUtils: Unknown material.side value.",n.side)}return r}_getColorWriteMask(e){return!0===e.colorWrite?$B:YB}_getDepthCompare(e){let t;if(!1===e.depthTest)t=fB;else{const n=e.depthFunc;switch(n){case 0:t=lB;break;case 1:t=fB;break;case 2:t=uB;break;case 3:t=AB;break;case 4:t=cB;break;case 5:t=pB;break;case 6:t=hB;break;case 7:t=dB;break;default:console.error("THREE.WebGPUPipelineUtils: Invalid depth function.",n)}}return t}}class sF extends FU{constructor(e={}){super(e),this.isWebGPUBackend=!0,this.parameters.alpha=void 0===e.alpha||e.alpha,this.parameters.requiredLimits=void 0===e.requiredLimits?{}:e.requiredLimits,this.trackTimestamp=!0===e.trackTimestamp,this.device=null,this.context=null,this.colorBuffer=null,this.defaultRenderPassdescriptor=null,this.utils=new ZO(this),this.attributeUtils=new nF(this),this.bindingUtils=new rF(this),this.pipelineUtils=new iF(this),this.textureUtils=new LO(this),this.occludedResolveCache=new Map}async init(e){await super.init(e);const t=this.parameters;let n;if(void 0===t.device){const e={powerPreference:t.powerPreference},r="undefined"!=typeof navigator?await navigator.gpu.requestAdapter(e):null;if(null===r)throw new Error("WebGPUBackend: Unable to create WebGPU adapter.");const i=Object.values(TO),s=[];for(const e of i)r.features.has(e)&&s.push(e);const a={requiredFeatures:s,requiredLimits:t.requiredLimits};n=await r.requestDevice(a)}else n=t.device;n.lost.then((t=>{const n={api:"WebGPU",message:t.message||"Unknown reason",reason:t.reason||null,originalEvent:t};e.onDeviceLost(n)}));const r=void 0!==t.context?t.context:e.domElement.getContext("webgpu");this.device=n,this.context=r;const i=t.alpha?"premultiplied":"opaque";this.trackTimestamp=this.trackTimestamp&&this.hasFeature(TO.TimestampQuery),this.context.configure({device:this.device,format:this.utils.getPreferredCanvasFormat(),usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,alphaMode:i}),this.updateSize()}get coordinateSystem(){return yt}async getArrayBufferAsync(e){return await this.attributeUtils.getArrayBufferAsync(e)}getContext(){return this.context}_getDefaultRenderPassDescriptor(){let e=this.defaultRenderPassdescriptor;if(null===e){const t=this.renderer;e={colorAttachments:[{view:null}]},!0!==this.renderer.depth&&!0!==this.renderer.stencil||(e.depthStencilAttachment={view:this.textureUtils.getDepthBuffer(t.depth,t.stencil).createView()});const n=e.colorAttachments[0];this.renderer.samples>0?n.view=this.colorBuffer.createView():n.resolveTarget=void 0,this.defaultRenderPassdescriptor=e}const t=e.colorAttachments[0];return this.renderer.samples>0?t.resolveTarget=this.context.getCurrentTexture().createView():t.view=this.context.getCurrentTexture().createView(),e}_getRenderPassDescriptor(e){const t=e.renderTarget,n=this.get(t);let r=n.descriptors;if(void 0===r||n.width!==t.width||n.height!==t.height||n.activeMipmapLevel!==t.activeMipmapLevel||n.samples!==t.samples){r={},n.descriptors=r;const e=()=>{t.removeEventListener("dispose",e),this.delete(t)};t.addEventListener("dispose",e)}const i=e.getCacheKey();let s=r[i];if(void 0===s){const a=e.textures,o=[];for(let t=0;t<a.length;t++){const n=this.get(a[t]),r=n.texture.createView({baseMipLevel:e.activeMipmapLevel,mipLevelCount:1,baseArrayLayer:e.activeCubeFace,dimension:gO});let i,s;void 0!==n.msaaTexture?(i=n.msaaTexture.createView(),s=r):(i=r,s=void 0),o.push({view:i,resolveTarget:s,loadOp:gB,storeOp:mB})}if(s={colorAttachments:o},e.depth){const t={view:this.get(e.depthTexture).texture.createView()};s.depthStencilAttachment=t}r[i]=s,n.width=t.width,n.height=t.height,n.samples=t.samples,n.activeMipmapLevel=t.activeMipmapLevel}return s}beginRender(e){const t=this.get(e),n=this.device,r=e.occlusionQueryCount;let i,s;r>0&&(t.currentOcclusionQuerySet&&t.currentOcclusionQuerySet.destroy(),t.currentOcclusionQueryBuffer&&t.currentOcclusionQueryBuffer.destroy(),t.currentOcclusionQuerySet=t.occlusionQuerySet,t.currentOcclusionQueryBuffer=t.occlusionQueryBuffer,t.currentOcclusionQueryObjects=t.occlusionQueryObjects,i=n.createQuerySet({type:"occlusion",count:r,label:`occlusionQuerySet_${e.id}`}),t.occlusionQuerySet=i,t.occlusionQueryIndex=0,t.occlusionQueryObjects=new Array(r),t.lastOcclusionObject=null),s=null===e.textures?this._getDefaultRenderPassDescriptor():this._getRenderPassDescriptor(e),this.initTimestampQuery(e,s),s.occlusionQuerySet=i;const a=s.depthStencilAttachment;if(null!==e.textures){const t=s.colorAttachments;for(let n=0;n<t.length;n++){const r=t[n];e.clearColor?(r.clearValue=0===n?e.clearColorValue:{r:0,g:0,b:0,a:1},r.loadOp=vB,r.storeOp=mB):(r.loadOp=gB,r.storeOp=mB)}}else{const t=s.colorAttachments[0];e.clearColor?(t.clearValue=e.clearColorValue,t.loadOp=vB,t.storeOp=mB):(t.loadOp=gB,t.storeOp=mB)}e.depth&&(e.clearDepth?(a.depthClearValue=e.clearDepthValue,a.depthLoadOp=vB,a.depthStoreOp=mB):(a.depthLoadOp=gB,a.depthStoreOp=mB)),e.stencil&&(e.clearStencil?(a.stencilClearValue=e.clearStencilValue,a.stencilLoadOp=vB,a.stencilStoreOp=mB):(a.stencilLoadOp=gB,a.stencilStoreOp=mB));const o=n.createCommandEncoder({label:"renderContext_"+e.id}),l=o.beginRenderPass(s);if(t.descriptor=s,t.encoder=o,t.currentPass=l,t.currentSets={attributes:{},bindingGroups:[],pipeline:null,index:null},t.renderBundles=[],e.viewport&&this.updateViewport(e),e.scissor){const{x:t,y:n,width:r,height:i}=e.scissorValue;l.setScissorRect(t,n,r,i)}}finishRender(e){const t=this.get(e),n=e.occlusionQueryCount;if(t.renderBundles.length>0&&t.currentPass.executeBundles(t.renderBundles),n>t.occlusionQueryIndex&&t.currentPass.endOcclusionQuery(),t.currentPass.end(),n>0){const r=8*n;let i=this.occludedResolveCache.get(r);void 0===i&&(i=this.device.createBuffer({size:r,usage:GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC}),this.occludedResolveCache.set(r,i));const s=this.device.createBuffer({size:r,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});t.encoder.resolveQuerySet(t.occlusionQuerySet,0,n,i,0),t.encoder.copyBufferToBuffer(i,0,s,0,r),t.occlusionQueryBuffer=s,this.resolveOccludedAsync(e)}if(this.prepareTimestampBuffer(e,t.encoder),this.device.queue.submit([t.encoder.finish()]),null!==e.textures){const t=e.textures;for(let e=0;e<t.length;e++){const n=t[e];!0===n.generateMipmaps&&this.textureUtils.generateMipmaps(n)}}}isOccluded(e,t){const n=this.get(e);return n.occluded&&n.occluded.has(t)}async resolveOccludedAsync(e){const t=this.get(e),{currentOcclusionQueryBuffer:n,currentOcclusionQueryObjects:r}=t;if(n&&r){const e=new WeakSet;t.currentOcclusionQueryObjects=null,t.currentOcclusionQueryBuffer=null,await n.mapAsync(GPUMapMode.READ);const i=n.getMappedRange(),s=new BigUint64Array(i);for(let t=0;t<r.length;t++)s[t]!==BigInt(0)&&e.add(r[t]);n.destroy(),t.occluded=e}}updateViewport(e){const{currentPass:t}=this.get(e),{x:n,y:r,width:i,height:s,minDepth:a,maxDepth:o}=e.viewportValue;t.setViewport(n,r,i,s,a,o)}clear(e,t,n,r=null){const i=this.device,s=this.renderer;let a,o,l,u,c=[];if(e){const e=this.getClearColor();if(!0===this.renderer.alpha){const t=e.a;o={r:e.r*t,g:e.g*t,b:e.b*t,a:t}}else o={r:e.r,g:e.g,b:e.b,a:e.a}}if(null===r){l=s.depth,u=s.stencil;const t=this._getDefaultRenderPassDescriptor();if(e){c=t.colorAttachments;const e=c[0];e.clearValue=o,e.loadOp=vB,e.storeOp=mB}(l||u)&&(a=t.depthStencilAttachment)}else{if(l=r.depth,u=r.stencil,e)for(const e of r.textures){const t=this.get(e),n=t.texture.createView();let r,i;void 0!==t.msaaTexture?(r=t.msaaTexture.createView(),i=n):(r=n,i=void 0),c.push({view:r,resolveTarget:i,clearValue:o,loadOp:vB,storeOp:mB})}if(l||u){a={view:this.get(r.depthTexture).texture.createView()}}}l&&(t?(a.depthLoadOp=vB,a.depthClearValue=s.getClearDepth(),a.depthStoreOp=mB):(a.depthLoadOp=gB,a.depthStoreOp=mB)),u&&(n?(a.stencilLoadOp=vB,a.stencilClearValue=s.getClearStencil(),a.stencilStoreOp=mB):(a.stencilLoadOp=gB,a.stencilStoreOp=mB));const A=i.createCommandEncoder({});A.beginRenderPass({colorAttachments:c,depthStencilAttachment:a}).end(),i.queue.submit([A.finish()])}beginCompute(e){const t=this.get(e),n={};this.initTimestampQuery(e,n),t.cmdEncoderGPU=this.device.createCommandEncoder(),t.passEncoderGPU=t.cmdEncoderGPU.beginComputePass(n)}compute(e,t,n,r){const{passEncoderGPU:i}=this.get(e),s=this.get(r).pipeline;i.setPipeline(s);for(let e=0,t=n.length;e<t;e++){const t=n[e],r=this.get(t);i.setBindGroup(e,r.group)}const a=this.device.limits.maxComputeWorkgroupsPerDimension,o=this.get(t);void 0===o.dispatchSize&&(o.dispatchSize={x:0,y:1,z:1});const{dispatchSize:l}=o;t.dispatchCount>a?(l.x=Math.min(t.dispatchCount,a),l.y=Math.ceil(t.dispatchCount/a)):l.x=t.dispatchCount,i.dispatchWorkgroups(l.x,l.y,l.z)}finishCompute(e){const t=this.get(e);t.passEncoderGPU.end(),this.prepareTimestampBuffer(e,t.cmdEncoderGPU),this.device.queue.submit([t.cmdEncoderGPU.finish()])}async waitForGPU(){await this.device.queue.onSubmittedWorkDone()}draw(e,t){const{object:n,context:r,pipeline:i}=e,s=e.getBindings(),a=this.get(r),o=this.get(i).pipeline,l=a.currentSets,u=a.currentPass,c=e.getDrawParameters();if(null===c)return;l.pipeline!==o&&(u.setPipeline(o),l.pipeline=o);const A=l.bindingGroups;for(let e=0,t=s.length;e<t;e++){const t=s[e],n=this.get(t);A[t.index]!==t.id&&(u.setBindGroup(t.index,n.group),A[t.index]=t.id)}const h=e.getIndex(),d=null!==h;if(!0===d&&l.index!==h){const e=this.get(h).buffer,t=h.array instanceof Uint16Array?SB:TB;u.setIndexBuffer(e,t),l.index=h}const p=e.getVertexBuffers();for(let e=0,t=p.length;e<t;e++){const t=p[e];if(l.attributes[e]!==t){const n=this.get(t).buffer;u.setVertexBuffer(e,n),l.attributes[e]=t}}if(void 0!==a.occlusionQuerySet){const e=a.lastOcclusionObject;e!==n&&(null!==e&&!0===e.occlusionTest&&(u.endOcclusionQuery(),a.occlusionQueryIndex++),!0===n.occlusionTest&&(u.beginOcclusionQuery(a.occlusionQueryIndex),a.occlusionQueryObjects[a.occlusionQueryIndex]=n),a.lastOcclusionObject=n)}if(!0===n.isBatchedMesh){const e=n._multiDrawStarts,t=n._multiDrawCounts,r=n._multiDrawCount,i=n._multiDrawInstances,s=d?h.array.BYTES_PER_ELEMENT:1;for(let n=0;n<r;n++){const r=i?i[n]:1,a=r>1?0:n;u.drawIndexed(t[n],r,e[n]/s,0,a)}}else if(!0===d){const{vertexCount:r,instanceCount:i,firstVertex:s}=c,a=e.getIndirect();if(null!==a){const e=this.get(a).buffer;u.drawIndexedIndirect(e,0)}else u.drawIndexed(r,i,s,0,0);t.update(n,r,i)}else{const{vertexCount:r,instanceCount:i,firstVertex:s}=c,a=e.getIndirect();if(null!==a){const e=this.get(a).buffer;u.drawIndirect(e,0)}else u.draw(r,i,s,0);t.update(n,r,i)}}needsRenderUpdate(e){const t=this.get(e),{object:n,material:r}=e,i=this.utils,s=i.getSampleCountRenderContext(e.context),a=i.getCurrentColorSpace(e.context),o=i.getCurrentColorFormat(e.context),l=i.getCurrentDepthStencilFormat(e.context),u=i.getPrimitiveTopology(n,r);let c=!1;return t.material===r&&t.materialVersion===r.version&&t.transparent===r.transparent&&t.blending===r.blending&&t.premultipliedAlpha===r.premultipliedAlpha&&t.blendSrc===r.blendSrc&&t.blendDst===r.blendDst&&t.blendEquation===r.blendEquation&&t.blendSrcAlpha===r.blendSrcAlpha&&t.blendDstAlpha===r.blendDstAlpha&&t.blendEquationAlpha===r.blendEquationAlpha&&t.colorWrite===r.colorWrite&&t.depthWrite===r.depthWrite&&t.depthTest===r.depthTest&&t.depthFunc===r.depthFunc&&t.stencilWrite===r.stencilWrite&&t.stencilFunc===r.stencilFunc&&t.stencilFail===r.stencilFail&&t.stencilZFail===r.stencilZFail&&t.stencilZPass===r.stencilZPass&&t.stencilFuncMask===r.stencilFuncMask&&t.stencilWriteMask===r.stencilWriteMask&&t.side===r.side&&t.alphaToCoverage===r.alphaToCoverage&&t.sampleCount===s&&t.colorSpace===a&&t.colorFormat===o&&t.depthStencilFormat===l&&t.primitiveTopology===u&&t.clippingContextCacheKey===e.clippingContextCacheKey||(t.material=r,t.materialVersion=r.version,t.transparent=r.transparent,t.blending=r.blending,t.premultipliedAlpha=r.premultipliedAlpha,t.blendSrc=r.blendSrc,t.blendDst=r.blendDst,t.blendEquation=r.blendEquation,t.blendSrcAlpha=r.blendSrcAlpha,t.blendDstAlpha=r.blendDstAlpha,t.blendEquationAlpha=r.blendEquationAlpha,t.colorWrite=r.colorWrite,t.depthWrite=r.depthWrite,t.depthTest=r.depthTest,t.depthFunc=r.depthFunc,t.stencilWrite=r.stencilWrite,t.stencilFunc=r.stencilFunc,t.stencilFail=r.stencilFail,t.stencilZFail=r.stencilZFail,t.stencilZPass=r.stencilZPass,t.stencilFuncMask=r.stencilFuncMask,t.stencilWriteMask=r.stencilWriteMask,t.side=r.side,t.alphaToCoverage=r.alphaToCoverage,t.sampleCount=s,t.colorSpace=a,t.colorFormat=o,t.depthStencilFormat=l,t.primitiveTopology=u,t.clippingContextCacheKey=e.clippingContextCacheKey,c=!0),c}getRenderCacheKey(e){const{object:t,material:n}=e,r=this.utils,i=e.context;return[n.transparent,n.blending,n.premultipliedAlpha,n.blendSrc,n.blendDst,n.blendEquation,n.blendSrcAlpha,n.blendDstAlpha,n.blendEquationAlpha,n.colorWrite,n.depthWrite,n.depthTest,n.depthFunc,n.stencilWrite,n.stencilFunc,n.stencilFail,n.stencilZFail,n.stencilZPass,n.stencilFuncMask,n.stencilWriteMask,n.side,r.getSampleCountRenderContext(i),r.getCurrentColorSpace(i),r.getCurrentColorFormat(i),r.getCurrentDepthStencilFormat(i),r.getPrimitiveTopology(t,n),e.getGeometryCacheKey(),e.clippingContextCacheKey].join()}createSampler(e){this.textureUtils.createSampler(e)}destroySampler(e){this.textureUtils.destroySampler(e)}createDefaultTexture(e){this.textureUtils.createDefaultTexture(e)}createTexture(e,t){this.textureUtils.createTexture(e,t)}updateTexture(e,t){this.textureUtils.updateTexture(e,t)}generateMipmaps(e){this.textureUtils.generateMipmaps(e)}destroyTexture(e){this.textureUtils.destroyTexture(e)}copyTextureToBuffer(e,t,n,r,i,s){return this.textureUtils.copyTextureToBuffer(e,t,n,r,i,s)}initTimestampQuery(e,t){if(!this.trackTimestamp)return;const n=this.get(e);if(!n.timeStampQuerySet){const r=e.isComputeNode?"compute":"render",i=this.device.createQuerySet({type:"timestamp",count:2,label:`timestamp_${r}_${e.id}`}),s={querySet:i,beginningOfPassWriteIndex:0,endOfPassWriteIndex:1};Object.assign(t,{timestampWrites:s}),n.timeStampQuerySet=i}}prepareTimestampBuffer(e,t){if(!this.trackTimestamp)return;const n=this.get(e),r=2*BigInt64Array.BYTES_PER_ELEMENT;void 0===n.currentTimestampQueryBuffers&&(n.currentTimestampQueryBuffers={resolveBuffer:this.device.createBuffer({label:"timestamp resolve buffer",size:r,usage:GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC}),resultBuffer:this.device.createBuffer({label:"timestamp result buffer",size:r,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ})});const{resolveBuffer:i,resultBuffer:s}=n.currentTimestampQueryBuffers;t.resolveQuerySet(n.timeStampQuerySet,0,2,i,0),"unmapped"===s.mapState&&t.copyBufferToBuffer(i,0,s,0,r)}async resolveTimestampAsync(e,t="render"){if(!this.trackTimestamp)return;const n=this.get(e);if(void 0===n.currentTimestampQueryBuffers)return;const{resultBuffer:r}=n.currentTimestampQueryBuffers;await this.device.queue.onSubmittedWorkDone(),"unmapped"===r.mapState&&r.mapAsync(GPUMapMode.READ).then((()=>{const e=new BigUint64Array(r.getMappedRange()),n=Number(e[1]-e[0])/1e6;this.renderer.info.updateTimestamp(t,n),r.unmap()}))}createNodeBuilder(e,t){return new KO(e,t)}createProgram(e){this.get(e).module={module:this.device.createShaderModule({code:e.code,label:e.stage}),entryPoint:"main"}}destroyProgram(e){this.delete(e)}createRenderPipeline(e,t){this.pipelineUtils.createRenderPipeline(e,t)}createComputePipeline(e,t){this.pipelineUtils.createComputePipeline(e,t)}beginBundle(e){const t=this.get(e);t._currentPass=t.currentPass,t._currentSets=t.currentSets,t.currentSets={attributes:{},bindingGroups:[],pipeline:null,index:null},t.currentPass=this.pipelineUtils.createBundleEncoder(e)}finishBundle(e,t){const n=this.get(e),r=n.currentPass.finish();this.get(t).bundleGPU=r,n.currentSets=n._currentSets,n.currentPass=n._currentPass}addBundle(e,t){this.get(e).renderBundles.push(this.get(t).bundleGPU)}createBindings(e,t,n,r){this.bindingUtils.createBindings(e,t,n,r)}updateBindings(e,t,n,r){this.bindingUtils.createBindings(e,t,n,r)}updateBinding(e){this.bindingUtils.updateBinding(e)}createIndexAttribute(e){this.attributeUtils.createAttribute(e,GPUBufferUsage.INDEX|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST)}createAttribute(e){this.attributeUtils.createAttribute(e,GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST)}createStorageAttribute(e){this.attributeUtils.createAttribute(e,GPUBufferUsage.STORAGE|GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST)}createIndirectStorageAttribute(e){this.attributeUtils.createAttribute(e,GPUBufferUsage.STORAGE|GPUBufferUsage.INDIRECT|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST)}updateAttribute(e){this.attributeUtils.updateAttribute(e)}destroyAttribute(e){this.attributeUtils.destroyAttribute(e)}updateSize(){this.colorBuffer=this.textureUtils.getColorBuffer(),this.defaultRenderPassdescriptor=null}getMaxAnisotropy(){return 16}hasFeature(e){return this.device.features.has(e)}copyTextureToTexture(e,t,n=null,r=null,i=0){let s=0,a=0,o=0,l=0,u=0,c=0,A=e.image.width,h=e.image.height;null!==n&&(l=n.x,u=n.y,c=n.z||0,A=n.width,h=n.height),null!==r&&(s=r.x,a=r.y,o=r.z||0);const d=this.device.createCommandEncoder({label:"copyTextureToTexture_"+e.id+"_"+t.id}),p=this.get(e).texture,f=this.get(t).texture;d.copyTextureToTexture({texture:p,mipLevel:i,origin:{x:l,y:u,z:c}},{texture:f,mipLevel:i,origin:{x:s,y:a,z:o}},[A,h,1]),this.device.queue.submit([d.finish()])}copyFramebufferToTexture(e,t,n){const r=this.get(t);let i=null;i=t.renderTarget?e.isDepthTexture?this.get(t.depthTexture).texture:this.get(t.textures[0]).texture:e.isDepthTexture?this.textureUtils.getDepthBuffer(t.depth,t.stencil):this.context.getCurrentTexture();const s=this.get(e).texture;if(i.format!==s.format)return void console.error("WebGPUBackend: copyFramebufferToTexture: Source and destination formats do not match.",i.format,s.format);let a;if(r.currentPass?(r.currentPass.end(),a=r.encoder):a=this.device.createCommandEncoder({label:"copyFramebufferToTexture_"+e.id}),a.copyTextureToTexture({texture:i,origin:[n.x,n.y,0]},{texture:s},[n.z,n.w]),e.generateMipmaps&&this.textureUtils.generateMipmaps(e),r.currentPass){const{descriptor:e}=r;for(let t=0;t<e.colorAttachments.length;t++)e.colorAttachments[t].loadOp=gB;if(t.depth&&(e.depthStencilAttachment.depthLoadOp=gB),t.stencil&&(e.depthStencilAttachment.stencilLoadOp=gB),r.currentPass=a.beginRenderPass(e),r.currentSets={attributes:{},bindingGroups:[],pipeline:null,index:null},t.viewport&&this.updateViewport(t),t.scissor){const{x:e,y:n,width:i,height:s}=t.scissorValue;r.currentPass.setScissorRect(e,n,i,s)}}else this.device.queue.submit([a.finish()])}}class aF extends Pa{constructor(e,t,n,r,i,s){super(e,t,n,r,i,s),this.iesMap=null}copy(e,t){return super.copy(e,t),this.iesMap=e.iesMap,this}}class oF extends oU{constructor(){super(),this.addMaterial(JR,"MeshPhongMaterial"),this.addMaterial(_P,"MeshStandardMaterial"),this.addMaterial(xP,"MeshPhysicalMaterial"),this.addMaterial(wP,"MeshToonMaterial"),this.addMaterial(HR,"MeshBasicMaterial"),this.addMaterial(KR,"MeshLambertMaterial"),this.addMaterial(NR,"MeshNormalMaterial"),this.addMaterial(RP,"MeshMatcapMaterial"),this.addMaterial(MR,"LineBasicMaterial"),this.addMaterial(CR,"LineDashedMaterial"),this.addMaterial(PP,"PointsMaterial"),this.addMaterial(UP,"SpriteMaterial"),this.addMaterial(FP,"ShadowMaterial"),this.addLight(OL,Ba),this.addLight(FI,ka),this.addLight(zI,Ga),this.addLight(VI,Pa),this.addLight(jI,qa),this.addLight(WI,wa),this.addLight(XI,Va),this.addLight(HI,aF),this.addToneMapping(kD,1),this.addToneMapping(qD,2),this.addToneMapping(GD,3),this.addToneMapping(VD,4),this.addToneMapping(XD,6),this.addToneMapping(QD,7)}}class lF extends mU{constructor(e={}){let t;e.forceWebGL?t=nB:(t=sF,e.getFallback=()=>(console.warn("THREE.WebGPURenderer: WebGPU is not available, running under WebGL2 backend."),new nB(e)));super(new t(e),e),this.library=new oF,this.isWebGPURenderer=!0}}const uF={type:"change"},cF={type:"start"},AF={type:"end"},hF=1e-6,dF=-1,pF=0,fF=1,mF=2,gF=3,vF=4,_F=new Lt,yF=new Lt,xF=new on,bF=new on,SF=new on,TF=new an,wF=new on,MF=new on,EF=new on,CF=new on;class RF extends no{constructor(e,t=null){super(e,t),this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.keys=["KeyA","KeyS","KeyD"],this.mouseButtons={LEFT:a.ROTATE,MIDDLE:a.DOLLY,RIGHT:a.PAN},this.state=dF,this.keyState=dF,this.target=new on,this._lastPosition=new on,this._lastZoom=1,this._touchZoomDistanceStart=0,this._touchZoomDistanceEnd=0,this._lastAngle=0,this._eye=new on,this._movePrev=new Lt,this._moveCurr=new Lt,this._lastAxis=new on,this._zoomStart=new Lt,this._zoomEnd=new Lt,this._panStart=new Lt,this._panEnd=new Lt,this._pointers=[],this._pointerPositions={},this._onPointerMove=PF.bind(this),this._onPointerDown=NF.bind(this),this._onPointerUp=DF.bind(this),this._onPointerCancel=LF.bind(this),this._onContextMenu=qF.bind(this),this._onMouseWheel=kF.bind(this),this._onKeyDown=UF.bind(this),this._onKeyUp=IF.bind(this),this._onTouchStart=GF.bind(this),this._onTouchMove=zF.bind(this),this._onTouchEnd=VF.bind(this),this._onMouseDown=BF.bind(this),this._onMouseMove=OF.bind(this),this._onMouseUp=FF.bind(this),this._target0=this.target.clone(),this._position0=this.object.position.clone(),this._up0=this.object.up.clone(),this._zoom0=this.object.zoom,null!==t&&(this.connect(),this.handleResize()),this.update()}connect(){window.addEventListener("keydown",this._onKeyDown),window.addEventListener("keyup",this._onKeyUp),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerCancel),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="none"}disconnect(){window.removeEventListener("keydown",this._onKeyDown),window.removeEventListener("keyup",this._onKeyUp),this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerCancel),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}handleResize(){const e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}update(){this._eye.subVectors(this.object.position,this.target),this.noRotate||this._rotateCamera(),this.noZoom||this._zoomCamera(),this.noPan||this._panCamera(),this.object.position.addVectors(this.target,this._eye),this.object.isPerspectiveCamera?(this._checkDistances(),this.object.lookAt(this.target),this._lastPosition.distanceToSquared(this.object.position)>hF&&(this.dispatchEvent(uF),this._lastPosition.copy(this.object.position))):this.object.isOrthographicCamera?(this.object.lookAt(this.target),(this._lastPosition.distanceToSquared(this.object.position)>hF||this._lastZoom!==this.object.zoom)&&(this.dispatchEvent(uF),this._lastPosition.copy(this.object.position),this._lastZoom=this.object.zoom)):console.warn("THREE.TrackballControls: Unsupported camera type.")}reset(){this.state=dF,this.keyState=dF,this.target.copy(this._target0),this.object.position.copy(this._position0),this.object.up.copy(this._up0),this.object.zoom=this._zoom0,this.object.updateProjectionMatrix(),this._eye.subVectors(this.object.position,this.target),this.object.lookAt(this.target),this.dispatchEvent(uF),this._lastPosition.copy(this.object.position),this._lastZoom=this.object.zoom}_panCamera(){if(yF.copy(this._panEnd).sub(this._panStart),yF.lengthSq()){if(this.object.isOrthographicCamera){const e=(this.object.right-this.object.left)/this.object.zoom/this.domElement.clientWidth,t=(this.object.top-this.object.bottom)/this.object.zoom/this.domElement.clientWidth;yF.x*=e,yF.y*=t}yF.multiplyScalar(this._eye.length()*this.panSpeed),bF.copy(this._eye).cross(this.object.up).setLength(yF.x),bF.add(xF.copy(this.object.up).setLength(yF.y)),this.object.position.add(bF),this.target.add(bF),this.staticMoving?this._panStart.copy(this._panEnd):this._panStart.add(yF.subVectors(this._panEnd,this._panStart).multiplyScalar(this.dynamicDampingFactor))}}_rotateCamera(){CF.set(this._moveCurr.x-this._movePrev.x,this._moveCurr.y-this._movePrev.y,0);let e=CF.length();e?(this._eye.copy(this.object.position).sub(this.target),wF.copy(this._eye).normalize(),MF.copy(this.object.up).normalize(),EF.crossVectors(MF,wF).normalize(),MF.setLength(this._moveCurr.y-this._movePrev.y),EF.setLength(this._moveCurr.x-this._movePrev.x),CF.copy(MF.add(EF)),SF.crossVectors(CF,this._eye).normalize(),e*=this.rotateSpeed,TF.setFromAxisAngle(SF,e),this._eye.applyQuaternion(TF),this.object.up.applyQuaternion(TF),this._lastAxis.copy(SF),this._lastAngle=e):!this.staticMoving&&this._lastAngle&&(this._lastAngle*=Math.sqrt(1-this.dynamicDampingFactor),this._eye.copy(this.object.position).sub(this.target),TF.setFromAxisAngle(this._lastAxis,this._lastAngle),this._eye.applyQuaternion(TF),this.object.up.applyQuaternion(TF)),this._movePrev.copy(this._moveCurr)}_zoomCamera(){let e;this.state===vF?(e=this._touchZoomDistanceStart/this._touchZoomDistanceEnd,this._touchZoomDistanceStart=this._touchZoomDistanceEnd,this.object.isPerspectiveCamera?this._eye.multiplyScalar(e):this.object.isOrthographicCamera?(this.object.zoom=Dt.clamp(this.object.zoom/e,this.minZoom,this.maxZoom),this._lastZoom!==this.object.zoom&&this.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")):(e=1+(this._zoomEnd.y-this._zoomStart.y)*this.zoomSpeed,1!==e&&e>0&&(this.object.isPerspectiveCamera?this._eye.multiplyScalar(e):this.object.isOrthographicCamera?(this.object.zoom=Dt.clamp(this.object.zoom/e,this.minZoom,this.maxZoom),this._lastZoom!==this.object.zoom&&this.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")),this.staticMoving?this._zoomStart.copy(this._zoomEnd):this._zoomStart.y+=(this._zoomEnd.y-this._zoomStart.y)*this.dynamicDampingFactor)}_getMouseOnScreen(e,t){return _F.set((e-this.screen.left)/this.screen.width,(t-this.screen.top)/this.screen.height),_F}_getMouseOnCircle(e,t){return _F.set((e-.5*this.screen.width-this.screen.left)/(.5*this.screen.width),(this.screen.height+2*(this.screen.top-t))/this.screen.width),_F}_addPointer(e){this._pointers.push(e)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t].pointerId==e.pointerId)return void this._pointers.splice(t,1)}_trackPointer(e){let t=this._pointerPositions[e.pointerId];void 0===t&&(t=new Lt,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){const t=e.pointerId===this._pointers[0].pointerId?this._pointers[1]:this._pointers[0];return this._pointerPositions[t.pointerId]}_checkDistances(){this.noZoom&&this.noPan||(this._eye.lengthSq()>this.maxDistance*this.maxDistance&&(this.object.position.addVectors(this.target,this._eye.setLength(this.maxDistance)),this._zoomStart.copy(this._zoomEnd)),this._eye.lengthSq()<this.minDistance*this.minDistance&&(this.object.position.addVectors(this.target,this._eye.setLength(this.minDistance)),this._zoomStart.copy(this._zoomEnd)))}}function NF(e){!1!==this.enabled&&(0===this._pointers.length&&(this.domElement.setPointerCapture(e.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),this._addPointer(e),"touch"===e.pointerType?this._onTouchStart(e):this._onMouseDown(e))}function PF(e){!1!==this.enabled&&("touch"===e.pointerType?this._onTouchMove(e):this._onMouseMove(e))}function DF(e){!1!==this.enabled&&("touch"===e.pointerType?this._onTouchEnd(e):this._onMouseUp(),this._removePointer(e),0===this._pointers.length&&(this.domElement.releasePointerCapture(e.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp)))}function LF(e){this._removePointer(e)}function IF(){!1!==this.enabled&&(this.keyState=dF,window.addEventListener("keydown",this._onKeyDown))}function UF(e){!1!==this.enabled&&(window.removeEventListener("keydown",this._onKeyDown),this.keyState===dF&&(e.code!==this.keys[pF]||this.noRotate?e.code!==this.keys[fF]||this.noZoom?e.code!==this.keys[mF]||this.noPan||(this.keyState=mF):this.keyState=fF:this.keyState=pF))}function BF(e){let t;switch(e.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case a.DOLLY:this.state=fF;break;case a.ROTATE:this.state=pF;break;case a.PAN:this.state=mF;break;default:this.state=dF}const n=this.keyState!==dF?this.keyState:this.state;n!==pF||this.noRotate?n!==fF||this.noZoom?n!==mF||this.noPan||(this._panStart.copy(this._getMouseOnScreen(e.pageX,e.pageY)),this._panEnd.copy(this._panStart)):(this._zoomStart.copy(this._getMouseOnScreen(e.pageX,e.pageY)),this._zoomEnd.copy(this._zoomStart)):(this._moveCurr.copy(this._getMouseOnCircle(e.pageX,e.pageY)),this._movePrev.copy(this._moveCurr)),this.dispatchEvent(cF)}function OF(e){const t=this.keyState!==dF?this.keyState:this.state;t!==pF||this.noRotate?t!==fF||this.noZoom?t!==mF||this.noPan||this._panEnd.copy(this._getMouseOnScreen(e.pageX,e.pageY)):this._zoomEnd.copy(this._getMouseOnScreen(e.pageX,e.pageY)):(this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this._getMouseOnCircle(e.pageX,e.pageY)))}function FF(){this.state=dF,this.dispatchEvent(AF)}function kF(e){if(!1!==this.enabled&&!0!==this.noZoom){switch(e.preventDefault(),e.deltaMode){case 2:this._zoomStart.y-=.025*e.deltaY;break;case 1:this._zoomStart.y-=.01*e.deltaY;break;default:this._zoomStart.y-=25e-5*e.deltaY}this.dispatchEvent(cF),this.dispatchEvent(AF)}}function qF(e){!1!==this.enabled&&e.preventDefault()}function GF(e){if(this._trackPointer(e),1===this._pointers.length)this.state=gF,this._moveCurr.copy(this._getMouseOnCircle(this._pointers[0].pageX,this._pointers[0].pageY)),this._movePrev.copy(this._moveCurr);else{this.state=vF;const e=this._pointers[0].pageX-this._pointers[1].pageX,t=this._pointers[0].pageY-this._pointers[1].pageY;this._touchZoomDistanceEnd=this._touchZoomDistanceStart=Math.sqrt(e*e+t*t);const n=(this._pointers[0].pageX+this._pointers[1].pageX)/2,r=(this._pointers[0].pageY+this._pointers[1].pageY)/2;this._panStart.copy(this._getMouseOnScreen(n,r)),this._panEnd.copy(this._panStart)}this.dispatchEvent(cF)}function zF(e){if(this._trackPointer(e),1===this._pointers.length)this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this._getMouseOnCircle(e.pageX,e.pageY));else{const t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y;this._touchZoomDistanceEnd=Math.sqrt(n*n+r*r);const i=(e.pageX+t.x)/2,s=(e.pageY+t.y)/2;this._panEnd.copy(this._getMouseOnScreen(i,s))}}function VF(e){switch(this._pointers.length){case 0:this.state=dF;break;case 1:this.state=gF,this._moveCurr.copy(this._getMouseOnCircle(e.pageX,e.pageY)),this._movePrev.copy(this._moveCurr);break;case 2:this.state=vF;for(let t=0;t<this._pointers.length;t++)if(this._pointers[t].pointerId!==e.pointerId){const e=this._pointerPositions[this._pointers[t].pointerId];this._moveCurr.copy(this._getMouseOnCircle(e.x,e.y)),this._movePrev.copy(this._moveCurr);break}}this.dispatchEvent(AF)}const HF={type:"change"},jF={type:"start"},WF={type:"end"},XF=new Bn,QF=new Oi,YF=Math.cos(70*Dt.DEG2RAD),$F=new on,KF=2*Math.PI,ZF=-1,JF=0,ek=1,tk=2,nk=3,rk=4,ik=5,sk=6,ak=1e-6;class ok extends no{constructor(e,t=null){super(e,t),this.state=ZF,this.enabled=!0,this.target=new on,this.cursor=new on,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:a.ROTATE,MIDDLE:a.DOLLY,RIGHT:a.PAN},this.touches={ONE:o,TWO:u},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new on,this._lastQuaternion=new an,this._lastTargetPosition=new on,this._quat=(new an).setFromUnitVectors(e.up,new on(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new Za,this._sphericalDelta=new Za,this._scale=1,this._panOffset=new on,this._rotateStart=new Lt,this._rotateEnd=new Lt,this._rotateDelta=new Lt,this._panStart=new Lt,this._panEnd=new Lt,this._panDelta=new Lt,this._dollyStart=new Lt,this._dollyEnd=new Lt,this._dollyDelta=new Lt,this._dollyDirection=new on,this._mouse=new Lt,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=uk.bind(this),this._onPointerDown=lk.bind(this),this._onPointerUp=ck.bind(this),this._onContextMenu=gk.bind(this),this._onMouseWheel=dk.bind(this),this._onKeyDown=pk.bind(this),this._onTouchStart=fk.bind(this),this._onTouchMove=mk.bind(this),this._onMouseDown=Ak.bind(this),this._onMouseMove=hk.bind(this),this._interceptControlDown=vk.bind(this),this._interceptControlUp=_k.bind(this),null!==this.domElement&&this.connect(),this.update()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1});this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents();this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){null!==this._domElementKeyEvents&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(HF),this.update(),this.state=ZF}update(e=null){const t=this.object.position;$F.copy(t).sub(this.target),$F.applyQuaternion(this._quat),this._spherical.setFromVector3($F),this.autoRotate&&this.state===ZF&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,r=this.maxAzimuthAngle;isFinite(n)&&isFinite(r)&&(n<-Math.PI?n+=KF:n>Math.PI&&(n-=KF),r<-Math.PI?r+=KF:r>Math.PI&&(r-=KF),this._spherical.theta=n<=r?Math.max(n,Math.min(r,this._spherical.theta)):this._spherical.theta>(n+r)/2?Math.max(n,this._spherical.theta):Math.min(r,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),!0===this.enableDamping?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let i=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const e=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),i=e!=this._spherical.radius}if($F.setFromSpherical(this._spherical),$F.applyQuaternion(this._quatInverse),t.copy(this.target).add($F),this.object.lookAt(this.target),!0===this.enableDamping?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let e=null;if(this.object.isPerspectiveCamera){const t=$F.length();e=this._clampDistance(t*this._scale);const n=t-e;this.object.position.addScaledVector(this._dollyDirection,n),this.object.updateMatrixWorld(),i=!!n}else if(this.object.isOrthographicCamera){const t=new on(this._mouse.x,this._mouse.y,0);t.unproject(this.object);const n=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),i=n!==this.object.zoom;const r=new on(this._mouse.x,this._mouse.y,0);r.unproject(this.object),this.object.position.sub(r).add(t),this.object.updateMatrixWorld(),e=$F.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;null!==e&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position):(XF.origin.copy(this.object.position),XF.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(XF.direction))<YF?this.object.lookAt(this.target):(QF.setFromNormalAndCoplanarPoint(this.object.up,this.target),XF.intersectPlane(QF,this.target))))}else if(this.object.isOrthographicCamera){const e=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),e!==this.object.zoom&&(this.object.updateProjectionMatrix(),i=!0)}return this._scale=1,this._performCursorZoom=!1,!!(i||this._lastPosition.distanceToSquared(this.object.position)>ak||8*(1-this._lastQuaternion.dot(this.object.quaternion))>ak||this._lastTargetPosition.distanceToSquared(this.target)>ak)&&(this.dispatchEvent(HF),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0)}_getAutoRotationAngle(e){return null!==e?KF/60*this.autoRotateSpeed*e:KF/60/60*this.autoRotateSpeed}_getZoomScale(e){const t=Math.abs(.01*e);return Math.pow(.95,this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){$F.setFromMatrixColumn(t,0),$F.multiplyScalar(-e),this._panOffset.add($F)}_panUp(e,t){!0===this.screenSpacePanning?$F.setFromMatrixColumn(t,1):($F.setFromMatrixColumn(t,0),$F.crossVectors(this.object.up,$F)),$F.multiplyScalar(e),this._panOffset.add($F)}_pan(e,t){const n=this.domElement;if(this.object.isPerspectiveCamera){const r=this.object.position;$F.copy(r).sub(this.target);let i=$F.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*i/n.clientHeight,this.object.matrix),this._panUp(2*t*i/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const n=this.domElement.getBoundingClientRect(),r=e-n.left,i=t-n.top,s=n.width,a=n.height;this._mouse.x=r/s*2-1,this._mouse.y=-i/a*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(KF*this._rotateDelta.x/t.clientHeight),this._rotateUp(KF*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(KF*this.rotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-KF*this.rotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(KF*this.rotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-KF*this.rotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(1===this._pointers.length)this._rotateStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateStart.set(n,r)}}_handleTouchStartPan(e){if(1===this._pointers.length)this._panStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panStart.set(n,r)}}_handleTouchStartDolly(e){const t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyStart.set(0,i)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(1==this._pointers.length)this._rotateEnd.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateEnd.set(n,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(KF*this._rotateDelta.x/t.clientHeight),this._rotateUp(KF*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(1===this._pointers.length)this._panEnd.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panEnd.set(n,r)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyEnd.set(0,i),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const s=.5*(e.pageX+t.x),a=.5*(e.pageY+t.y);this._updateZoomParameters(s,a)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return void this._pointers.splice(t,1)}_isTrackingPointer(e){for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return!0;return!1}_trackPointer(e){let t=this._pointerPositions[e.pointerId];void 0===t&&(t=new Lt,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){const t=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[t]}_customWheelEvent(e){const t=e.deltaMode,n={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:n.deltaY*=16;break;case 2:n.deltaY*=100}return e.ctrlKey&&!this._controlActive&&(n.deltaY*=10),n}}function lk(e){!1!==this.enabled&&(0===this._pointers.length&&(this.domElement.setPointerCapture(e.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),this._isTrackingPointer(e)||(this._addPointer(e),"touch"===e.pointerType?this._onTouchStart(e):this._onMouseDown(e)))}function uk(e){!1!==this.enabled&&("touch"===e.pointerType?this._onTouchMove(e):this._onMouseMove(e))}function ck(e){switch(this._removePointer(e),this._pointers.length){case 0:this.domElement.releasePointerCapture(e.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(WF),this.state=ZF;break;case 1:const t=this._pointers[0],n=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:n.x,pageY:n.y})}}function Ak(e){let t;switch(e.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case a.DOLLY:if(!1===this.enableZoom)return;this._handleMouseDownDolly(e),this.state=ek;break;case a.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===this.enablePan)return;this._handleMouseDownPan(e),this.state=tk}else{if(!1===this.enableRotate)return;this._handleMouseDownRotate(e),this.state=JF}break;case a.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===this.enableRotate)return;this._handleMouseDownRotate(e),this.state=JF}else{if(!1===this.enablePan)return;this._handleMouseDownPan(e),this.state=tk}break;default:this.state=ZF}this.state!==ZF&&this.dispatchEvent(jF)}function hk(e){switch(this.state){case JF:if(!1===this.enableRotate)return;this._handleMouseMoveRotate(e);break;case ek:if(!1===this.enableZoom)return;this._handleMouseMoveDolly(e);break;case tk:if(!1===this.enablePan)return;this._handleMouseMovePan(e)}}function dk(e){!1!==this.enabled&&!1!==this.enableZoom&&this.state===ZF&&(e.preventDefault(),this.dispatchEvent(jF),this._handleMouseWheel(this._customWheelEvent(e)),this.dispatchEvent(WF))}function pk(e){!1!==this.enabled&&this._handleKeyDown(e)}function fk(e){switch(this._trackPointer(e),this._pointers.length){case 1:switch(this.touches.ONE){case o:if(!1===this.enableRotate)return;this._handleTouchStartRotate(e),this.state=nk;break;case l:if(!1===this.enablePan)return;this._handleTouchStartPan(e),this.state=rk;break;default:this.state=ZF}break;case 2:switch(this.touches.TWO){case u:if(!1===this.enableZoom&&!1===this.enablePan)return;this._handleTouchStartDollyPan(e),this.state=ik;break;case c:if(!1===this.enableZoom&&!1===this.enableRotate)return;this._handleTouchStartDollyRotate(e),this.state=sk;break;default:this.state=ZF}break;default:this.state=ZF}this.state!==ZF&&this.dispatchEvent(jF)}function mk(e){switch(this._trackPointer(e),this.state){case nk:if(!1===this.enableRotate)return;this._handleTouchMoveRotate(e),this.update();break;case rk:if(!1===this.enablePan)return;this._handleTouchMovePan(e),this.update();break;case ik:if(!1===this.enableZoom&&!1===this.enablePan)return;this._handleTouchMoveDollyPan(e),this.update();break;case sk:if(!1===this.enableZoom&&!1===this.enableRotate)return;this._handleTouchMoveDollyRotate(e),this.update();break;default:this.state=ZF}}function gk(e){!1!==this.enabled&&e.preventDefault()}function vk(e){if("Control"===e.key){this._controlActive=!0;this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0})}}function _k(e){if("Control"===e.key){this._controlActive=!1;this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0})}}const yk={type:"change"},xk=1e-6,bk=new an;class Sk extends no{constructor(e,t=null){super(e,t),this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1,this._moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this._moveVector=new on(0,0,0),this._rotationVector=new on(0,0,0),this._lastQuaternion=new an,this._lastPosition=new on,this._status=0,this._onKeyDown=Tk.bind(this),this._onKeyUp=wk.bind(this),this._onPointerMove=Ek.bind(this),this._onPointerDown=Mk.bind(this),this._onPointerUp=Ck.bind(this),this._onPointerCancel=Rk.bind(this),this._onContextMenu=Nk.bind(this),null!==t&&this.connect()}connect(){window.addEventListener("keydown",this._onKeyDown),window.addEventListener("keyup",this._onKeyUp),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointerup",this._onPointerUp),this.domElement.addEventListener("pointercancel",this._onPointerCancel),this.domElement.addEventListener("contextmenu",this._onContextMenu)}disconnect(){window.removeEventListener("keydown",this._onKeyDown),window.removeEventListener("keyup",this._onKeyUp),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerCancel),this.domElement.removeEventListener("contextmenu",this._onContextMenu)}dispose(){this.disconnect()}update(e){if(!1===this.enabled)return;const t=this.object,n=e*this.movementSpeed,r=e*this.rollSpeed;t.translateX(this._moveVector.x*n),t.translateY(this._moveVector.y*n),t.translateZ(this._moveVector.z*n),bk.set(this._rotationVector.x*r,this._rotationVector.y*r,this._rotationVector.z*r,1).normalize(),t.quaternion.multiply(bk),(this._lastPosition.distanceToSquared(t.position)>xk||8*(1-this._lastQuaternion.dot(t.quaternion))>xk)&&(this.dispatchEvent(yk),this._lastQuaternion.copy(t.quaternion),this._lastPosition.copy(t.position))}_updateMovementVector(){const e=this._moveState.forward||this.autoForward&&!this._moveState.back?1:0;this._moveVector.x=-this._moveState.left+this._moveState.right,this._moveVector.y=-this._moveState.down+this._moveState.up,this._moveVector.z=-e+this._moveState.back}_updateRotationVector(){this._rotationVector.x=-this._moveState.pitchDown+this._moveState.pitchUp,this._rotationVector.y=-this._moveState.yawRight+this._moveState.yawLeft,this._rotationVector.z=-this._moveState.rollRight+this._moveState.rollLeft}_getContainerDimensions(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}}}function Tk(e){if(!e.altKey&&!1!==this.enabled){switch(e.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=.1;break;case"KeyW":this._moveState.forward=1;break;case"KeyS":this._moveState.back=1;break;case"KeyA":this._moveState.left=1;break;case"KeyD":this._moveState.right=1;break;case"KeyR":this._moveState.up=1;break;case"KeyF":this._moveState.down=1;break;case"ArrowUp":this._moveState.pitchUp=1;break;case"ArrowDown":this._moveState.pitchDown=1;break;case"ArrowLeft":this._moveState.yawLeft=1;break;case"ArrowRight":this._moveState.yawRight=1;break;case"KeyQ":this._moveState.rollLeft=1;break;case"KeyE":this._moveState.rollRight=1}this._updateMovementVector(),this._updateRotationVector()}}function wk(e){if(!1!==this.enabled){switch(e.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=1;break;case"KeyW":this._moveState.forward=0;break;case"KeyS":this._moveState.back=0;break;case"KeyA":this._moveState.left=0;break;case"KeyD":this._moveState.right=0;break;case"KeyR":this._moveState.up=0;break;case"KeyF":this._moveState.down=0;break;case"ArrowUp":this._moveState.pitchUp=0;break;case"ArrowDown":this._moveState.pitchDown=0;break;case"ArrowLeft":this._moveState.yawLeft=0;break;case"ArrowRight":this._moveState.yawRight=0;break;case"KeyQ":this._moveState.rollLeft=0;break;case"KeyE":this._moveState.rollRight=0}this._updateMovementVector(),this._updateRotationVector()}}function Mk(e){if(!1!==this.enabled)if(this.dragToLook)this._status++;else{switch(e.button){case 0:this._moveState.forward=1;break;case 2:this._moveState.back=1}this._updateMovementVector()}}function Ek(e){if(!1!==this.enabled&&(!this.dragToLook||this._status>0)){const t=this._getContainerDimensions(),n=t.size[0]/2,r=t.size[1]/2;this._moveState.yawLeft=-(e.pageX-t.offset[0]-n)/n,this._moveState.pitchDown=(e.pageY-t.offset[1]-r)/r,this._updateRotationVector()}}function Ck(e){if(!1!==this.enabled){if(this.dragToLook)this._status--,this._moveState.yawLeft=this._moveState.pitchDown=0;else{switch(e.button){case 0:this._moveState.forward=0;break;case 2:this._moveState.back=0}this._updateMovementVector()}this._updateRotationVector()}}function Rk(){!1!==this.enabled&&(this.dragToLook?(this._status=0,this._moveState.yawLeft=this._moveState.pitchDown=0):(this._moveState.forward=0,this._moveState.back=0,this._updateMovementVector()),this._updateRotationVector())}function Nk(e){!1!==this.enabled&&e.preventDefault()}const Pk={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform float opacity;\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\t\t\tgl_FragColor = opacity * texel;\n\n\n\t\t}"};class Dk{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}const Lk=new Oa(-1,1,1,-1,0,1);const Ik=new class extends Zr{constructor(){super(),this.setAttribute("position",new Hr([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Hr([0,2,0,0,2,0],2))}};class Uk{constructor(e){this._mesh=new ci(Ik,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,Lk)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}class Bk extends Dk{constructor(e,t){super(),this.textureID=void 0!==t?t:"tDiffuse",e instanceof gi?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=mi.clone(e.uniforms),this.material=new gi({name:void 0!==e.name?e.name:"unspecified",defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new Uk(this.material)}render(e,t,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}dispose(){this.material.dispose(),this.fsQuad.dispose()}}class Ok extends Dk{constructor(e,t){super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,t,n){const r=e.getContext(),i=e.state;let s,a;i.buffers.color.setMask(!1),i.buffers.depth.setMask(!1),i.buffers.color.setLocked(!0),i.buffers.depth.setLocked(!0),this.inverse?(s=0,a=1):(s=1,a=0),i.buffers.stencil.setTest(!0),i.buffers.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),i.buffers.stencil.setFunc(r.ALWAYS,s,4294967295),i.buffers.stencil.setClear(a),i.buffers.stencil.setLocked(!0),e.setRenderTarget(n),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),i.buffers.color.setLocked(!1),i.buffers.depth.setLocked(!1),i.buffers.color.setMask(!0),i.buffers.depth.setMask(!0),i.buffers.stencil.setLocked(!1),i.buffers.stencil.setFunc(r.EQUAL,1,4294967295),i.buffers.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),i.buffers.stencil.setLocked(!0)}}class Fk extends Dk{constructor(){super(),this.needsSwap=!1}render(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}}class kk{constructor(e,t){if(this.renderer=e,this._pixelRatio=e.getPixelRatio(),void 0===t){const n=e.getSize(new Lt);this._width=n.width,this._height=n.height,(t=new nn(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:oe})).texture.name="EffectComposer.rt1"}else this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],this.copyPass=new Bk(Pk),this.copyPass.material.blending=0,this.clock=new Wa}swapBuffers(){const e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){const t=this.passes.indexOf(e);-1!==t&&this.passes.splice(t,1)}isLastEnabledPass(e){for(let t=e+1;t<this.passes.length;t++)if(this.passes[t].enabled)return!1;return!0}render(e){void 0===e&&(e=this.clock.getDelta());const t=this.renderer.getRenderTarget();let n=!1;for(let t=0,r=this.passes.length;t<r;t++){const r=this.passes[t];if(!1!==r.enabled){if(r.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(t),r.render(this.renderer,this.writeBuffer,this.readBuffer,e,n),r.needsSwap){if(n){const t=this.renderer.getContext(),n=this.renderer.state.buffers.stencil;n.setFunc(t.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),n.setFunc(t.EQUAL,1,4294967295)}this.swapBuffers()}void 0!==Ok&&(r instanceof Ok?n=!0:r instanceof Fk&&(n=!1))}}this.renderer.setRenderTarget(t)}reset(e){if(void 0===e){const t=this.renderer.getSize(new Lt);this._pixelRatio=this.renderer.getPixelRatio(),this._width=t.width,this._height=t.height,(e=this.renderTarget1.clone()).setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(e,t){this._width=e,this._height=t;const n=this._width*this._pixelRatio,r=this._height*this._pixelRatio;this.renderTarget1.setSize(n,r),this.renderTarget2.setSize(n,r);for(let e=0;e<this.passes.length;e++)this.passes[e].setSize(n,r)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.copyPass.dispose()}}class qk extends Dk{constructor(e,t,n=null,r=null,i=null){super(),this.scene=e,this.camera=t,this.overrideMaterial=n,this.clearColor=r,this.clearAlpha=i,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new Rr}render(e,t,n){const r=e.autoClear;let i,s;e.autoClear=!1,null!==this.overrideMaterial&&(s=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),null!==this.clearColor&&(e.getClearColor(this._oldClearColor),e.setClearColor(this.clearColor,e.getClearAlpha())),null!==this.clearAlpha&&(i=e.getClearAlpha(),e.setClearAlpha(this.clearAlpha)),1==this.clearDepth&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:n),!0===this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),null!==this.clearColor&&e.setClearColor(this._oldClearColor),null!==this.clearAlpha&&e.setClearAlpha(i),null!==this.overrideMaterial&&(this.scene.overrideMaterial=s),e.autoClear=r}}function Gk(){return Gk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gk.apply(null,arguments)}function zk(e,t){return zk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},zk(e,t)}function Vk(e){return Vk=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Vk(e)}function Hk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Hk=function(){return!!e})()}function jk(e){var t="function"==typeof Map?new Map:void 0;return jk=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(Hk())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&zk(i,n.prototype),i}(e,arguments,Vk(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),zk(n,e)},jk(e)}var Wk={1:"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",2:"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",3:"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",4:"Couldn't generate valid rgb string from %s, it returned %s.\n\n",5:"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",6:"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",7:"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",8:"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",9:"Please provide a number of steps to the modularScale helper.\n\n",10:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",11:'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',12:'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',13:'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',14:'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',15:'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',16:"You must provide a template to this method.\n\n",17:"You passed an unsupported selector state to this method.\n\n",18:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",19:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",20:"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:"fontFace expects a name of a font-family.\n\n",24:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",25:"fontFace expects localFonts to be an array.\n\n",26:"fontFace expects fileFormats to be an array.\n\n",27:"radialGradient requries at least 2 color-stops to properly render.\n\n",28:"Please supply a filename to retinaImage() as the first argument.\n\n",29:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",32:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",33:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",34:"borderRadius expects a radius value as a string or number as the second argument.\n\n",35:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',36:"Property must be a string value.\n\n",37:"Syntax Error at %s.\n\n",38:"Formula contains a function that needs parentheses at %s.\n\n",39:"Formula is missing closing parenthesis at %s.\n\n",40:"Formula has too many closing parentheses at %s.\n\n",41:"All values in a formula must have the same unit or be unitless.\n\n",42:"Please provide a number of steps to the modularScale helper.\n\n",43:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",44:"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",45:"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",46:"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",47:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",48:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",49:"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",50:"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",51:"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",52:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",53:"fontFace expects localFonts to be an array.\n\n",54:"fontFace expects fileFormats to be an array.\n\n",55:"fontFace expects a name of a font-family.\n\n",56:"linearGradient requries at least 2 color-stops to properly render.\n\n",57:"radialGradient requries at least 2 color-stops to properly render.\n\n",58:"Please supply a filename to retinaImage() as the first argument.\n\n",59:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:"Property must be a string value.\n\n",62:"borderRadius expects a radius value as a string or number as the second argument.\n\n",63:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',64:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",65:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",66:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",67:"You must provide a template to this method.\n\n",68:"You passed an unsupported selector state to this method.\n\n",69:'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',70:'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',71:'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',72:'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',73:"Please provide a valid CSS variable.\n\n",74:"CSS variable not found and no default was provided.\n\n",75:"important requires a valid style object, got a %s instead.\n\n",76:"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",77:'remToPx expects a value in "rem" but you provided it in "%s".\n\n',78:'base must be set in "px" or "%" but you set it in "%s".\n'};function Xk(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=t[0],s=[];for(r=1;r<t.length;r+=1)s.push(t[r]);return s.forEach((function(e){i=i.replace(/%[a-z]/,e)})),i}var Qk=function(e){var t,n;function r(t){var n;if("production"===process.env.NODE_ENV)n=e.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+t+" for more information.")||this;else{for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];n=e.call(this,Xk.apply(void 0,[Wk[t]].concat(i)))||this}return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n)}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,zk(t,n),r}(jk(Error));function Yk(e){return Math.round(255*e)}function $k(e,t,n){return Yk(e)+","+Yk(t)+","+Yk(n)}function Kk(e,t,n,r){if(void 0===r&&(r=$k),0===t)return r(n,n,n);var i=(e%360+360)%360/60,s=(1-Math.abs(2*n-1))*t,a=s*(1-Math.abs(i%2-1)),o=0,l=0,u=0;i>=0&&i<1?(o=s,l=a):i>=1&&i<2?(o=a,l=s):i>=2&&i<3?(l=s,u=a):i>=3&&i<4?(l=a,u=s):i>=4&&i<5?(o=a,u=s):i>=5&&i<6&&(o=s,u=a);var c=n-s/2;return r(o+c,l+c,u+c)}var Zk={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var Jk=/^#[a-fA-F0-9]{6}$/,eq=/^#[a-fA-F0-9]{8}$/,tq=/^#[a-fA-F0-9]{3}$/,nq=/^#[a-fA-F0-9]{4}$/,rq=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,iq=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,sq=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,aq=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function oq(e){if("string"!=typeof e)throw new Qk(3);var t=function(e){if("string"!=typeof e)return e;var t=e.toLowerCase();return Zk[t]?"#"+Zk[t]:e}(e);if(t.match(Jk))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(eq)){var n=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:n}}if(t.match(tq))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(nq)){var r=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:r}}var i=rq.exec(t);if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10)};var s=iq.exec(t.substring(0,50));if(s)return{red:parseInt(""+s[1],10),green:parseInt(""+s[2],10),blue:parseInt(""+s[3],10),alpha:parseFloat(""+s[4])>1?parseFloat(""+s[4])/100:parseFloat(""+s[4])};var a=sq.exec(t);if(a){var o="rgb("+Kk(parseInt(""+a[1],10),parseInt(""+a[2],10)/100,parseInt(""+a[3],10)/100)+")",l=rq.exec(o);if(!l)throw new Qk(4,t,o);return{red:parseInt(""+l[1],10),green:parseInt(""+l[2],10),blue:parseInt(""+l[3],10)}}var u=aq.exec(t.substring(0,50));if(u){var c="rgb("+Kk(parseInt(""+u[1],10),parseInt(""+u[2],10)/100,parseInt(""+u[3],10)/100)+")",A=rq.exec(c);if(!A)throw new Qk(4,t,c);return{red:parseInt(""+A[1],10),green:parseInt(""+A[2],10),blue:parseInt(""+A[3],10),alpha:parseFloat(""+u[4])>1?parseFloat(""+u[4])/100:parseFloat(""+u[4])}}throw new Qk(5)}function lq(e){return function(e){var t,n=e.red/255,r=e.green/255,i=e.blue/255,s=Math.max(n,r,i),a=Math.min(n,r,i),o=(s+a)/2;if(s===a)return void 0!==e.alpha?{hue:0,saturation:0,lightness:o,alpha:e.alpha}:{hue:0,saturation:0,lightness:o};var l=s-a,u=o>.5?l/(2-s-a):l/(s+a);switch(s){case n:t=(r-i)/l+(r<i?6:0);break;case r:t=(i-n)/l+2;break;default:t=(n-r)/l+4}return t*=60,void 0!==e.alpha?{hue:t,saturation:u,lightness:o,alpha:e.alpha}:{hue:t,saturation:u,lightness:o}}(oq(e))}var uq=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e};function cq(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function Aq(e){return cq(Math.round(255*e))}function hq(e,t,n){return uq("#"+Aq(e)+Aq(t)+Aq(n))}function dq(e,t,n){return Kk(e,t,n,hq)}function pq(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return uq("#"+cq(e)+cq(t)+cq(n));if("object"==typeof e&&void 0===t&&void 0===n)return uq("#"+cq(e.red)+cq(e.green)+cq(e.blue));throw new Qk(6)}function fq(e,t,n,r){if("object"==typeof e&&void 0===t&&void 0===n&&void 0===r)return e.alpha>=1?pq(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new Qk(7)}function mq(e){if("object"!=typeof e)throw new Qk(8);if(function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&"number"==typeof e.alpha}(e))return fq(e);if(function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&("number"!=typeof e.alpha||void 0===e.alpha)}(e))return pq(e);if(function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&"number"==typeof e.alpha}(e))return function(e,t,n,r){if("object"==typeof e&&void 0===t&&void 0===n&&void 0===r)return e.alpha>=1?dq(e.hue,e.saturation,e.lightness):"rgba("+Kk(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new Qk(2)}(e);if(function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&("number"!=typeof e.alpha||void 0===e.alpha)}(e))return function(e,t,n){if("object"==typeof e&&void 0===t&&void 0===n)return dq(e.hue,e.saturation,e.lightness);throw new Qk(1)}(e);throw new Qk(8)}function gq(e,t,n){return function(){var r=n.concat(Array.prototype.slice.call(arguments));return r.length>=t?e.apply(this,r):gq(e,t,r)}}function vq(e){return gq(e,e.length,[])}function _q(e,t,n){return Math.max(e,Math.min(t,n))}vq((function(e,t){if("transparent"===t)return t;var n=lq(t);return mq(Gk({},n,{hue:n.hue+parseFloat(e)}))})),vq((function(e,t){if("transparent"===t)return t;var n=lq(t);return mq(Gk({},n,{lightness:_q(0,1,n.lightness-parseFloat(e))}))})),vq((function(e,t){if("transparent"===t)return t;var n=lq(t);return mq(Gk({},n,{saturation:_q(0,1,n.saturation-parseFloat(e))}))})),vq((function(e,t){if("transparent"===t)return t;var n=lq(t);return mq(Gk({},n,{lightness:_q(0,1,n.lightness+parseFloat(e))}))}));var yq=vq((function(e,t,n){if("transparent"===t)return n;if("transparent"===n)return t;if(0===e)return n;var r=oq(t),i=Gk({},r,{alpha:"number"==typeof r.alpha?r.alpha:1}),s=oq(n),a=Gk({},s,{alpha:"number"==typeof s.alpha?s.alpha:1}),o=i.alpha-a.alpha,l=2*parseFloat(e)-1,u=((l*o==-1?l:l+o)/(1+l*o)+1)/2,c=1-u;return fq({red:Math.floor(i.red*u+a.red*c),green:Math.floor(i.green*u+a.green*c),blue:Math.floor(i.blue*u+a.blue*c),alpha:i.alpha*parseFloat(e)+a.alpha*(1-parseFloat(e))})})),xq=yq;var bq=vq((function(e,t){if("transparent"===t)return t;var n=oq(t);return fq(Gk({},n,{alpha:_q(0,1,(100*("number"==typeof n.alpha?n.alpha:1)+100*parseFloat(e))/100)}))})),Sq=bq;vq((function(e,t){if("transparent"===t)return t;var n=lq(t);return mq(Gk({},n,{saturation:_q(0,1,n.saturation+parseFloat(e))}))})),vq((function(e,t){return"transparent"===t?t:mq(Gk({},lq(t),{hue:parseFloat(e)}))})),vq((function(e,t){return"transparent"===t?t:mq(Gk({},lq(t),{lightness:parseFloat(e)}))})),vq((function(e,t){return"transparent"===t?t:mq(Gk({},lq(t),{saturation:parseFloat(e)}))})),vq((function(e,t){return"transparent"===t?t:xq(parseFloat(e),"rgb(0, 0, 0)",t)})),vq((function(e,t){return"transparent"===t?t:xq(parseFloat(e),"rgb(255, 255, 255)",t)})),vq((function(e,t){if("transparent"===t)return t;var n=oq(t);return fq(Gk({},n,{alpha:_q(0,1,+(100*("number"==typeof n.alpha?n.alpha:1)-100*parseFloat(e)).toFixed(2)/100)}))}));function Tq(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wq(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mq(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,0===t);else for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}(e,t)||Cq(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Eq(e){return function(e){if(Array.isArray(e))return Tq(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Cq(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cq(e,t){if(e){if("string"==typeof e)return Tq(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Tq(e,t):void 0}}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}(".scene-nav-info {\n bottom: 5px;\n width: 100%;\n text-align: center;\n color: slategrey;\n opacity: 0.7;\n font-size: 10px;\n}\n\n.scene-tooltip {\n top: 0;\n color: lavender;\n font-size: 15px;\n}\n\n.scene-nav-info, .scene-tooltip {\n position: absolute;\n font-family: sans-serif;\n pointer-events: none;\n user-select: none;\n}\n\n.scene-container canvas:focus {\n outline: none;\n}");var Rq=window.THREE?window.THREE:{WebGLRenderer:class{constructor(e={}){const{canvas:t=Ft(),context:n=null,depth:r=!0,stencil:i=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:A=!1,reverseDepthBuffer:h=!1}=e;let d;if(this.isWebGLRenderer=!0,null!==n){if("undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=n.getContextAttributes().alpha}else d=a;const p=new Uint32Array(4),f=new Int32Array(4);let m=null,g=null;const v=[],_=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=rt,this.toneMapping=0,this.toneMappingExposure=1;const y=this;let x=!1,b=0,S=0,T=null,w=-1,M=null;const E=new en,C=new en;let R=null;const N=new Rr(0);let P=0,D=t.width,L=t.height,I=1,U=null,B=null;const O=new en(0,0,D,L),F=new en(0,0,D,L);let k=!1;const q=new qi;let G=!1,z=!1;const V=new On,H=new On,j=new on,W=new en,X={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Q=!1;function Y(){return null===T?I:1}let $,K,Z,te,ne,ie,ae,Ae,he,de,pe,fe,me,ge,ve,_e,xe,Te,we,Me,Ee,Ce,Re,Ne,Pe=n;function De(e,n){return t.getContext(e,n)}try{const e={alpha:!0,depth:r,stencil:i,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:u,powerPreference:c,failIfMajorPerformanceCaveat:A};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${s}`),t.addEventListener("webglcontextlost",Ue,!1),t.addEventListener("webglcontextrestored",Be,!1),t.addEventListener("webglcontextcreationerror",Oe,!1),null===Pe){const t="webgl2";if(Pe=De(t,e),null===Pe)throw De(t)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function Le(){$=new Oo(Pe),$.init(),Ce=new Lu(Pe,$),K=new mo(Pe,$,e,Ce),Z=new Pu(Pe,$),K.reverseDepthBuffer&&h&&Z.buffers.depth.setReversed(!0),te=new qo(Pe),ne=new vu,ie=new Du(Pe,$,Z,ne,K,Ce,te),ae=new vo(y),Ae=new Bo(y),he=new so(Pe),Re=new po(Pe,he),de=new Fo(Pe,he,te,Re),pe=new zo(Pe,de,he,te),we=new Go(Pe,K,ie),_e=new go(ne),fe=new gu(y,ae,Ae,$,K,Re,_e),me=new qu(y,ne),ge=new bu,ve=new Cu($),Te=new ho(y,ae,Ae,Z,pe,d,l),xe=new Ru(y,pe,K),Ne=new Gu(Pe,te,K,Z),Me=new fo(Pe,$,te),Ee=new ko(Pe,$,te),te.programs=fe.programs,y.capabilities=K,y.extensions=$,y.properties=ne,y.renderLists=ge,y.shadowMap=xe,y.state=Z,y.info=te}Le();const Ie=new Ou(y,Pe);function Ue(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),x=!0}function Be(){console.log("THREE.WebGLRenderer: Context Restored."),x=!1;const e=te.autoReset,t=xe.enabled,n=xe.autoUpdate,r=xe.needsUpdate,i=xe.type;Le(),te.autoReset=e,xe.enabled=t,xe.autoUpdate=n,xe.needsUpdate=r,xe.type=i}function Oe(e){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",e.statusMessage)}function Fe(e){const t=e.target;t.removeEventListener("dispose",Fe),function(e){(function(e){const t=ne.get(e).programs;void 0!==t&&(t.forEach((function(e){fe.releaseProgram(e)})),e.isShaderMaterial&&fe.releaseShaderCache(e))})(e),ne.remove(e)}(t)}function ke(e,t,n){!0===e.transparent&&2===e.side&&!1===e.forceSinglePass?(e.side=1,e.needsUpdate=!0,Ye(e,t,n),e.side=0,e.needsUpdate=!0,Ye(e,t,n),e.side=2):Ye(e,t,n)}this.xr=Ie,this.getContext=function(){return Pe},this.getContextAttributes=function(){return Pe.getContextAttributes()},this.forceContextLoss=function(){const e=$.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){const e=$.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return I},this.setPixelRatio=function(e){void 0!==e&&(I=e,this.setSize(D,L,!1))},this.getSize=function(e){return e.set(D,L)},this.setSize=function(e,n,r=!0){Ie.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(D=e,L=n,t.width=Math.floor(e*I),t.height=Math.floor(n*I),!0===r&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(e){return e.set(D*I,L*I).floor()},this.setDrawingBufferSize=function(e,n,r){D=e,L=n,I=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return e.copy(E)},this.getViewport=function(e){return e.copy(O)},this.setViewport=function(e,t,n,r){e.isVector4?O.set(e.x,e.y,e.z,e.w):O.set(e,t,n,r),Z.viewport(E.copy(O).multiplyScalar(I).round())},this.getScissor=function(e){return e.copy(F)},this.setScissor=function(e,t,n,r){e.isVector4?F.set(e.x,e.y,e.z,e.w):F.set(e,t,n,r),Z.scissor(C.copy(F).multiplyScalar(I).round())},this.getScissorTest=function(){return k},this.setScissorTest=function(e){Z.setScissorTest(k=e)},this.setOpaqueSort=function(e){U=e},this.setTransparentSort=function(e){B=e},this.getClearColor=function(e){return e.copy(Te.getClearColor())},this.setClearColor=function(){Te.setClearColor.apply(Te,arguments)},this.getClearAlpha=function(){return Te.getClearAlpha()},this.setClearAlpha=function(){Te.setClearAlpha.apply(Te,arguments)},this.clear=function(e=!0,t=!0,n=!0){let r=0;if(e){let e=!1;if(null!==T){const t=T.texture.format;e=t===Se||t===be||t===ye}if(e){const e=T.texture.type,t=e===ee||e===se||e===re||e===ce||e===le||e===ue,n=Te.getClearColor(),r=Te.getClearAlpha(),i=n.r,s=n.g,a=n.b;t?(p[0]=i,p[1]=s,p[2]=a,p[3]=r,Pe.clearBufferuiv(Pe.COLOR,0,p)):(f[0]=i,f[1]=s,f[2]=a,f[3]=r,Pe.clearBufferiv(Pe.COLOR,0,f))}else r|=Pe.COLOR_BUFFER_BIT}t&&(r|=Pe.DEPTH_BUFFER_BIT),n&&(r|=Pe.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),Pe.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",Ue,!1),t.removeEventListener("webglcontextrestored",Be,!1),t.removeEventListener("webglcontextcreationerror",Oe,!1),Te.dispose(),ge.dispose(),ve.dispose(),ne.dispose(),ae.dispose(),Ae.dispose(),pe.dispose(),Re.dispose(),Ne.dispose(),fe.dispose(),Ie.dispose(),Ie.removeEventListener("sessionstart",Ge),Ie.removeEventListener("sessionend",ze),Ve.stop()},this.renderBufferDirect=function(e,t,n,r,i,s){null===t&&(t=X);const a=i.isMesh&&i.matrixWorld.determinant()<0,o=function(e,t,n,r,i){!0!==t.isScene&&(t=X);ie.resetTextureUnits();const s=t.fog,a=r.isMeshStandardMaterial?t.environment:null,o=null===T?y.outputColorSpace:!0===T.isXRRenderTarget?T.texture.colorSpace:it,l=(r.isMeshStandardMaterial?Ae:ae).get(r.envMap||a),u=!0===r.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,c=!!n.attributes.tangent&&(!!r.normalMap||r.anisotropy>0),A=!!n.morphAttributes.position,h=!!n.morphAttributes.normal,d=!!n.morphAttributes.color;let p=0;r.toneMapped&&(null!==T&&!0!==T.isXRRenderTarget||(p=y.toneMapping));const f=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,m=void 0!==f?f.length:0,v=ne.get(r),_=g.state.lights;if(!0===G&&(!0===z||e!==M)){const t=e===M&&r.id===w;_e.setState(r,e,t)}let x=!1;r.version===v.__version?v.needsLights&&v.lightsStateVersion!==_.state.version||v.outputColorSpace!==o||i.isBatchedMesh&&!1===v.batching?x=!0:i.isBatchedMesh||!0!==v.batching?i.isBatchedMesh&&!0===v.batchingColor&&null===i.colorTexture||i.isBatchedMesh&&!1===v.batchingColor&&null!==i.colorTexture||i.isInstancedMesh&&!1===v.instancing?x=!0:i.isInstancedMesh||!0!==v.instancing?i.isSkinnedMesh&&!1===v.skinning?x=!0:i.isSkinnedMesh||!0!==v.skinning?i.isInstancedMesh&&!0===v.instancingColor&&null===i.instanceColor||i.isInstancedMesh&&!1===v.instancingColor&&null!==i.instanceColor||i.isInstancedMesh&&!0===v.instancingMorph&&null===i.morphTexture||i.isInstancedMesh&&!1===v.instancingMorph&&null!==i.morphTexture||v.envMap!==l||!0===r.fog&&v.fog!==s?x=!0:void 0===v.numClippingPlanes||v.numClippingPlanes===_e.numPlanes&&v.numIntersection===_e.numIntersection?(v.vertexAlphas!==u||v.vertexTangents!==c||v.morphTargets!==A||v.morphNormals!==h||v.morphColors!==d||v.toneMapping!==p||v.morphTargetsCount!==m)&&(x=!0):x=!0:x=!0:x=!0:x=!0:(x=!0,v.__version=r.version);let b=v.currentProgram;!0===x&&(b=Ye(r,t,i));let S=!1,E=!1,C=!1;const R=b.getUniforms(),N=v.uniforms;Z.useProgram(b.program)&&(S=!0,E=!0,C=!0);r.id!==w&&(w=r.id,E=!0);if(S||M!==e){Z.buffers.depth.getReversed()?(V.copy(e.projectionMatrix),function(e){const t=e.elements;t[2]=.5*t[2]+.5*t[3],t[6]=.5*t[6]+.5*t[7],t[10]=.5*t[10]+.5*t[11],t[14]=.5*t[14]+.5*t[15]}(V),function(e){const t=e.elements;-1===t[11]?(t[10]=-t[10]-1,t[14]=-t[14]):(t[10]=-t[10],t[14]=1-t[14])}(V),R.setValue(Pe,"projectionMatrix",V)):R.setValue(Pe,"projectionMatrix",e.projectionMatrix),R.setValue(Pe,"viewMatrix",e.matrixWorldInverse);const t=R.map.cameraPosition;void 0!==t&&t.setValue(Pe,j.setFromMatrixPosition(e.matrixWorld)),K.logarithmicDepthBuffer&&R.setValue(Pe,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&R.setValue(Pe,"isOrthographic",!0===e.isOrthographicCamera),M!==e&&(M=e,E=!0,C=!0)}if(i.isSkinnedMesh){R.setOptional(Pe,i,"bindMatrix"),R.setOptional(Pe,i,"bindMatrixInverse");const e=i.skeleton;e&&(null===e.boneTexture&&e.computeBoneTexture(),R.setValue(Pe,"boneTexture",e.boneTexture,ie))}i.isBatchedMesh&&(R.setOptional(Pe,i,"batchingTexture"),R.setValue(Pe,"batchingTexture",i._matricesTexture,ie),R.setOptional(Pe,i,"batchingIdTexture"),R.setValue(Pe,"batchingIdTexture",i._indirectTexture,ie),R.setOptional(Pe,i,"batchingColorTexture"),null!==i._colorsTexture&&R.setValue(Pe,"batchingColorTexture",i._colorsTexture,ie));const P=n.morphAttributes;void 0===P.position&&void 0===P.normal&&void 0===P.color||we.update(i,n,b);(E||v.receiveShadow!==i.receiveShadow)&&(v.receiveShadow=i.receiveShadow,R.setValue(Pe,"receiveShadow",i.receiveShadow));r.isMeshGouraudMaterial&&null!==r.envMap&&(N.envMap.value=l,N.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1);r.isMeshStandardMaterial&&null===r.envMap&&null!==t.environment&&(N.envMapIntensity.value=t.environmentIntensity);E&&(R.setValue(Pe,"toneMappingExposure",y.toneMappingExposure),v.needsLights&&(U=C,(D=N).ambientLightColor.needsUpdate=U,D.lightProbe.needsUpdate=U,D.directionalLights.needsUpdate=U,D.directionalLightShadows.needsUpdate=U,D.pointLights.needsUpdate=U,D.pointLightShadows.needsUpdate=U,D.spotLights.needsUpdate=U,D.spotLightShadows.needsUpdate=U,D.rectAreaLights.needsUpdate=U,D.hemisphereLights.needsUpdate=U),s&&!0===r.fog&&me.refreshFogUniforms(N,s),me.refreshMaterialUniforms(N,r,I,L,g.state.transmissionRenderTarget[e.id]),Xl.upload(Pe,$e(v),N,ie));var D,U;r.isShaderMaterial&&!0===r.uniformsNeedUpdate&&(Xl.upload(Pe,$e(v),N,ie),r.uniformsNeedUpdate=!1);r.isSpriteMaterial&&R.setValue(Pe,"center",i.center);if(R.setValue(Pe,"modelViewMatrix",i.modelViewMatrix),R.setValue(Pe,"normalMatrix",i.normalMatrix),R.setValue(Pe,"modelMatrix",i.matrixWorld),r.isShaderMaterial||r.isRawShaderMaterial){const e=r.uniformsGroups;for(let t=0,n=e.length;t<n;t++){const n=e[t];Ne.update(n,b),Ne.bind(n,b)}}return b}(e,t,n,r,i);Z.setMaterial(r,a);let l=n.index,u=1;if(!0===r.wireframe){if(l=de.getWireframeAttribute(n),void 0===l)return;u=2}const c=n.drawRange,A=n.attributes.position;let h=c.start*u,d=(c.start+c.count)*u;null!==s&&(h=Math.max(h,s.start*u),d=Math.min(d,(s.start+s.count)*u)),null!==l?(h=Math.max(h,0),d=Math.min(d,l.count)):null!=A&&(h=Math.max(h,0),d=Math.min(d,A.count));const p=d-h;if(p<0||p===1/0)return;let f;Re.setup(i,r,o,n,l);let m=Me;if(null!==l&&(f=he.get(l),m=Ee,m.setIndex(f)),i.isMesh)!0===r.wireframe?(Z.setLineWidth(r.wireframeLinewidth*Y()),m.setMode(Pe.LINES)):m.setMode(Pe.TRIANGLES);else if(i.isLine){let e=r.linewidth;void 0===e&&(e=1),Z.setLineWidth(e*Y()),i.isLineSegments?m.setMode(Pe.LINES):i.isLineLoop?m.setMode(Pe.LINE_LOOP):m.setMode(Pe.LINE_STRIP)}else i.isPoints?m.setMode(Pe.POINTS):i.isSprite&&m.setMode(Pe.TRIANGLES);if(i.isBatchedMesh)if(null!==i._multiDrawInstances)m.renderMultiDrawInstances(i._multiDrawStarts,i._multiDrawCounts,i._multiDrawCount,i._multiDrawInstances);else if($.get("WEBGL_multi_draw"))m.renderMultiDraw(i._multiDrawStarts,i._multiDrawCounts,i._multiDrawCount);else{const e=i._multiDrawStarts,t=i._multiDrawCounts,n=i._multiDrawCount,s=l?he.get(l).bytesPerElement:1,a=ne.get(r).currentProgram.getUniforms();for(let r=0;r<n;r++)a.setValue(Pe,"_gl_DrawID",r),m.render(e[r]/s,t[r])}else if(i.isInstancedMesh)m.renderInstances(h,p,i.count);else if(n.isInstancedBufferGeometry){const e=void 0!==n._maxInstanceCount?n._maxInstanceCount:1/0,t=Math.min(n.instanceCount,e);m.renderInstances(h,p,t)}else m.render(h,p)},this.compile=function(e,t,n=null){null===n&&(n=e),g=ve.get(n),g.init(t),_.push(g),n.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(g.pushLight(e),e.castShadow&&g.pushShadow(e))})),e!==n&&e.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(g.pushLight(e),e.castShadow&&g.pushShadow(e))})),g.setupLights();const r=new Set;return e.traverse((function(e){if(!(e.isMesh||e.isPoints||e.isLine||e.isSprite))return;const t=e.material;if(t)if(Array.isArray(t))for(let i=0;i<t.length;i++){const s=t[i];ke(s,n,e),r.add(s)}else ke(t,n,e),r.add(t)})),_.pop(),g=null,r},this.compileAsync=function(e,t,n=null){const r=this.compile(e,t,n);return new Promise((t=>{function n(){r.forEach((function(e){ne.get(e).currentProgram.isReady()&&r.delete(e)})),0!==r.size?setTimeout(n,10):t(e)}null!==$.get("KHR_parallel_shader_compile")?n():setTimeout(n,10)}))};let qe=null;function Ge(){Ve.stop()}function ze(){Ve.start()}const Ve=new io;function He(e,t,n,r){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)g.pushLight(e),e.castShadow&&g.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||q.intersectsSprite(e)){r&&W.setFromMatrixPosition(e.matrixWorld).applyMatrix4(H);const t=pe.update(e),i=e.material;i.visible&&m.push(e,t,i,n,W.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||q.intersectsObject(e))){const t=pe.update(e),i=e.material;if(r&&(void 0!==e.boundingSphere?(null===e.boundingSphere&&e.computeBoundingSphere(),W.copy(e.boundingSphere.center)):(null===t.boundingSphere&&t.computeBoundingSphere(),W.copy(t.boundingSphere.center)),W.applyMatrix4(e.matrixWorld).applyMatrix4(H)),Array.isArray(i)){const r=t.groups;for(let s=0,a=r.length;s<a;s++){const a=r[s],o=i[a.materialIndex];o&&o.visible&&m.push(e,t,o,n,W.z,a)}}else i.visible&&m.push(e,t,i,n,W.z,null)}const i=e.children;for(let e=0,s=i.length;e<s;e++)He(i[e],t,n,r)}function je(e,t,n,r){const i=e.opaque,s=e.transmissive,a=e.transparent;g.setupLightsView(n),!0===G&&_e.setGlobalState(y.clippingPlanes,n),r&&Z.viewport(E.copy(r)),i.length>0&&Xe(i,t,n),s.length>0&&Xe(s,t,n),a.length>0&&Xe(a,t,n),Z.buffers.depth.setTest(!0),Z.buffers.depth.setMask(!0),Z.buffers.color.setMask(!0),Z.setPolygonOffset(!1)}function We(e,t,n,r){if(null!==(!0===n.isScene?n.overrideMaterial:null))return;void 0===g.state.transmissionRenderTarget[r.id]&&(g.state.transmissionRenderTarget[r.id]=new nn(1,1,{generateMipmaps:!0,type:$.has("EXT_color_buffer_half_float")||$.has("EXT_color_buffer_float")?oe:ee,minFilter:J,samples:4,stencilBuffer:i,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Ht.workingColorSpace}));const s=g.state.transmissionRenderTarget[r.id],a=r.viewport||E;s.setSize(a.z,a.w);const o=y.getRenderTarget();y.setRenderTarget(s),y.getClearColor(N),P=y.getClearAlpha(),P<1&&y.setClearColor(16777215,.5),y.clear(),Q&&Te.render(n);const l=y.toneMapping;y.toneMapping=0;const u=r.viewport;if(void 0!==r.viewport&&(r.viewport=void 0),g.setupLightsView(r),!0===G&&_e.setGlobalState(y.clippingPlanes,r),Xe(e,n,r),ie.updateMultisampleRenderTarget(s),ie.updateRenderTargetMipmap(s),!1===$.has("WEBGL_multisampled_render_to_texture")){let e=!1;for(let i=0,s=t.length;i<s;i++){const s=t[i],a=s.object,o=s.geometry,l=s.material,u=s.group;if(2===l.side&&a.layers.test(r.layers)){const t=l.side;l.side=1,l.needsUpdate=!0,Qe(a,n,r,o,l,u),l.side=t,l.needsUpdate=!0,e=!0}}!0===e&&(ie.updateMultisampleRenderTarget(s),ie.updateRenderTargetMipmap(s))}y.setRenderTarget(o),y.setClearColor(N,P),void 0!==u&&(r.viewport=u),y.toneMapping=l}function Xe(e,t,n){const r=!0===t.isScene?t.overrideMaterial:null;for(let i=0,s=e.length;i<s;i++){const s=e[i],a=s.object,o=s.geometry,l=null===r?s.material:r,u=s.group;a.layers.test(n.layers)&&Qe(a,t,n,o,l,u)}}function Qe(e,t,n,r,i,s){e.onBeforeRender(y,t,n,r,i,s),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),i.onBeforeRender(y,t,n,r,e,s),!0===i.transparent&&2===i.side&&!1===i.forceSinglePass?(i.side=1,i.needsUpdate=!0,y.renderBufferDirect(n,t,r,i,e,s),i.side=0,i.needsUpdate=!0,y.renderBufferDirect(n,t,r,i,e,s),i.side=2):y.renderBufferDirect(n,t,r,i,e,s),e.onAfterRender(y,t,n,r,i,s)}function Ye(e,t,n){!0!==t.isScene&&(t=X);const r=ne.get(e),i=g.state.lights,s=g.state.shadowsArray,a=i.state.version,o=fe.getParameters(e,i.state,s,t,n),l=fe.getProgramCacheKey(o);let u=r.programs;r.environment=e.isMeshStandardMaterial?t.environment:null,r.fog=t.fog,r.envMap=(e.isMeshStandardMaterial?Ae:ae).get(e.envMap||r.environment),r.envMapRotation=null!==r.environment&&null===e.envMap?t.environmentRotation:e.envMapRotation,void 0===u&&(e.addEventListener("dispose",Fe),u=new Map,r.programs=u);let c=u.get(l);if(void 0!==c){if(r.currentProgram===c&&r.lightsStateVersion===a)return Ke(e,o),c}else o.uniforms=fe.getUniforms(e),e.onBeforeCompile(o,y),c=fe.acquireProgram(o,l),u.set(l,c),r.uniforms=o.uniforms;const A=r.uniforms;return(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(A.clippingPlanes=_e.uniform),Ke(e,o),r.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),r.lightsStateVersion=a,r.needsLights&&(A.ambientLightColor.value=i.state.ambient,A.lightProbe.value=i.state.probe,A.directionalLights.value=i.state.directional,A.directionalLightShadows.value=i.state.directionalShadow,A.spotLights.value=i.state.spot,A.spotLightShadows.value=i.state.spotShadow,A.rectAreaLights.value=i.state.rectArea,A.ltc_1.value=i.state.rectAreaLTC1,A.ltc_2.value=i.state.rectAreaLTC2,A.pointLights.value=i.state.point,A.pointLightShadows.value=i.state.pointShadow,A.hemisphereLights.value=i.state.hemi,A.directionalShadowMap.value=i.state.directionalShadowMap,A.directionalShadowMatrix.value=i.state.directionalShadowMatrix,A.spotShadowMap.value=i.state.spotShadowMap,A.spotLightMatrix.value=i.state.spotLightMatrix,A.spotLightMap.value=i.state.spotLightMap,A.pointShadowMap.value=i.state.pointShadowMap,A.pointShadowMatrix.value=i.state.pointShadowMatrix),r.currentProgram=c,r.uniformsList=null,c}function $e(e){if(null===e.uniformsList){const t=e.currentProgram.getUniforms();e.uniformsList=Xl.seqWithValue(t.seq,e.uniforms)}return e.uniformsList}function Ke(e,t){const n=ne.get(e);n.outputColorSpace=t.outputColorSpace,n.batching=t.batching,n.batchingColor=t.batchingColor,n.instancing=t.instancing,n.instancingColor=t.instancingColor,n.instancingMorph=t.instancingMorph,n.skinning=t.skinning,n.morphTargets=t.morphTargets,n.morphNormals=t.morphNormals,n.morphColors=t.morphColors,n.morphTargetsCount=t.morphTargetsCount,n.numClippingPlanes=t.numClippingPlanes,n.numIntersection=t.numClipIntersection,n.vertexAlphas=t.vertexAlphas,n.vertexTangents=t.vertexTangents,n.toneMapping=t.toneMapping}Ve.setAnimationLoop((function(e){qe&&qe(e)})),"undefined"!=typeof self&&Ve.setContext(self),this.setAnimationLoop=function(e){qe=e,Ie.setAnimationLoop(e),null===e?Ve.stop():Ve.start()},Ie.addEventListener("sessionstart",Ge),Ie.addEventListener("sessionend",ze),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===x)return;if(!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),!0===Ie.enabled&&!0===Ie.isPresenting&&(!0===Ie.cameraAutoUpdate&&Ie.updateCamera(t),t=Ie.getCamera()),!0===e.isScene&&e.onBeforeRender(y,e,t,T),g=ve.get(e,_.length),g.init(t),_.push(g),H.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),q.setFromProjectionMatrix(H),z=this.localClippingEnabled,G=_e.init(this.clippingPlanes,z),m=ge.get(e,v.length),m.init(),v.push(m),!0===Ie.enabled&&!0===Ie.isPresenting){const e=y.xr.getDepthSensingMesh();null!==e&&He(e,t,-1/0,y.sortObjects)}He(e,t,0,y.sortObjects),m.finish(),!0===y.sortObjects&&m.sort(U,B),Q=!1===Ie.enabled||!1===Ie.isPresenting||!1===Ie.hasDepthSensing(),Q&&Te.addToRenderList(m,e),this.info.render.frame++,!0===G&&_e.beginShadows();const n=g.state.shadowsArray;xe.render(n,e,t),!0===G&&_e.endShadows(),!0===this.info.autoReset&&this.info.reset();const r=m.opaque,i=m.transmissive;if(g.setupLights(),t.isArrayCamera){const n=t.cameras;if(i.length>0)for(let t=0,s=n.length;t<s;t++){We(r,i,e,n[t])}Q&&Te.render(e);for(let t=0,r=n.length;t<r;t++){const r=n[t];je(m,e,r,r.viewport)}}else i.length>0&&We(r,i,e,t),Q&&Te.render(e),je(m,e,t);null!==T&&(ie.updateMultisampleRenderTarget(T),ie.updateRenderTargetMipmap(T)),!0===e.isScene&&e.onAfterRender(y,e,t),Re.resetDefaultState(),w=-1,M=null,_.pop(),_.length>0?(g=_[_.length-1],!0===G&&_e.setGlobalState(y.clippingPlanes,g.state.camera)):g=null,v.pop(),m=v.length>0?v[v.length-1]:null},this.getActiveCubeFace=function(){return b},this.getActiveMipmapLevel=function(){return S},this.getRenderTarget=function(){return T},this.setRenderTargetTextures=function(e,t,n){ne.get(e.texture).__webglTexture=t,ne.get(e.depthTexture).__webglTexture=n;const r=ne.get(e);r.__hasExternalTextures=!0,r.__autoAllocateDepthBuffer=void 0===n,r.__autoAllocateDepthBuffer||!0===$.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),r.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(e,t){const n=ne.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e,t=0,n=0){T=e,b=t,S=n;let r=!0,i=null,s=!1,a=!1;if(e){const o=ne.get(e);if(void 0!==o.__useDefaultFramebuffer)Z.bindFramebuffer(Pe.FRAMEBUFFER,null),r=!1;else if(void 0===o.__webglFramebuffer)ie.setupRenderTarget(e);else if(o.__hasExternalTextures)ie.rebindTextures(e,ne.get(e.texture).__webglTexture,ne.get(e.depthTexture).__webglTexture);else if(e.depthBuffer){const t=e.depthTexture;if(o.__boundDepthTexture!==t){if(null!==t&&ne.has(t)&&(e.width!==t.image.width||e.height!==t.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");ie.setupDepthRenderbuffer(e)}}const l=e.texture;(l.isData3DTexture||l.isDataArrayTexture||l.isCompressedArrayTexture)&&(a=!0);const u=ne.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(i=Array.isArray(u[t])?u[t][n]:u[t],s=!0):i=e.samples>0&&!1===ie.useMultisampledRTT(e)?ne.get(e).__webglMultisampledFramebuffer:Array.isArray(u)?u[n]:u,E.copy(e.viewport),C.copy(e.scissor),R=e.scissorTest}else E.copy(O).multiplyScalar(I).floor(),C.copy(F).multiplyScalar(I).floor(),R=k;if(Z.bindFramebuffer(Pe.FRAMEBUFFER,i)&&r&&Z.drawBuffers(e,i),Z.viewport(E),Z.scissor(C),Z.setScissorTest(R),s){const r=ne.get(e.texture);Pe.framebufferTexture2D(Pe.FRAMEBUFFER,Pe.COLOR_ATTACHMENT0,Pe.TEXTURE_CUBE_MAP_POSITIVE_X+t,r.__webglTexture,n)}else if(a){const r=ne.get(e.texture),i=t||0;Pe.framebufferTextureLayer(Pe.FRAMEBUFFER,Pe.COLOR_ATTACHMENT0,r.__webglTexture,n||0,i)}w=-1},this.readRenderTargetPixels=function(e,t,n,r,i,s,a){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let o=ne.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==a&&(o=o[a]),o){Z.bindFramebuffer(Pe.FRAMEBUFFER,o);try{const a=e.texture,o=a.format,l=a.type;if(!K.textureFormatReadable(o))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!K.textureTypeReadable(l))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&Pe.readPixels(t,n,r,i,Ce.convert(o),Ce.convert(l),s)}finally{const e=null!==T?ne.get(T).__webglFramebuffer:null;Z.bindFramebuffer(Pe.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,r,i,s,a){if(!e||!e.isWebGLRenderTarget)throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let o=ne.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==a&&(o=o[a]),o){const a=e.texture,l=a.format,u=a.type;if(!K.textureFormatReadable(l))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!K.textureTypeReadable(u))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i){Z.bindFramebuffer(Pe.FRAMEBUFFER,o);const e=Pe.createBuffer();Pe.bindBuffer(Pe.PIXEL_PACK_BUFFER,e),Pe.bufferData(Pe.PIXEL_PACK_BUFFER,s.byteLength,Pe.STREAM_READ),Pe.readPixels(t,n,r,i,Ce.convert(l),Ce.convert(u),0);const a=null!==T?ne.get(T).__webglFramebuffer:null;Z.bindFramebuffer(Pe.FRAMEBUFFER,a);const c=Pe.fenceSync(Pe.SYNC_GPU_COMMANDS_COMPLETE,0);return Pe.flush(),await function(e,t,n){return new Promise((function(r,i){setTimeout((function s(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:i();break;case e.TIMEOUT_EXPIRED:setTimeout(s,n);break;default:r()}}),n)}))}(Pe,c,4),Pe.bindBuffer(Pe.PIXEL_PACK_BUFFER,e),Pe.getBufferSubData(Pe.PIXEL_PACK_BUFFER,0,s),Pe.deleteBuffer(e),Pe.deleteSync(c),s}throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(e,t=null,n=0){!0!==e.isTexture&&(qt("WebGLRenderer: copyFramebufferToTexture function signature has changed."),t=arguments[0]||null,e=arguments[1]);const r=Math.pow(2,-n),i=Math.floor(e.image.width*r),s=Math.floor(e.image.height*r),a=null!==t?t.x:0,o=null!==t?t.y:0;ie.setTexture2D(e,0),Pe.copyTexSubImage2D(Pe.TEXTURE_2D,n,0,0,a,o,i,s),Z.unbindTexture()};const Ze=Pe.createFramebuffer(),Je=Pe.createFramebuffer();this.copyTextureToTexture=function(e,t,n=null,r=null,i=0,s=null){let a,o,l,u,c,A,h,d,p;!0!==e.isTexture&&(qt("WebGLRenderer: copyTextureToTexture function signature has changed."),r=arguments[0]||null,e=arguments[1],t=arguments[2],s=arguments[3]||0,n=null),null===s&&(0!==i?(qt("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),s=i,i=0):s=0);const f=e.isCompressedTexture?e.mipmaps[s]:e.image;if(null!==n)a=n.max.x-n.min.x,o=n.max.y-n.min.y,l=n.isBox3?n.max.z-n.min.z:1,u=n.min.x,c=n.min.y,A=n.isBox3?n.min.z:0;else{const t=Math.pow(2,-i);a=Math.floor(f.width*t),o=Math.floor(f.height*t),l=e.isDataArrayTexture?f.depth:e.isData3DTexture?Math.floor(f.depth*t):1,u=0,c=0,A=0}null!==r?(h=r.x,d=r.y,p=r.z):(h=0,d=0,p=0);const m=Ce.convert(t.format),g=Ce.convert(t.type);let v;t.isData3DTexture?(ie.setTexture3D(t,0),v=Pe.TEXTURE_3D):t.isDataArrayTexture||t.isCompressedArrayTexture?(ie.setTexture2DArray(t,0),v=Pe.TEXTURE_2D_ARRAY):(ie.setTexture2D(t,0),v=Pe.TEXTURE_2D),Pe.pixelStorei(Pe.UNPACK_FLIP_Y_WEBGL,t.flipY),Pe.pixelStorei(Pe.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),Pe.pixelStorei(Pe.UNPACK_ALIGNMENT,t.unpackAlignment);const _=Pe.getParameter(Pe.UNPACK_ROW_LENGTH),y=Pe.getParameter(Pe.UNPACK_IMAGE_HEIGHT),x=Pe.getParameter(Pe.UNPACK_SKIP_PIXELS),b=Pe.getParameter(Pe.UNPACK_SKIP_ROWS),S=Pe.getParameter(Pe.UNPACK_SKIP_IMAGES);Pe.pixelStorei(Pe.UNPACK_ROW_LENGTH,f.width),Pe.pixelStorei(Pe.UNPACK_IMAGE_HEIGHT,f.height),Pe.pixelStorei(Pe.UNPACK_SKIP_PIXELS,u),Pe.pixelStorei(Pe.UNPACK_SKIP_ROWS,c),Pe.pixelStorei(Pe.UNPACK_SKIP_IMAGES,A);const T=e.isDataArrayTexture||e.isData3DTexture,w=t.isDataArrayTexture||t.isData3DTexture;if(e.isDepthTexture){const n=ne.get(e),r=ne.get(t),f=ne.get(n.__renderTarget),m=ne.get(r.__renderTarget);Z.bindFramebuffer(Pe.READ_FRAMEBUFFER,f.__webglFramebuffer),Z.bindFramebuffer(Pe.DRAW_FRAMEBUFFER,m.__webglFramebuffer);for(let n=0;n<l;n++)T&&(Pe.framebufferTextureLayer(Pe.READ_FRAMEBUFFER,Pe.COLOR_ATTACHMENT0,ne.get(e).__webglTexture,i,A+n),Pe.framebufferTextureLayer(Pe.DRAW_FRAMEBUFFER,Pe.COLOR_ATTACHMENT0,ne.get(t).__webglTexture,s,p+n)),Pe.blitFramebuffer(u,c,a,o,h,d,a,o,Pe.DEPTH_BUFFER_BIT,Pe.NEAREST);Z.bindFramebuffer(Pe.READ_FRAMEBUFFER,null),Z.bindFramebuffer(Pe.DRAW_FRAMEBUFFER,null)}else if(0!==i||e.isRenderTargetTexture||ne.has(e)){const n=ne.get(e),r=ne.get(t);Z.bindFramebuffer(Pe.READ_FRAMEBUFFER,Ze),Z.bindFramebuffer(Pe.DRAW_FRAMEBUFFER,Je);for(let e=0;e<l;e++)T?Pe.framebufferTextureLayer(Pe.READ_FRAMEBUFFER,Pe.COLOR_ATTACHMENT0,n.__webglTexture,i,A+e):Pe.framebufferTexture2D(Pe.READ_FRAMEBUFFER,Pe.COLOR_ATTACHMENT0,Pe.TEXTURE_2D,n.__webglTexture,i),w?Pe.framebufferTextureLayer(Pe.DRAW_FRAMEBUFFER,Pe.COLOR_ATTACHMENT0,r.__webglTexture,s,p+e):Pe.framebufferTexture2D(Pe.DRAW_FRAMEBUFFER,Pe.COLOR_ATTACHMENT0,Pe.TEXTURE_2D,r.__webglTexture,s),0!==i?Pe.blitFramebuffer(u,c,a,o,h,d,a,o,Pe.COLOR_BUFFER_BIT,Pe.NEAREST):w?Pe.copyTexSubImage3D(v,s,h,d,p+e,u,c,a,o):Pe.copyTexSubImage2D(v,s,h,d,u,c,a,o);Z.bindFramebuffer(Pe.READ_FRAMEBUFFER,null),Z.bindFramebuffer(Pe.DRAW_FRAMEBUFFER,null)}else w?e.isDataTexture||e.isData3DTexture?Pe.texSubImage3D(v,s,h,d,p,a,o,l,m,g,f.data):t.isCompressedArrayTexture?Pe.compressedTexSubImage3D(v,s,h,d,p,a,o,l,m,f.data):Pe.texSubImage3D(v,s,h,d,p,a,o,l,m,g,f):e.isDataTexture?Pe.texSubImage2D(Pe.TEXTURE_2D,s,h,d,a,o,m,g,f.data):e.isCompressedTexture?Pe.compressedTexSubImage2D(Pe.TEXTURE_2D,s,h,d,f.width,f.height,m,f.data):Pe.texSubImage2D(Pe.TEXTURE_2D,s,h,d,a,o,m,g,f);Pe.pixelStorei(Pe.UNPACK_ROW_LENGTH,_),Pe.pixelStorei(Pe.UNPACK_IMAGE_HEIGHT,y),Pe.pixelStorei(Pe.UNPACK_SKIP_PIXELS,x),Pe.pixelStorei(Pe.UNPACK_SKIP_ROWS,b),Pe.pixelStorei(Pe.UNPACK_SKIP_IMAGES,S),0===s&&t.generateMipmaps&&Pe.generateMipmap(v),Z.unbindTexture()},this.copyTextureToTexture3D=function(e,t,n=null,r=null,i=0){return!0!==e.isTexture&&(qt("WebGLRenderer: copyTextureToTexture3D function signature has changed."),n=arguments[0]||null,r=arguments[1]||null,e=arguments[2],t=arguments[3],i=arguments[4]||0),qt('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(e,t,n,r,i)},this.initRenderTarget=function(e){void 0===ne.get(e).__webglFramebuffer&&ie.setupRenderTarget(e)},this.initTexture=function(e){e.isCubeTexture?ie.setTextureCube(e,0):e.isData3DTexture?ie.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?ie.setTexture2DArray(e,0):ie.setTexture2D(e,0),Z.unbindTexture()},this.resetState=function(){b=0,S=0,T=null,Z.reset(),Re.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return _t}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorspace=Ht._getDrawingBufferColorSpace(e),t.unpackColorSpace=Ht._getUnpackColorSpace()}},Scene:Ei,PerspectiveCamera:bi,Raycaster:class{constructor(e,t,n=0,r=1/0){this.ray=new Bn(e,t),this.near=n,this.far=r,this.camera=null,this.layers=new Qn,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return Ya.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Ya),this}intersectObject(e,t=!0,n=[]){return Ka(e,this,n,t),n.sort($a),n}intersectObjects(e,t=!0,n=[]){for(let r=0,i=e.length;r<i;r++)Ka(e[r],this,n,t);return n.sort($a),n}},SRGBColorSpace:rt,TextureLoader:Sa,Vector2:Lt,Vector3:on,Box3:cn,Color:Rr,Mesh:ci,SphereGeometry:ra,MeshBasicMaterial:Lr,BackSide:1,EventDispatcher:xt,MOUSE:a,Quaternion:an,Spherical:Za,Clock:Wa},Nq=xc({props:{width:{default:window.innerWidth,onChange:function(e,t,n){isNaN(e)&&(t.width=n)}},height:{default:window.innerHeight,onChange:function(e,t,n){isNaN(e)&&(t.height=n)}},backgroundColor:{default:"#000011"},backgroundImageUrl:{},onBackgroundImageLoaded:{},showNavInfo:{default:!0},skyRadius:{default:5e4},objects:{default:[]},lights:{default:[]},enablePointerInteraction:{default:!0,onChange:function(e,t){t.hoverObj=null,t.toolTipElem&&(t.toolTipElem.innerHTML="")},triggerUpdate:!1},lineHoverPrecision:{default:1,triggerUpdate:!1},hoverOrderComparator:{default:function(){return-1},triggerUpdate:!1},hoverFilter:{default:function(){return!0},triggerUpdate:!1},tooltipContent:{triggerUpdate:!1},hoverDuringDrag:{default:!1,triggerUpdate:!1},clickAfterDrag:{default:!1,triggerUpdate:!1},onHover:{default:function(){},triggerUpdate:!1},onClick:{default:function(){},triggerUpdate:!1},onRightClick:{triggerUpdate:!1}},methods:{tick:function(e){if(e.initialised){if(e.controls.update&&e.controls.update(Math.min(1,e.clock.getDelta())),e.postProcessingComposer?e.postProcessingComposer.render():e.renderer.render(e.scene,e.camera),e.extraRenderers.forEach((function(t){return t.render(e.scene,e.camera)})),e.enablePointerInteraction){var t=null;if(e.hoverDuringDrag||!e.isPointerDragging){var n=this.intersectingObjects(e.pointerPos.x,e.pointerPos.y).filter((function(t){return e.hoverFilter(t.object)})).sort((function(t,n){return e.hoverOrderComparator(t.object,n.object)})),r=n.length?n[0]:null;t=r?r.object:null,e.intersectionPoint=r?r.point:null}t!==e.hoverObj&&(e.onHover(t,e.hoverObj),e.toolTipElem.innerHTML=t&&Pp(e.tooltipContent)(t)||"",e.hoverObj=t)}e.tweenGroup.update()}return this},getPointerPos:function(e){var t=e.pointerPos;return{x:t.x,y:t.y}},cameraPosition:function(e,t,n,r){var i=e.camera;if(t&&e.initialised){var s=t,a=n||{x:0,y:0,z:0};if(r){var o=Object.assign({},i.position),l=A();e.tweenGroup.add(new Rc(o).to(s,r).easing(Sc.Quadratic.Out).onUpdate(u).start()),e.tweenGroup.add(new Rc(l).to(a,r/3).easing(Sc.Quadratic.Out).onUpdate(c).start())}else u(s),c(a);return this}return Object.assign({},i.position,{lookAt:A()});function u(e){var t=e.x,n=e.y,r=e.z;void 0!==t&&(i.position.x=t),void 0!==n&&(i.position.y=n),void 0!==r&&(i.position.z=r)}function c(t){var n=new Rq.Vector3(t.x,t.y,t.z);e.controls.target?e.controls.target=n:i.lookAt(n)}function A(){return Object.assign(new Rq.Vector3(0,0,-1e3).applyQuaternion(i.quaternion).add(i.position))}},zoomToFit:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,r=arguments.length,i=new Array(r>3?r-3:0),s=3;s<r;s++)i[s-3]=arguments[s];return this.fitToBbox(this.getBbox.apply(this,i),t,n)},fitToBbox:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,i=e.camera;if(t){var s=new Rq.Vector3(0,0,0),a=2*Math.max.apply(Math,Eq(Object.entries(t).map((function(e){var t=Mq(e,2),n=t[0],r=t[1];return Math.max.apply(Math,Eq(r.map((function(e){return Math.abs(s[n]-e)}))))})))),o=(1-2*r/e.height)*i.fov,l=a/Math.atan(o*Math.PI/180),u=l/i.aspect,c=Math.max(l,u);if(c>0){var A=s.clone().sub(i.position).normalize().multiplyScalar(-c);this.cameraPosition(A,s,n)}}return this},getBbox:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},n=new Rq.Box3(new Rq.Vector3(0,0,0),new Rq.Vector3(0,0,0)),r=e.objects.filter(t);return r.length?(r.forEach((function(e){return n.expandByObject(e)})),Object.assign.apply(Object,Eq(["x","y","z"].map((function(e){return wq({},e,[n.min[e],n.max[e]])}))))):null},getScreenCoords:function(e,t,n,r){var i=new Rq.Vector3(t,n,r);return i.project(this.camera()),{x:(i.x+1)*e.width/2,y:-(i.y-1)*e.height/2}},getSceneCoords:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=new Rq.Vector2(t/e.width*2-1,-n/e.height*2+1),s=new Rq.Raycaster;return s.setFromCamera(i,e.camera),Object.assign({},s.ray.at(r,new Rq.Vector3))},intersectingObjects:function(e,t,n){var r=new Rq.Vector2(t/e.width*2-1,-n/e.height*2+1),i=new Rq.Raycaster;return i.params.Line.threshold=e.lineHoverPrecision,i.setFromCamera(r,e.camera),i.intersectObjects(e.objects,!0)},renderer:function(e){return e.renderer},scene:function(e){return e.scene},camera:function(e){return e.camera},postProcessingComposer:function(e){return e.postProcessingComposer},controls:function(e){return e.controls},tbControls:function(e){return e.controls}},stateInit:function(){return{scene:new Rq.Scene,camera:new Rq.PerspectiveCamera,clock:new Rq.Clock,tweenGroup:new wc}},init:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.controlType,i=void 0===r?"trackball":r,s=n.useWebGPU,a=void 0!==s&&s,o=n.rendererConfig,l=void 0===o?{}:o,u=n.extraRenderers,c=void 0===u?[]:u,A=n.waitForLoadComplete,h=void 0===A||A;e.innerHTML="",e.appendChild(t.container=document.createElement("div")),t.container.className="scene-container",t.container.style.position="relative",t.container.appendChild(t.navInfo=document.createElement("div")),t.navInfo.className="scene-nav-info",t.navInfo.textContent={orbit:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",trackball:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",fly:"WASD: move, R|F: up | down, Q|E: roll, up|down: pitch, left|right: yaw"}[i]||"",t.navInfo.style.display=t.showNavInfo?null:"none",t.toolTipElem=document.createElement("div"),t.toolTipElem.classList.add("scene-tooltip"),t.container.appendChild(t.toolTipElem),t.pointerPos=new Rq.Vector2,t.pointerPos.x=-2,t.pointerPos.y=-2,["pointermove","pointerdown"].forEach((function(e){return t.container.addEventListener(e,(function(n){if("pointerdown"===e&&(t.isPointerPressed=!0),!t.isPointerDragging&&"pointermove"===n.type&&(n.pressure>0||t.isPointerPressed)&&("touch"!==n.pointerType||void 0===n.movementX||[n.movementX,n.movementY].some((function(e){return Math.abs(e)>1})))&&(t.isPointerDragging=!0),t.enablePointerInteraction){var r=(i=t.container,s=i.getBoundingClientRect(),a=window.pageXOffset||document.documentElement.scrollLeft,o=window.pageYOffset||document.documentElement.scrollTop,{top:s.top+o,left:s.left+a});t.pointerPos.x=n.pageX-r.left,t.pointerPos.y=n.pageY-r.top,t.toolTipElem.style.top="".concat(t.pointerPos.y,"px"),t.toolTipElem.style.left="".concat(t.pointerPos.x,"px"),t.toolTipElem.style.transform="translate(-".concat(t.pointerPos.x/t.width*100,"%, ").concat(t.height-t.pointerPos.y<100?"calc(-100% - 8px)":"21px",")")}var i,s,a,o}),{passive:!0})})),t.container.addEventListener("pointerup",(function(e){t.isPointerPressed=!1,t.isPointerDragging&&(t.isPointerDragging=!1,!t.clickAfterDrag)||requestAnimationFrame((function(){0===e.button&&t.onClick(t.hoverObj||null,e,t.intersectionPoint),2===e.button&&t.onRightClick&&t.onRightClick(t.hoverObj||null,e,t.intersectionPoint)}))}),{passive:!0,capture:!0}),t.container.addEventListener("contextmenu",(function(e){t.onRightClick&&e.preventDefault()})),t.renderer=new(a?lF:Rq.WebGLRenderer)(Object.assign({antialias:!0,alpha:!0},l)),t.renderer.setPixelRatio(Math.min(2,window.devicePixelRatio)),t.container.appendChild(t.renderer.domElement),t.extraRenderers=c,t.extraRenderers.forEach((function(e){e.domElement.style.position="absolute",e.domElement.style.top="0px",e.domElement.style.pointerEvents="none",t.container.appendChild(e.domElement)})),t.postProcessingComposer=new kk(t.renderer),t.postProcessingComposer.addPass(new qk(t.scene,t.camera)),t.controls=new{trackball:RF,orbit:ok,fly:Sk}[i](t.camera,t.renderer.domElement),"fly"===i&&(t.controls.movementSpeed=300,t.controls.rollSpeed=Math.PI/6,t.controls.dragToLook=!0),"trackball"!==i&&"orbit"!==i||(t.controls.minDistance=.1,t.controls.maxDistance=t.skyRadius,t.controls.addEventListener("start",(function(){t.controlsEngaged=!0})),t.controls.addEventListener("change",(function(){t.controlsEngaged&&(t.controlsDragging=!0)})),t.controls.addEventListener("end",(function(){t.controlsEngaged=!1,t.controlsDragging=!1}))),[t.renderer,t.postProcessingComposer].concat(Eq(t.extraRenderers)).forEach((function(e){return e.setSize(t.width,t.height)})),t.camera.aspect=t.width/t.height,t.camera.updateProjectionMatrix(),t.camera.position.z=1e3,t.scene.add(t.skysphere=new Rq.Mesh),t.skysphere.visible=!1,t.loadComplete=t.scene.visible=!h,window.scene=t.scene},update:function(e,t){if(e.width&&e.height&&(t.hasOwnProperty("width")||t.hasOwnProperty("height"))&&(e.container.style.width="".concat(e.width,"px"),e.container.style.height="".concat(e.height,"px"),[e.renderer,e.postProcessingComposer].concat(Eq(e.extraRenderers)).forEach((function(t){return t.setSize(e.width,e.height)})),e.camera.aspect=e.width/e.height,e.camera.updateProjectionMatrix()),t.hasOwnProperty("skyRadius")&&e.skyRadius&&(e.controls.hasOwnProperty("maxDistance")&&t.skyRadius&&(e.controls.maxDistance=Math.min(e.controls.maxDistance,e.skyRadius)),e.camera.far=2.5*e.skyRadius,e.camera.updateProjectionMatrix(),e.skysphere.geometry=new Rq.SphereGeometry(e.skyRadius)),t.hasOwnProperty("backgroundColor")){var n=oq(e.backgroundColor).alpha;void 0===n&&(n=1),e.renderer.setClearColor(new Rq.Color(Sq(1,e.backgroundColor)),n)}function r(){e.loadComplete=e.scene.visible=!0}t.hasOwnProperty("backgroundImageUrl")&&(e.backgroundImageUrl?(new Rq.TextureLoader).load(e.backgroundImageUrl,(function(t){t.colorSpace=Rq.SRGBColorSpace,e.skysphere.material=new Rq.MeshBasicMaterial({map:t,side:Rq.BackSide}),e.skysphere.visible=!0,e.onBackgroundImageLoaded&&setTimeout(e.onBackgroundImageLoaded),!e.loadComplete&&r()})):(e.skysphere.visible=!1,e.skysphere.material.map=null,!e.loadComplete&&r())),t.hasOwnProperty("showNavInfo")&&(e.navInfo.style.display=e.showNavInfo?null:"none"),t.hasOwnProperty("lights")&&((t.lights||[]).forEach((function(t){return e.scene.remove(t)})),e.lights.forEach((function(t){return e.scene.add(t)}))),t.hasOwnProperty("objects")&&((t.objects||[]).forEach((function(t){return e.scene.remove(t)})),e.objects.forEach((function(t){return e.scene.add(t)})))}});function Pq(e,t){var n=new t;return n._destructor&&n._destructor(),{linkProp:function(t){return{default:n[t](),onChange:function(n,r){r[e][t](n)},triggerUpdate:!1}},linkMethod:function(t){return function(n){for(var r=n[e],i=arguments.length,s=new Array(i>1?i-1:0),a=1;a<i;a++)s[a-1]=arguments[a];var o=r[t].apply(r,s);return o===r?this:o}}}}var Dq=["rendererConfig","waitForGlobeReady"],Lq=r(r({},window.THREE?window.THREE:{AmbientLight:qa,DirectionalLight:ka,Vector2:Lt,REVISION:s}),{},{CSS2DRenderer:class{constructor(e={}){const t=this;let n,r,i,s;const a={objects:new WeakMap},o=void 0!==e.element?e.element:document.createElement("div");function l(e){e.isCSS2DObject&&(e.element.style.display="none");for(let t=0,n=e.children.length;t<n;t++)l(e.children[t])}function u(e,n,r){if(!1!==e.visible){if(e.isCSS2DObject){zu.setFromMatrixPosition(e.matrixWorld),zu.applyMatrix4(Hu);const l=zu.z>=-1&&zu.z<=1&&!0===e.layers.test(r.layers),u=e.element;u.style.display=!0===l?"":"none",!0===l&&(e.onBeforeRender(t,n,r),u.style.transform="translate("+-100*e.center.x+"%,"+-100*e.center.y+"%)translate("+(zu.x*i+i)+"px,"+(-zu.y*s+s)+"px)",u.parentNode!==o&&o.appendChild(u),e.onAfterRender(t,n,r));const A={distanceToCameraSquared:c(r,e)};a.objects.set(e,A)}for(let t=0,i=e.children.length;t<i;t++)u(e.children[t],n,r)}else l(e)}function c(e,t){return ju.setFromMatrixPosition(e.matrixWorld),Wu.setFromMatrixPosition(t.matrixWorld),ju.distanceToSquared(Wu)}o.style.overflow="hidden",this.domElement=o,this.getSize=function(){return{width:n,height:r}},this.render=function(e,t){!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),Vu.copy(t.matrixWorldInverse),Hu.multiplyMatrices(t.projectionMatrix,Vu),u(e,e,t),function(e){const t=function(e){const t=[];return e.traverseVisible((function(e){e.isCSS2DObject&&t.push(e)})),t}(e).sort((function(e,t){if(e.renderOrder!==t.renderOrder)return t.renderOrder-e.renderOrder;return a.objects.get(e).distanceToCameraSquared-a.objects.get(t).distanceToCameraSquared})),n=t.length;for(let e=0,r=t.length;e<r;e++)t[e].element.style.zIndex=n-e}(e)},this.setSize=function(e,t){n=e,r=t,i=n/2,s=r/2,o.style.width=e+"px",o.style.height=t+"px"}}}}),Iq=Pq("globe",eb),Uq=Object.assign.apply(Object,i(["globeImageUrl","bumpImageUrl","showGlobe","showGraticules","showAtmosphere","atmosphereColor","atmosphereAltitude","onGlobeReady","pointsData","pointLat","pointLng","pointColor","pointAltitude","pointRadius","pointResolution","pointsMerge","pointsTransitionDuration","arcsData","arcStartLat","arcStartLng","arcEndLat","arcEndLng","arcColor","arcAltitude","arcAltitudeAutoScale","arcStroke","arcCurveResolution","arcCircularResolution","arcDashLength","arcDashGap","arcDashInitialGap","arcDashAnimateTime","arcsTransitionDuration","polygonsData","polygonGeoJsonGeometry","polygonCapColor","polygonCapMaterial","polygonSideColor","polygonSideMaterial","polygonStrokeColor","polygonAltitude","polygonCapCurvatureResolution","polygonsTransitionDuration","pathsData","pathPoints","pathPointLat","pathPointLng","pathPointAlt","pathResolution","pathColor","pathStroke","pathDashLength","pathDashGap","pathDashInitialGap","pathDashAnimateTime","pathTransitionDuration","heatmapsData","heatmapPoints","heatmapPointLat","heatmapPointLng","heatmapPointWeight","heatmapBandwidth","heatmapColorFn","heatmapColorSaturation","heatmapBaseAltitude","heatmapTopAltitude","heatmapsTransitionDuration","hexBinPointsData","hexBinPointLat","hexBinPointLng","hexBinPointWeight","hexBinResolution","hexMargin","hexTopCurvatureResolution","hexTopColor","hexSideColor","hexAltitude","hexBinMerge","hexTransitionDuration","hexPolygonsData","hexPolygonGeoJsonGeometry","hexPolygonColor","hexPolygonAltitude","hexPolygonResolution","hexPolygonMargin","hexPolygonUseDots","hexPolygonCurvatureResolution","hexPolygonDotResolution","hexPolygonsTransitionDuration","tilesData","tileLat","tileLng","tileAltitude","tileWidth","tileHeight","tileUseGlobeProjection","tileMaterial","tileCurvatureResolution","tilesTransitionDuration","ringsData","ringLat","ringLng","ringAltitude","ringColor","ringResolution","ringMaxRadius","ringPropagationSpeed","ringRepeatPeriod","labelsData","labelLat","labelLng","labelAltitude","labelRotation","labelText","labelSize","labelTypeFace","labelColor","labelResolution","labelIncludeDot","labelDotRadius","labelDotOrientation","labelsTransitionDuration","htmlElementsData","htmlLat","htmlLng","htmlAltitude","htmlElement","htmlTransitionDuration","objectsData","objectLat","objectLng","objectAltitude","objectRotation","objectFacesSurface","objectThreeObject","customLayerData","customThreeObject","customThreeObjectUpdate"].map((function(e){return t({},e,Iq.linkProp(e))})))),Bq=Object.assign.apply(Object,i(["globeMaterial","getGlobeRadius","getCoords","toGeoCoords"].map((function(e){return t({},e,Iq.linkMethod(e))})))),Oq=Pq("renderObjs",Nq),Fq=Object.assign.apply(Object,i(["width","height","backgroundColor","backgroundImageUrl","enablePointerInteraction"].map((function(e){return t({},e,Oq.linkProp(e))})))),kq=Object.assign.apply(Object,i(["lights","postProcessingComposer"].map((function(e){return t({},e,Oq.linkMethod(e))})))),qq=xc({props:r(r({onZoom:{triggerUpdate:!1},onGlobeClick:{triggerUpdate:!1},onGlobeRightClick:{triggerUpdate:!1},pointLabel:{default:"name",triggerUpdate:!1},onPointClick:{triggerUpdate:!1},onPointRightClick:{triggerUpdate:!1},onPointHover:{triggerUpdate:!1},arcLabel:{default:"name",triggerUpdate:!1},onArcClick:{triggerUpdate:!1},onArcRightClick:{triggerUpdate:!1},onArcHover:{triggerUpdate:!1},polygonLabel:{default:"name",triggerUpdate:!1},onPolygonClick:{triggerUpdate:!1},onPolygonRightClick:{triggerUpdate:!1},onPolygonHover:{triggerUpdate:!1},pathLabel:{default:"name",triggerUpdate:!1},onPathClick:{triggerUpdate:!1},onPathRightClick:{triggerUpdate:!1},onPathHover:{triggerUpdate:!1},onHeatmapClick:{triggerUpdate:!1},onHeatmapRightClick:{triggerUpdate:!1},onHeatmapHover:{triggerUpdate:!1},hexLabel:{triggerUpdate:!1},onHexClick:{triggerUpdate:!1},onHexRightClick:{triggerUpdate:!1},onHexHover:{triggerUpdate:!1},hexPolygonLabel:{triggerUpdate:!1},onHexPolygonClick:{triggerUpdate:!1},onHexPolygonRightClick:{triggerUpdate:!1},onHexPolygonHover:{triggerUpdate:!1},tileLabel:{default:"name",triggerUpdate:!1},onTileClick:{triggerUpdate:!1},onTileRightClick:{triggerUpdate:!1},onTileHover:{triggerUpdate:!1},labelLabel:{triggerUpdate:!1},onLabelClick:{triggerUpdate:!1},onLabelRightClick:{triggerUpdate:!1},onLabelHover:{triggerUpdate:!1},objectLabel:{default:"name",triggerUpdate:!1},onObjectClick:{triggerUpdate:!1},onObjectRightClick:{triggerUpdate:!1},onObjectHover:{triggerUpdate:!1},customLayerLabel:{default:"name",triggerUpdate:!1},onCustomLayerClick:{triggerUpdate:!1},onCustomLayerRightClick:{triggerUpdate:!1},onCustomLayerHover:{triggerUpdate:!1},pointerEventsFilter:{default:function(){return!0},triggerUpdate:!1,onChange:function(e,t){return t.renderObjs.hoverFilter((function(t){return e(t,t.__data)}))}},lineHoverPrecision:{default:.2,triggerUpdate:!1,onChange:function(e,t){return t.renderObjs.lineHoverPrecision(e)}}},Uq),Fq),methods:r(r({pauseAnimation:function(e){var t;return null!==e.animationFrameRequestId&&(cancelAnimationFrame(e.animationFrameRequestId),e.animationFrameRequestId=null),null===(t=e.globe)||void 0===t||t.pauseAnimation(),this},resumeAnimation:function(e){var t;return null===e.animationFrameRequestId&&this._animationCycle(),null===(t=e.globe)||void 0===t||t.resumeAnimation(),this},_animationCycle:function(e){e.renderObjs.tick(),e.tweenGroup.update(),e.animationFrameRequestId=requestAnimationFrame(this._animationCycle)},pointOfView:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=e.globe.toGeoCoords(e.renderObjs.cameraPosition());if(void 0===t.lat&&void 0===t.lng&&void 0===t.altitude)return r;var i=Object.assign({},r,t);if(["lat","lng","altitude"].forEach((function(e){return i[e]=+i[e]})),n){for(;r.lng-i.lng>180;)r.lng-=360;for(;r.lng-i.lng<-180;)r.lng+=360;e.tweenGroup.add(new Rc(r).to(i,n).easing(Sc.Cubic.InOut).onUpdate(s).start())}else s(i);return this;function s(t){var n=t.lat,r=t.lng,i=t.altitude;e.renderObjs.cameraPosition(e.globe.getCoords(n,r,i))}},getScreenCoords:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var s=(t=e.globe).getCoords.apply(t,r);return e.renderObjs.getScreenCoords(s.x,s.y,s.z)},toGlobeCoords:function(e,t,n){var r=e.renderObjs.intersectingObjects(t,n).find((function(e){return"globe"===e.object.__globeObjType}));if(!r)return null;var i=e.globe.toGeoCoords(r.point);return{lat:i.lat,lng:i.lng}},scene:function(e){return e.renderObjs.scene()},camera:function(e){return e.renderObjs.camera()},renderer:function(e){return e.renderObjs.renderer()},controls:function(e){return e.renderObjs.controls()},_destructor:function(e){e.globe._destructor(),this.pauseAnimation(),this.pointsData([]),this.arcsData([]),this.polygonsData([]),this.pathsData([]),this.heatmapsData([]),this.hexBinPointsData([]),this.hexPolygonsData([]),this.tilesData([]),this.labelsData([]),this.htmlElementsData([]),this.objectsData([]),this.customLayerData([])}},Bq),kq),stateInit:function(e){var t=e.rendererConfig,n=e.waitForGlobeReady,i=void 0===n||n,s=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,Dq),a=new eb(r({waitForGlobeReady:i},s));return{globe:a,renderObjs:Nq({controlType:"orbit",rendererConfig:t,waitForLoadComplete:i,extraRenderers:[new Lq.CSS2DRenderer]}).skyRadius(500*a.getGlobeRadius()).showNavInfo(!1).objects([a]).lights([new Lq.AmbientLight(13421772,Math.PI),new Lq.DirectionalLight(16777215,.6*Math.PI)]),tweenGroup:new wc}},init:function(e,t){var n=this;e.innerHTML="",e.appendChild(t.container=document.createElement("div")),t.container.style.position="relative";var r=document.createElement("div");t.container.appendChild(r),t.renderObjs(r),t.globe.rendererSize(t.renderObjs.renderer().getSize(new Lq.Vector2)),this.pointOfView({altitude:2.5});var i=t.globe.getGlobeRadius(),s=t.renderObjs.controls();s.minDistance=1.01*i,s.maxDistance=100*i,s.enablePan=!1,s.enableDamping=!0,s.dampingFactor=.1,s.rotateSpeed=.3,s.zoomSpeed=.3,s.addEventListener("change",(function(){var e=n.pointOfView();s.rotateSpeed=.2*e.altitude,s.zoomSpeed=.1*(e.altitude+1),t.globe.setPointOfView(t.renderObjs.camera()),t.onZoom&&t.onZoom(e)}));var a=function(e){for(var t=e;t&&!t.hasOwnProperty("__globeObjType");)t=t.parent;return t},o={point:function(e){return e},arc:function(e){return e},polygon:function(e){return e.data},path:function(e){return e},heatmap:function(e){return e},hexbin:function(e){return e},hexPolygon:function(e){return e},tile:function(e){return e},label:function(e){return e},object:function(e){return e},custom:function(e){return e}};Lq.REVISION<155&&(t.renderObjs.renderer().useLegacyLights=!1),t.renderObjs.hoverOrderComparator((function(e,t){var n=a(e),r=a(t),i=function(e){return!e};return i(n)-i(r)})).tooltipContent((function(e){var n={point:t.pointLabel,arc:t.arcLabel,polygon:t.polygonLabel,path:t.pathLabel,hexbin:t.hexLabel,hexPolygon:t.hexPolygonLabel,tile:t.tileLabel,label:t.labelLabel,object:t.objectLabel,custom:t.customLayerLabel},r=a(e),i=r&&r.__globeObjType;return r&&i&&n.hasOwnProperty(i)&&o.hasOwnProperty(i)&&Pp(n[i])(o[i](r.__data))||""})).onHover((function(e){var n={point:t.onPointHover,arc:t.onArcHover,polygon:t.onPolygonHover,path:t.onPathHover,heatmap:t.onHeatmapHover,hexbin:t.onHexHover,hexPolygon:t.onHexPolygonHover,tile:t.onTileHover,label:t.onLabelHover,object:t.onObjectHover,custom:t.onCustomLayerHover},r={globe:t.onGlobeClick,point:t.onPointClick,arc:t.onArcClick,polygon:t.onPolygonClick,path:t.onPathClick,heatmap:t.onHeatmapClick,hexbin:t.onHexClick,hexPolygon:t.onHexPolygonClick,tile:t.onTileClick,label:t.onLabelClick,object:t.onObjectClick,custom:t.onCustomLayerClick},i=a(e);if(i&&!n.hasOwnProperty(i.__globeObjType)&&(i=null),i!==t.hoverObj){var s=t.hoverObj?t.hoverObj.__globeObjType:null,l=t.hoverObj?o[s](t.hoverObj.__data):null,u=i?i.__globeObjType:null,c=i?o[u](i.__data):null;s&&s!==u&&n[s]&&n[s](null,l),u&&n[u]&&n[u](c,s===u?l:null),t.renderObjs.renderer().domElement.classList[u&&r[u]?"add":"remove"]("clickable"),t.hoverObj=i}})).onClick((function(e,r,i){if(e){var s={globe:t.onGlobeClick,point:t.onPointClick,arc:t.onArcClick,polygon:t.onPolygonClick,path:t.onPathClick,heatmap:t.onHeatmapClick,hexbin:t.onHexClick,hexPolygon:t.onHexPolygonClick,tile:t.onTileClick,label:t.onLabelClick,object:t.onObjectClick,custom:t.onCustomLayerClick},l=a(e),u=l.__globeObjType;if(l&&s.hasOwnProperty(u)&&s[u]){var c=[r];if("globe"===u){var A=n.toGeoCoords(i),h=A.lat,d=A.lng;c.unshift({lat:h,lng:d})}else c.push(n.toGeoCoords(i));o.hasOwnProperty(u)&&c.unshift(o[u](l.__data)),s[u].apply(s,c)}}})).onRightClick((function(e,r,i){if(e){var s={globe:t.onGlobeRightClick,point:t.onPointRightClick,arc:t.onArcRightClick,polygon:t.onPolygonRightClick,path:t.onPathRightClick,heatmap:t.onHeatmapRightClick,hexbin:t.onHexRightClick,hexPolygon:t.onHexPolygonRightClick,tile:t.onTileRightClick,label:t.onLabelRightClick,object:t.onObjectRightClick,custom:t.onCustomLayerRightClick},l=a(e),u=l.__globeObjType;if(l&&s.hasOwnProperty(u)&&s[u]){var c=[r];if("globe"===u){var A=n.toGeoCoords(i),h=A.lat,d=A.lng;c.unshift({lat:h,lng:d})}else c.push(n.toGeoCoords(i));o.hasOwnProperty(u)&&c.unshift(o[u](l.__data)),s[u].apply(s,c)}}})),this._animationCycle()}});return qq})); -
interactive-globes/trunk/interactive-globes.php
r3207680 r3263746 7 7 * Plugin URI: https://wpinteractiveglobes.com/ 8 8 * Description: Create interactive geographic globes. Color full regions or create markers on specific locations that will have information on hover and can also have actions on click. This plugin uses the online globe.gl library to generate the maps. 9 * Version: 1.4. 39 * Version: 1.4.7 10 10 * Requires PHP: 7.0 11 11 * Author: Interactive Globes … … 15 15 */ 16 16 17 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes;17 namespace Saltus\WP\Plugin\InteractiveGlobes; 18 18 19 use Saltus\WP\Framework\Core as FrameworkCore; 20 use Saltus\WP\Plugin\Saltus\InteractiveGlobes\Project; 21 use Saltus\WP\Framework\Infrastructure\Container\ServiceContainer; 22 use Saltus\WP\Plugin\Saltus\InteractiveGlobes\Plugin\Freemius; 23 use Saltus\WP\Plugin\Saltus\InteractiveGlobes\Prepare; 19 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Core as FrameworkCore; 20 use Saltus\WP\Plugin\InteractiveGlobes\Project; 21 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Container\ServiceContainer; 22 23 use Saltus\WP\Plugin\InteractiveGlobes\Plugin\Freemius; 24 use Saltus\WP\Plugin\InteractiveGlobes\Prepare; 24 25 25 26 /** … … 41 42 * ###### 42 43 */ 43 if ( ! function_exists( 'Saltus\WP\Plugin\ Saltus\InteractiveGlobes\is_plugin_active' ) ) {44 if ( ! function_exists( 'Saltus\WP\Plugin\InteractiveGlobes\is_plugin_active' ) ) { 44 45 function is_plugin_active( $plugin ) { 45 46 return in_array( $plugin, (array) get_option( 'active_plugins', array() ), true ); … … 130 131 * ###### 131 132 */ 132 if ( file_exists( __DIR__ . '/vendor /autoload.php' ) ) {133 require_once __DIR__ . '/vendor /autoload.php';133 if ( file_exists( __DIR__ . '/vendor-prefixed/autoload.php' ) ) { 134 require_once __DIR__ . '/vendor-prefixed/autoload.php'; 134 135 } 135 136 … … 173 174 $services_container = new ServiceContainer(); 174 175 175 $project = new Project( 'interactive-globes', '1.4. 3', __FILE__ );176 $project = new Project( 'interactive-globes', '1.4.7', __FILE__ ); 176 177 177 178 // Initialize plugin -
interactive-globes/trunk/languages/interactive-globes.pot
r3207680 r3263746 1 # Copyright (C) 202 4Interactive Globes1 # Copyright (C) 2025 Interactive Globes 2 2 # This file is distributed under the same license as the Interactive Globes package. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Interactive Globes 1.4. 0\n"5 "Project-Id-Version: Interactive Globes 1.4.5\n" 6 6 "Report-Msgid-Bugs-To: https://saltus.dev/\n" 7 "POT-Creation-Date: 202 4-11-07 04:19:47+00:00\n"7 "POT-Creation-Date: 2025-02-27 12:59:08+00:00\n" 8 8 "MIME-Version: 1.0\n" 9 9 "Content-Type: text/plain; charset=utf-8\n" 10 10 "Content-Transfer-Encoding: 8bit\n" 11 "PO-Revision-Date: 202 4-MO-DA HO:MI+ZONE\n"11 "PO-Revision-Date: 2025-MO-DA HO:MI+ZONE\n" 12 12 "Last-Translator: Saltus <web@saltus.dev>\n" 13 13 "Language-Team: Saltus <web@saltus.dev>\n" … … 25 25 "X-Generator: grunt-wp-i18n 1.0.3\n" 26 26 27 #: interactive-globes.php:7 627 #: interactive-globes.php:77 28 28 msgid "The premium version of the plugin has been deactivated to avoid conflicts" 29 29 msgstr "" … … 80 80 msgstr "" 81 81 82 #: src/Features/CptManager/CptManagerCore.php: 6882 #: src/Features/CptManager/CptManagerCore.php:82 83 83 msgid "Add title" 84 84 msgstr "" 85 85 86 86 #: src/Features/DotLabel/DotLabelProMeta.php:22 87 #: src/Features/Point/PointProMeta.php:22 src/models/globe-region.php:26 87 #: src/Features/Point/PointProMeta.php:22 src/models/04-globe-region.php:27 88 #: src/models/06-globe-html.php:10 89 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:119 90 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:132 91 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:145 92 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:160 93 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:176 94 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:189 95 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:203 96 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:221 88 97 msgid "Default" 89 98 msgstr "" 90 99 91 100 #: src/Features/DotLabel/DotLabelProMeta.php:29 92 #: src/models/globe-dotlabel.php:138 src/models/globe-line.php:150 93 #: src/models/globe-point.php:133 src/models/globe-region.php:205 101 #: src/models/01-globe-dotlabel.php:138 src/models/02-globe-point.php:133 102 #: src/models/03-globe-line.php:150 src/models/04-globe-region.php:212 103 #: src/models/06-globe-html.php:134 94 104 msgid "Details" 95 105 msgstr "" 96 106 97 107 #: src/Features/DotLabel/DotLabelProMeta.php:33 98 #: src/Features/Point/PointProMeta.php: 28 src/models/globe-line.php:25899 #: src/models/ globe-region.php:235108 #: src/Features/Point/PointProMeta.php:33 src/models/03-globe-line.php:258 109 #: src/models/04-globe-region.php:242 src/models/06-globe-html.php:187 100 110 msgid "Customize" 101 111 msgstr "" 102 112 103 113 #: src/Features/DotLabel/DotLabelProMeta.php:39 104 #: src/Features/Point/PointProMeta.php:3 3 src/models/globe-line.php:263105 #: src/models/ globe-region.php:240114 #: src/Features/Point/PointProMeta.php:37 src/models/03-globe-line.php:263 115 #: src/models/04-globe-region.php:247 src/models/06-globe-html.php:192 106 116 msgid "Use Custom Options" 107 117 msgstr "" 108 118 109 119 #: src/Features/DotLabel/DotLabelProMeta.php:40 110 #: src/Features/Point/PointProMeta.php:3 4 src/models/globe-line.php:264111 #: src/models/ globe-region.php:241120 #: src/Features/Point/PointProMeta.php:38 src/models/03-globe-line.php:264 121 #: src/models/04-globe-region.php:248 112 122 msgid "Define custom colors and actions." 113 123 msgstr "" 114 124 115 125 #: src/Features/DotLabel/DotLabelProMeta.php:45 116 #: src/Features/Point/PointProMeta.php: 39126 #: src/Features/Point/PointProMeta.php:43 117 127 #: src/Services/Model/Base/MetaDotLabel.php:105 118 128 #: src/Services/Model/Base/MetaPoint.php:104 119 #: src/Services/Model/Pro/MetaRegions.php:71 src/models/globe-pro.php:186 120 #: src/models/globe-pro.php:232 src/models/globe-region.php:246 129 #: src/Services/Model/Pro/MetaHTML.php:50 130 #: src/Services/Model/Pro/MetaRegions.php:71 src/models/00-globe-pro.php:186 131 #: src/models/00-globe-pro.php:232 src/models/04-globe-region.php:253 132 #: src/models/06-globe-html.php:198 121 133 msgid "Click Action" 122 134 msgstr "" 123 135 124 136 #: src/Features/DotLabel/DotLabelProMeta.php:55 125 #: src/Features/Point/PointProMeta.php: 56 src/Services/Model/Base/Meta.php:130137 #: src/Features/Point/PointProMeta.php:96 src/Services/Model/Base/Meta.php:130 126 138 #: src/Services/Model/Base/MetaDotLabel.php:115 127 #: src/Services/Model/Base/MetaPoint.php:1 19128 #: src/Services/Model/Pro/MetaLines.php:76 src/models/ globe-line.php:315129 #: src/models/ globe-pro.php:203 src/models/globe-pro.php:242139 #: src/Services/Model/Base/MetaPoint.php:125 140 #: src/Services/Model/Pro/MetaLines.php:76 src/models/00-globe-pro.php:203 141 #: src/models/00-globe-pro.php:242 src/models/03-globe-line.php:315 130 142 msgid "Altitude" 131 143 msgstr "" 132 144 133 145 #: src/Features/DotLabel/DotLabelProMeta.php:62 134 #: src/Services/Model/Base/MetaDotLabel.php:121 src/models/ globe-pro.php:249146 #: src/Services/Model/Base/MetaDotLabel.php:121 src/models/00-globe-pro.php:249 135 147 msgid "Label Size" 136 148 msgstr "" 137 149 138 150 #: src/Features/DotLabel/DotLabelProMeta.php:67 139 #: src/Features/Point/PointProMeta.php: 61151 #: src/Features/Point/PointProMeta.php:101 140 152 #: src/Services/Model/Base/MetaDotLabel.php:125 141 #: src/Services/Model/Base/MetaPoint.php:12 3142 #: src/Services/Model/Pro/MetaRegions.php:78 src/models/ globe-pro.php:208143 #: src/models/ globe-pro.php:254 src/models/globe-region.php:254153 #: src/Services/Model/Base/MetaPoint.php:129 154 #: src/Services/Model/Pro/MetaRegions.php:78 src/models/00-globe-pro.php:208 155 #: src/models/00-globe-pro.php:254 src/models/04-globe-region.php:261 144 156 msgid "Fill Color" 145 157 msgstr "" 146 158 147 159 #: src/Features/DotLabel/DotLabelProMeta.php:73 148 #: src/Features/Point/PointProMeta.php: 67160 #: src/Features/Point/PointProMeta.php:107 149 161 #: src/Services/Model/Base/MetaDotLabel.php:130 150 #: src/Services/Model/Base/MetaPoint.php:1 28151 #: src/Services/Model/Pro/MetaRegions.php:83 src/models/ globe-pro.php:133152 #: src/models/ globe-pro.php:214 src/models/globe-pro.php:260153 #: src/models/ globe-region.php:260162 #: src/Services/Model/Base/MetaPoint.php:134 163 #: src/Services/Model/Pro/MetaRegions.php:83 src/models/00-globe-pro.php:133 164 #: src/models/00-globe-pro.php:214 src/models/00-globe-pro.php:260 165 #: src/models/04-globe-region.php:267 154 166 msgid "Hover Color" 155 167 msgstr "" 156 168 157 169 #: src/Features/DotLabel/DotLabelProMeta.php:78 158 #: src/Services/Model/Base/MetaDotLabel.php:134 src/models/ globe-pro.php:265170 #: src/Services/Model/Base/MetaDotLabel.php:134 src/models/00-globe-pro.php:265 159 171 msgid "Display Dot" 160 172 msgstr "" 161 173 162 174 #: src/Features/DotLabel/DotLabelProMeta.php:79 163 #: src/Services/Model/Base/MetaDotLabel.php:135 src/models/ globe-pro.php:266175 #: src/Services/Model/Base/MetaDotLabel.php:135 src/models/00-globe-pro.php:266 164 176 msgid "" 165 177 "Display a dot marker next to the text indicating the exact coordinates of " … … 168 180 169 181 #: src/Features/DotLabel/DotLabelProMeta.php:88 170 #: src/Services/Model/Base/MetaDotLabel.php:143 src/models/ globe-pro.php:275182 #: src/Services/Model/Base/MetaDotLabel.php:143 src/models/00-globe-pro.php:275 171 183 msgid "Dot Radius" 172 184 msgstr "" … … 174 186 #: src/Features/DotLabel/DotLabelProMeta.php:95 175 187 #: src/Services/Model/Base/MetaDotLabel.php:151 176 #: src/Services/Model/Pro/MetaSearch.php:33 src/models/globe-pro.php:282 188 #: src/Services/Model/Pro/MetaRegions.php:135 189 #: src/Services/Model/Pro/MetaSearch.php:33 src/models/00-globe-pro.php:282 177 190 msgid "Bottom" 178 191 msgstr "" … … 180 193 #: src/Features/DotLabel/DotLabelProMeta.php:96 181 194 #: src/Services/Model/Base/MetaDotLabel.php:152 182 #: src/Services/Model/Pro/MetaSearch.php:32 src/models/globe-pro.php:283 195 #: src/Services/Model/Pro/MetaRegions.php:134 196 #: src/Services/Model/Pro/MetaSearch.php:32 src/models/00-globe-pro.php:283 183 197 msgid "Top" 184 198 msgstr "" 185 199 186 200 #: src/Features/DotLabel/DotLabelProMeta.php:97 187 #: src/Services/Model/Base/MetaDotLabel.php:153 src/models/globe-pro.php:284 201 #: src/Services/Model/Base/MetaDotLabel.php:153 src/models/00-globe-pro.php:284 202 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:173 188 203 msgid "Right" 189 204 msgstr "" 190 205 191 206 #: src/Features/DotLabel/DotLabelProMeta.php:99 192 #: src/Services/Model/Base/MetaDotLabel.php:155 src/models/ globe-pro.php:286207 #: src/Services/Model/Base/MetaDotLabel.php:155 src/models/00-globe-pro.php:286 193 208 msgid "Dot Orientation" 194 209 msgstr "" … … 198 213 msgstr "" 199 214 200 #: src/Features/Meta/MetaCore.php:3 21215 #: src/Features/Meta/MetaCore.php:336 201 216 #: src/Services/Model/Base/MetaDotLabel.php:44 202 217 #: src/Services/Model/Base/MetaPoint.php:44 … … 204 219 msgstr "" 205 220 206 #: src/Features/Meta/MetaCore.php:3 22221 #: src/Features/Meta/MetaCore.php:337 207 222 msgid "Actions" 208 223 msgstr "" 209 224 210 #: src/Features/Point/PointProMeta.php:49 211 #: src/Services/Model/Base/MetaPoint.php:113 src/models/globe-pro.php:196 212 msgid "Radius" 225 #: src/Features/Meta/MetaCore.php:347 226 msgid "(no title)" 227 msgstr "" 228 229 #: src/Features/Point/PointProMeta.php:51 230 #: src/Services/Model/Pro/MetaLayers.php:53 231 #: src/Services/Model/Pro/MetaPoint.php:16 232 #: src/Services/Model/Pro/MetaRegions.php:30 src/models/03-globe-line.php:156 233 msgid "Type" 234 msgstr "" 235 236 #: src/Features/Point/PointProMeta.php:53 237 #: src/Services/Model/Pro/MetaPoint.php:19 238 msgid "Cylinder (default)" 239 msgstr "" 240 241 #: src/Features/Point/PointProMeta.php:54 242 #: src/Services/Model/Pro/MetaPoint.php:20 243 msgid "Pin" 244 msgstr "" 245 246 #: src/Features/Point/PointProMeta.php:55 247 #: src/Services/Model/Pro/MetaPoint.php:21 src/models/02-globe-point.php:55 248 #: src/models/02-globe-point.php:57 249 msgid "Marker" 250 msgstr "" 251 252 #: src/Features/Point/PointProMeta.php:56 253 #: src/Services/Model/Pro/MetaPoint.php:22 254 #: src/Services/Model/Pro/MetaPoint.php:31 255 msgid "Image" 256 msgstr "" 257 258 #: src/Features/Point/PointProMeta.php:57 259 #: src/Services/Model/Pro/MetaPoint.php:23 260 msgid "Flag" 261 msgstr "" 262 263 #: src/Features/Point/PointProMeta.php:65 264 msgid "Preview Image" 265 msgstr "" 266 267 #: src/Features/Point/PointProMeta.php:70 268 #: src/Services/Model/Pro/MetaPoint.php:45 269 msgid "Image Orientation" 270 msgstr "" 271 272 #: src/Features/Point/PointProMeta.php:72 273 #: src/Services/Model/Pro/MetaPoint.php:47 274 msgid "Horizontal" 275 msgstr "" 276 277 #: src/Features/Point/PointProMeta.php:73 278 #: src/Services/Model/Pro/MetaPoint.php:48 279 msgid "Vertical" 280 msgstr "" 281 282 #: src/Features/Point/PointProMeta.php:80 283 #: src/Services/Model/Pro/MetaPoint.php:38 284 msgid "Animate" 285 msgstr "" 286 287 #: src/Features/Point/PointProMeta.php:81 288 msgid "Animate the marker." 289 msgstr "" 290 291 #: src/Features/Point/PointProMeta.php:89 292 msgid "Size / Radius" 293 msgstr "" 294 295 #: src/Features/Point/PointProMeta.php:117 296 msgid "Help" 297 msgstr "" 298 299 #: src/Features/Point/PointProMeta.php:122 300 msgid "Use the custom options to define the point type, size, color, and animation." 213 301 msgstr "" 214 302 … … 217 305 msgstr "" 218 306 219 #: src/Plugin/Assets.php: 225307 #: src/Plugin/Assets.php:181 220 308 msgid "New center saved" 221 309 msgstr "" 222 310 223 #: src/Plugin/Assets.php: 226311 #: src/Plugin/Assets.php:182 224 312 msgid "Set initial center" 225 313 msgstr "" 226 314 227 #: src/Plugin/Freemius.php:1 06315 #: src/Plugin/Freemius.php:111 228 316 msgid "Error" 229 317 msgstr "" 230 318 231 #: src/Plugin/Freemius.php:1 07319 #: src/Plugin/Freemius.php:112 232 320 msgid "Your license does not have permission to use this premium feature." 233 321 msgstr "" 234 322 235 #: src/Plugin/Freemius.php:1 09323 #: src/Plugin/Freemius.php:114 236 324 msgid "Return Home" 237 325 msgstr "" 238 326 239 #: src/Plugin/Freemius.php:1 18 src/Plugin/Freemius.php:132327 #: src/Plugin/Freemius.php:123 src/Plugin/Freemius.php:137 240 328 msgid "Interactive Globes - Error" 241 329 msgstr "" 242 330 243 #: src/Plugin/Freemius.php:16 3331 #: src/Plugin/Freemius.php:168 244 332 msgid "" 245 333 "You are on the Interactive Globes Free plan. To activate your license, set " … … 250 338 msgstr "" 251 339 252 #: src/Services/Model/Base/Features.php:12 src/models/ globe-pro.php:30340 #: src/Services/Model/Base/Features.php:12 src/models/00-globe-pro.php:30 253 341 msgid "Download Globe Export File" 254 342 msgstr "" 255 343 256 #: src/Services/Model/Base/Features.php:21 src/models/ globe-pro.php:39344 #: src/Services/Model/Base/Features.php:21 src/models/00-globe-pro.php:39 257 345 msgid "Shortcode" 346 msgstr "" 347 348 #: src/Services/Model/Base/Features.php:29 src/models/00-globe-pro.php:26 349 msgid "Clone Globe" 350 msgstr "" 351 352 #: src/Services/Model/Base/Features.php:30 src/models/00-globe-pro.php:27 353 msgid "Create a copy of this globe" 258 354 msgstr "" 259 355 … … 267 363 msgstr "" 268 364 269 #: src/Services/Model/Base/Labels.php:21 src/models/ globe-dotlabel.php:64270 #: src/models/ globe-line.php:73 src/models/globe-point.php:58271 #: src/models/ globe-region.php:131365 #: src/Services/Model/Base/Labels.php:21 src/models/01-globe-dotlabel.php:64 366 #: src/models/02-globe-point.php:58 src/models/03-globe-line.php:73 367 #: src/models/04-globe-region.php:138 src/models/06-globe-html.php:59 272 368 msgid "Create New" 273 369 msgstr "" … … 365 461 msgstr "" 366 462 367 #: src/Services/Model/Base/Labels.php:48 src/models/ globe-dotlabel.php:91368 #: src/models/ globe-line.php:100 src/models/globe-point.php:85369 #: src/models/ globe-region.php:158463 #: src/Services/Model/Base/Labels.php:48 src/models/01-globe-dotlabel.php:91 464 #: src/models/02-globe-point.php:85 src/models/03-globe-line.php:100 465 #: src/models/04-globe-region.php:165 src/models/06-globe-html.php:86 370 466 msgid "Custom field updated" 371 467 msgstr "" 372 468 373 #: src/Services/Model/Base/Labels.php:49 src/models/ globe-dotlabel.php:92374 #: src/models/ globe-line.php:101 src/models/globe-point.php:86375 #: src/models/ globe-region.php:159469 #: src/Services/Model/Base/Labels.php:49 src/models/01-globe-dotlabel.php:92 470 #: src/models/02-globe-point.php:86 src/models/03-globe-line.php:101 471 #: src/models/04-globe-region.php:166 src/models/06-globe-html.php:87 376 472 msgid "Custom field deleted" 377 473 msgstr "" … … 479 575 #: src/Services/Model/Base/Meta.php:119 480 576 #: src/Services/Model/Pro/MetaLines.php:100 577 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/sorter/sorter.php:21 481 578 msgid "Enabled" 482 579 msgstr "" 483 580 484 581 #: src/Services/Model/Base/Meta.php:124 485 #: src/Services/Model/Pro/PluginSettings.php:104 src/models/globe-pro.php:128 582 #: src/Services/Model/Pro/PluginSettings.php:104 583 #: src/models/00-globe-pro.php:128 584 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:278 486 585 msgid "Color" 487 586 msgstr "" … … 535 634 #: src/Services/Model/Base/Meta.php:166 536 635 #: src/Services/Model/Base/MetaDotLabel.php:63 537 #: src/Services/Model/Base/MetaPoint.php:63 src/models/globe-dotlabel.php:164 538 #: src/models/globe-line.php:211 src/models/globe-point.php:159 636 #: src/Services/Model/Base/MetaPoint.php:63 637 #: src/models/01-globe-dotlabel.php:164 src/models/02-globe-point.php:159 638 #: src/models/03-globe-line.php:211 src/models/06-globe-html.php:160 639 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/map/map.php:24 539 640 msgid "Latitude" 540 641 msgstr "" … … 542 643 #: src/Services/Model/Base/Meta.php:173 543 644 #: src/Services/Model/Base/MetaDotLabel.php:69 544 #: src/Services/Model/Base/MetaPoint.php:69 src/models/globe-dotlabel.php:171 545 #: src/models/globe-line.php:216 src/models/globe-point.php:166 645 #: src/Services/Model/Base/MetaPoint.php:69 646 #: src/models/01-globe-dotlabel.php:171 src/models/02-globe-point.php:166 647 #: src/models/03-globe-line.php:216 src/models/06-globe-html.php:167 648 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/map/map.php:25 546 649 msgid "Longitude" 547 650 msgstr "" … … 615 718 msgstr "" 616 719 617 #: src/Services/Model/Base/MetaDotLabel.php:21 src/models/globe-dotlabel.php:60618 #: src/models/ globe-dotlabel.php:62 src/models/globe-dotlabel.php:63619 #: src/models/ globe-dotlabel.php:74720 #: src/Services/Model/Base/MetaDotLabel.php:21 721 #: src/models/01-globe-dotlabel.php:60 src/models/01-globe-dotlabel.php:62 722 #: src/models/01-globe-dotlabel.php:63 src/models/01-globe-dotlabel.php:74 620 723 msgid "Dot Labels" 621 724 msgstr "" … … 633 736 634 737 #: src/Services/Model/Base/MetaDotLabel.php:51 635 #: src/Services/Model/Base/MetaPoint.php:51 src/models/globe-dotlabel.php:142 636 #: src/models/globe-point.php:137 738 #: src/Services/Model/Base/MetaPoint.php:51 739 #: src/models/01-globe-dotlabel.php:142 src/models/02-globe-point.php:137 740 #: src/models/06-globe-html.php:138 637 741 msgid "Coordinates" 638 742 msgstr "" 639 743 640 744 #: src/Services/Model/Base/MetaDotLabel.php:78 641 #: src/Services/Model/Base/MetaPoint.php:78 src/models/globe-dotlabel.php:185 642 #: src/models/globe-point.php:180 src/models/globe-region.php:225 745 #: src/Services/Model/Base/MetaPoint.php:78 746 #: src/models/01-globe-dotlabel.php:185 src/models/02-globe-point.php:180 747 #: src/models/04-globe-region.php:232 643 748 msgid "Tooltip Content" 644 749 msgstr "" 645 750 646 751 #: src/Services/Model/Base/MetaDotLabel.php:82 647 #: src/Services/Model/Base/MetaPoint.php:82 src/models/globe-dotlabel.php:189 648 #: src/models/globe-point.php:184 src/models/globe-region.php:229 752 #: src/Services/Model/Base/MetaPoint.php:82 753 #: src/models/01-globe-dotlabel.php:189 src/models/02-globe-point.php:184 754 #: src/models/04-globe-region.php:236 src/models/06-globe-html.php:180 649 755 msgid "Action Content" 650 756 msgstr "" 651 757 652 758 #: src/Services/Model/Base/MetaDotLabel.php:83 653 #: src/Services/Model/Base/MetaPoint.php:83 src/models/globe-dotlabel.php:190 654 #: src/models/globe-point.php:185 src/models/globe-region.php:230 759 #: src/Services/Model/Base/MetaPoint.php:83 760 #: src/models/01-globe-dotlabel.php:190 src/models/02-globe-point.php:185 761 #: src/models/04-globe-region.php:237 src/models/06-globe-html.php:181 655 762 msgid "URL or content to trigger when marker is clicked." 656 763 msgstr "" 657 764 658 765 #: src/Services/Model/Base/MetaDotLabel.php:83 659 #: src/Services/Model/Base/MetaPoint.php:83 src/models/ globe-region.php:230766 #: src/Services/Model/Base/MetaPoint.php:83 src/models/04-globe-region.php:237 660 767 msgid "Don't forget to select a click action below." 661 768 msgstr "" … … 663 770 #: src/Services/Model/Base/MetaDotLabel.php:99 664 771 #: src/Services/Model/Base/MetaPoint.php:99 772 #: src/Services/Model/Pro/MetaHTML.php:37 665 773 #: src/Services/Model/Pro/MetaRegions.php:65 666 774 msgid "Default values" … … 679 787 msgstr "" 680 788 681 #: src/Services/Model/Base/MetaPoint.php:21 src/models/globe-point.php:54 682 #: src/models/globe-point.php:56 src/models/globe-point.php:57 683 #: src/models/globe-point.php:68 684 msgid "Points" 789 #: src/Services/Model/Base/MetaPoint.php:21 src/models/02-globe-point.php:54 790 msgid "3D Markers" 685 791 msgstr "" 686 792 687 793 #: src/Services/Model/Base/MetaPoint.php:27 688 794 msgid "" 689 "Add <strong> cylinder point markers</strong> to the globe. <br>Click \"Add"690 " NewPoint\" below to start adding points."795 "Add <strong>3D point markers</strong> to the globe. <br>Click \"Add New " 796 "Point\" below to start adding points." 691 797 msgstr "" 692 798 … … 696 802 msgstr "" 697 803 804 #: src/Services/Model/Base/MetaPoint.php:119 src/models/00-globe-pro.php:196 805 msgid "Radius / Size" 806 msgstr "" 807 698 808 #: src/Services/Model/Base/Settings.php:16 809 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/border/border.php:59 810 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:199 811 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:213 699 812 msgid "None" 700 813 msgstr "" … … 725 838 726 839 #: src/Services/Model/Pro/MetaDotLabel.php:25 727 #: src/Services/Model/Pro/MetaPoint.php: 15728 #: src/Services/Model/Pro/MetaRegions.php: 95840 #: src/Services/Model/Pro/MetaPoint.php:66 841 #: src/Services/Model/Pro/MetaRegions.php:107 729 842 #: src/Services/Model/Pro/MetaTooltip.php:98 730 843 msgid "Tooltip Template" … … 732 845 733 846 #: src/Services/Model/Pro/MetaDotLabel.php:27 734 #: src/Services/Model/Pro/MetaPoint.php: 17847 #: src/Services/Model/Pro/MetaPoint.php:68 735 848 msgid "" 736 849 "Override default tooltip template. You can use placeholders with curly " … … 739 852 msgstr "" 740 853 854 #: src/Services/Model/Pro/MetaHTML.php:18 src/models/06-globe-html.php:55 855 #: src/models/06-globe-html.php:69 856 msgid "HTML Markers" 857 msgstr "" 858 859 #: src/Services/Model/Pro/MetaHTML.php:24 860 msgid "Add HTML Markers to your globe." 861 msgstr "" 862 863 #: src/Services/Model/Pro/MetaHTML.php:32 864 msgid "Add New HTML Marker" 865 msgstr "" 866 867 #: src/Services/Model/Pro/MetaHTML.php:43 src/models/06-globe-html.php:206 868 msgid "HTML Marker Template" 869 msgstr "" 870 871 #: src/Services/Model/Pro/MetaHTML.php:44 src/models/06-globe-html.php:207 872 msgid "" 873 "Template for the HTML content. You can use HTML code and if necessary use " 874 "the <code>{title}</code> or <code>{content}</code> variable to insert the " 875 "content of the entry." 876 msgstr "" 877 741 878 #: src/Services/Model/Pro/MetaLayers.php:12 742 879 msgid "Data Layers & Filters" … … 766 903 767 904 #: src/Services/Model/Pro/MetaLayers.php:48 905 #: src/Services/Model/Pro/MetaRegions.php:119 768 906 #: src/Services/Model/Pro/PluginSettings.php:162 769 907 #. translators: field type = input type (textarea, rich text editor...) … … 771 909 msgstr "" 772 910 773 #: src/Services/Model/Pro/MetaLayers.php:53774 #: src/Services/Model/Pro/MetaRegions.php:30 src/models/globe-line.php:156775 msgid "Type"776 msgstr ""777 778 911 #: src/Services/Model/Pro/MetaLayers.php:57 779 912 msgid "Filter Menu" … … 793 926 794 927 #: src/Services/Model/Pro/MetaLayers.php:65 928 #: src/Services/Model/Pro/MetaRegions.php:132 795 929 #: src/Services/Model/Pro/MetaSearch.php:30 796 930 msgid "Position" … … 846 980 847 981 #: src/Services/Model/Pro/MetaLines.php:30 848 #: src/Services/Model/Pro/PluginSettings.php:75 src/models/ globe-pro.php:98982 #: src/Services/Model/Pro/PluginSettings.php:75 src/models/00-globe-pro.php:98 849 983 msgid "Defaults" 850 984 msgstr "" … … 854 988 msgstr "" 855 989 856 #: src/Services/Model/Pro/MetaLines.php:46 src/models/ globe-line.php:282990 #: src/Services/Model/Pro/MetaLines.php:46 src/models/03-globe-line.php:282 857 991 msgid "Line Dash" 858 992 msgstr "" 859 993 860 #: src/Services/Model/Pro/MetaLines.php:47 src/models/ globe-line.php:283994 #: src/Services/Model/Pro/MetaLines.php:47 src/models/03-globe-line.php:283 861 995 msgid "" 862 996 "The length of the dashed segments in the arc, in terms of relative line " … … 864 998 msgstr "" 865 999 866 #: src/Services/Model/Pro/MetaLines.php:58 src/models/ globe-line.php:2951000 #: src/Services/Model/Pro/MetaLines.php:58 src/models/03-globe-line.php:295 867 1001 msgid "Line Dash Gap" 868 1002 msgstr "" 869 1003 870 #: src/Services/Model/Pro/MetaLines.php:59 src/models/ globe-line.php:2961004 #: src/Services/Model/Pro/MetaLines.php:59 src/models/03-globe-line.php:296 871 1005 msgid "" 872 1006 "The length of the gap between dash segments, in terms of relative line " … … 874 1008 msgstr "" 875 1009 876 #: src/Services/Model/Pro/MetaLines.php:64 src/models/ globe-line.php:3021010 #: src/Services/Model/Pro/MetaLines.php:64 src/models/03-globe-line.php:302 877 1011 msgid "Line Width" 878 1012 msgstr "" 879 1013 880 #: src/Services/Model/Pro/MetaLines.php:65 src/models/ globe-line.php:3031014 #: src/Services/Model/Pro/MetaLines.php:65 src/models/03-globe-line.php:303 881 1015 msgid "The line’s diameter, in angular degrees" 882 1016 msgstr "" 883 1017 884 #: src/Services/Model/Pro/MetaLines.php:77 src/models/ globe-line.php:3161018 #: src/Services/Model/Pro/MetaLines.php:77 src/models/03-globe-line.php:316 885 1019 msgid "" 886 1020 "The arc’s maximum altitude, ocurring at the half-way distance between the " … … 888 1022 msgstr "" 889 1023 890 #: src/Services/Model/Pro/MetaLines.php:82 src/models/ globe-line.php:3281024 #: src/Services/Model/Pro/MetaLines.php:82 src/models/03-globe-line.php:328 891 1025 msgid "" 892 1026 "Time duration (in seconds) to animate the motion of dash positions from the " … … 896 1030 msgstr "" 897 1031 898 #: src/Services/Model/Pro/MetaLines.php:88 src/models/ globe-line.php:3271032 #: src/Services/Model/Pro/MetaLines.php:88 src/models/03-globe-line.php:327 899 1033 msgid "Animation speed" 900 1034 msgstr "" … … 950 1084 msgstr "" 951 1085 1086 #: src/Services/Model/Pro/MetaPoint.php:17 1087 msgid "Choose the type of 3D marker." 1088 msgstr "" 1089 1090 #: src/Services/Model/Pro/MetaPoint.php:32 1091 msgid "Image to use for this marker type." 1092 msgstr "" 1093 1094 #: src/Services/Model/Pro/MetaPoint.php:39 1095 msgid "Animate the marker. " 1096 msgstr "" 1097 952 1098 #: src/Services/Model/Pro/MetaRegions.php:20 953 1099 msgid "Regions Layer" … … 959 1105 960 1106 #: src/Services/Model/Pro/MetaRegions.php:32 1107 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/sorter/sorter.php:22 961 1108 msgid "Disabled" 962 1109 msgstr "" … … 1012 1159 msgstr "" 1013 1160 1014 #: src/Services/Model/Pro/MetaRegions.php:97 1161 #: src/Services/Model/Pro/MetaRegions.php:93 1162 msgid "Borders Color" 1163 msgstr "" 1164 1165 #: src/Services/Model/Pro/MetaRegions.php:100 1166 msgid "Only Active" 1167 msgstr "" 1168 1169 #: src/Services/Model/Pro/MetaRegions.php:101 1170 msgid "Only display regions that were added with interactivity." 1171 msgstr "" 1172 1173 #: src/Services/Model/Pro/MetaRegions.php:109 1015 1174 msgid "" 1016 1175 "Override default tooltip template. You can use placeholders with curly " … … 1019 1178 msgstr "" 1020 1179 1180 #: src/Services/Model/Pro/MetaRegions.php:114 1181 msgid "Region Count" 1182 msgstr "" 1183 1184 #: src/Services/Model/Pro/MetaRegions.php:121 1185 msgid "Display the number of regions in the globe." 1186 msgstr "" 1187 1188 #: src/Services/Model/Pro/MetaRegions.php:125 1189 msgid "Template" 1190 msgstr "" 1191 1192 #: src/Services/Model/Pro/MetaRegions.php:127 1193 msgid "" 1194 "Template to display the number of regions. Available " 1195 "placeholders:<br><code>{regionCount}</code> - Number of active " 1196 "regions<br><code>{totalRegions}</code> - Total number of regions in the " 1197 "source file<br><code>{regionPercentage}</code> - Percentage of active " 1198 "regions" 1199 msgstr "" 1200 1021 1201 #: src/Services/Model/Pro/MetaRotate.php:14 1022 #: src/Services/Model/Pro/MetaRotate.php:20 src/models/ globe-pro.php:2951023 #: src/models/ globe-pro.php:3011202 #: src/Services/Model/Pro/MetaRotate.php:20 src/models/00-globe-pro.php:295 1203 #: src/models/00-globe-pro.php:301 1024 1204 #. translators: legend refers to a caption or visual element explaining colours 1025 1205 #. on map … … 1028 1208 1029 1209 #: src/Services/Model/Pro/MetaRotate.php:15 1030 #: src/Services/Model/Pro/MetaRotate.php:21 src/models/ globe-pro.php:2961031 #: src/models/ globe-pro.php:3021210 #: src/Services/Model/Pro/MetaRotate.php:21 src/models/00-globe-pro.php:296 1211 #: src/models/00-globe-pro.php:302 1032 1212 msgid "Rotate animation" 1033 1213 msgstr "" 1034 1214 1035 #: src/Services/Model/Pro/MetaRotate.php:28 src/models/ globe-pro.php:3091215 #: src/Services/Model/Pro/MetaRotate.php:28 src/models/00-globe-pro.php:309 1036 1216 msgid "Speed" 1037 1217 msgstr "" … … 1069 1249 1070 1250 #: src/Services/Model/Pro/MetaSearch.php:54 1251 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/admin-options.class.php:513 1252 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/icon/icon.php:57 1253 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/map/map.php:23 1071 1254 msgid "Search..." 1072 1255 msgstr "" … … 1122 1305 1123 1306 #: src/Services/Model/Pro/MetaTooltip.php:34 1307 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:96 1124 1308 msgid "Font Family" 1125 1309 msgstr "" … … 1167 1351 msgstr "" 1168 1352 1169 #: src/Services/Model/Pro/PluginSettings.php:13 src/models/ globe-pro.php:531353 #: src/Services/Model/Pro/PluginSettings.php:13 src/models/00-globe-pro.php:53 1170 1354 msgid "Plugin Settings" 1171 1355 msgstr "" 1172 1356 1173 #: src/Services/Model/Pro/PluginSettings.php:15 src/models/ globe-pro.php:551357 #: src/Services/Model/Pro/PluginSettings.php:15 src/models/00-globe-pro.php:55 1174 1358 msgid "Settings" 1175 1359 msgstr "" 1176 1360 1177 #: src/Services/Model/Pro/PluginSettings.php:21 src/models/ globe-pro.php:581361 #: src/Services/Model/Pro/PluginSettings.php:21 src/models/00-globe-pro.php:58 1178 1362 msgid "Editing" 1179 1363 msgstr "" 1180 1364 1181 #: src/Services/Model/Pro/PluginSettings.php:22 src/models/ globe-pro.php:591365 #: src/Services/Model/Pro/PluginSettings.php:22 src/models/00-globe-pro.php:59 1182 1366 msgid "Edit screen settings" 1183 1367 msgstr "" 1184 1368 1185 #: src/Services/Model/Pro/PluginSettings.php:27 src/models/ globe-pro.php:641369 #: src/Services/Model/Pro/PluginSettings.php:27 src/models/00-globe-pro.php:64 1186 1370 msgid "Use OpenStreeMap" 1187 1371 msgstr "" 1188 1372 1189 #: src/Services/Model/Pro/PluginSettings.php:28 src/models/ globe-pro.php:651373 #: src/Services/Model/Pro/PluginSettings.php:28 src/models/00-globe-pro.php:65 1190 1374 msgid "" 1191 1375 "If you want to select the coordinates using a visual map with search " … … 1198 1382 msgstr "" 1199 1383 1200 #: src/Services/Model/Pro/PluginSettings.php:34 src/models/ globe-pro.php:711384 #: src/Services/Model/Pro/PluginSettings.php:34 src/models/00-globe-pro.php:71 1201 1385 #. translators: field type = input type (textarea, rich text editor...) 1202 1386 msgid "Tooltip field type" … … 1204 1388 1205 1389 #: src/Services/Model/Pro/PluginSettings.php:35 1206 #: src/Services/Model/Pro/PluginSettings.php:49 src/models/ globe-pro.php:721207 #: src/models/ globe-pro.php:861390 #: src/Services/Model/Pro/PluginSettings.php:49 src/models/00-globe-pro.php:72 1391 #: src/models/00-globe-pro.php:86 1208 1392 msgid "Type of field to use to edit the tooltip content." 1209 1393 msgstr "" … … 1211 1395 #: src/Services/Model/Pro/PluginSettings.php:38 1212 1396 #: src/Services/Model/Pro/PluginSettings.php:52 1213 #: src/Services/Model/Pro/PluginSettings.php:66 src/models/ globe-pro.php:751214 #: src/models/ globe-pro.php:891397 #: src/Services/Model/Pro/PluginSettings.php:66 src/models/00-globe-pro.php:75 1398 #: src/models/00-globe-pro.php:89 1215 1399 msgid "Textarea" 1216 1400 msgstr "" … … 1218 1402 #: src/Services/Model/Pro/PluginSettings.php:40 1219 1403 #: src/Services/Model/Pro/PluginSettings.php:54 1220 #: src/Services/Model/Pro/PluginSettings.php:68 src/models/ globe-pro.php:771221 #: src/models/ globe-pro.php:911404 #: src/Services/Model/Pro/PluginSettings.php:68 src/models/00-globe-pro.php:77 1405 #: src/models/00-globe-pro.php:91 1222 1406 #. translators: equivalent to classic editor in a way 1223 1407 msgid "WP Rich Text Editor" … … 1226 1410 #: src/Services/Model/Pro/PluginSettings.php:41 1227 1411 #: src/Services/Model/Pro/PluginSettings.php:55 1228 #: src/Services/Model/Pro/PluginSettings.php:69 src/models/ globe-pro.php:781229 #: src/models/ globe-pro.php:921412 #: src/Services/Model/Pro/PluginSettings.php:69 src/models/00-globe-pro.php:78 1413 #: src/models/00-globe-pro.php:92 1230 1414 msgid "Text Input" 1231 1415 msgstr "" 1232 1416 1233 #: src/Services/Model/Pro/PluginSettings.php:48 src/models/ globe-pro.php:851417 #: src/Services/Model/Pro/PluginSettings.php:48 src/models/00-globe-pro.php:85 1234 1418 #. translators: field type = input type (textarea, rich text editor...) 1235 1419 msgid "Action Content field type" … … 1245 1429 msgstr "" 1246 1430 1247 #: src/Services/Model/Pro/PluginSettings.php:81 src/models/ globe-pro.php:1041431 #: src/Services/Model/Pro/PluginSettings.php:81 src/models/00-globe-pro.php:104 1248 1432 msgid "Default Active Colour" 1249 1433 msgstr "" 1250 1434 1251 #: src/Services/Model/Pro/PluginSettings.php:82 src/models/ globe-pro.php:1051435 #: src/Services/Model/Pro/PluginSettings.php:82 src/models/00-globe-pro.php:105 1252 1436 msgid "" 1253 1437 "Set the default colour for the active colour field, when you create new " … … 1255 1439 msgstr "" 1256 1440 1257 #: src/Services/Model/Pro/PluginSettings.php:88 src/models/ globe-pro.php:1111441 #: src/Services/Model/Pro/PluginSettings.php:88 src/models/00-globe-pro.php:111 1258 1442 msgid "Default Hover Colour" 1259 1443 msgstr "" 1260 1444 1261 #: src/Services/Model/Pro/PluginSettings.php:89 src/models/ globe-pro.php:1121445 #: src/Services/Model/Pro/PluginSettings.php:89 src/models/00-globe-pro.php:112 1262 1446 msgid "Set the default colour for the hover colour field, when you create new maps." 1263 1447 msgstr "" 1264 1448 1265 #: src/Services/Model/Pro/PluginSettings.php:94 src/models/ globe-pro.php:1181449 #: src/Services/Model/Pro/PluginSettings.php:94 src/models/00-globe-pro.php:118 1266 1450 msgid "Visuals" 1267 1451 msgstr "" 1268 1452 1269 #: src/Services/Model/Pro/PluginSettings.php:99 src/models/ globe-pro.php:1231453 #: src/Services/Model/Pro/PluginSettings.php:99 src/models/00-globe-pro.php:123 1270 1454 msgid "Filter Menu Styles" 1271 1455 msgstr "" 1272 1456 1273 #: src/Services/Model/Pro/PluginSettings.php:100 src/models/globe-pro.php:124 1457 #: src/Services/Model/Pro/PluginSettings.php:100 1458 #: src/models/00-globe-pro.php:124 1274 1459 msgid "Customize the styles of the filter menu." 1275 1460 msgstr "" … … 1279 1464 msgstr "" 1280 1465 1281 #: src/Services/Model/Pro/PluginSettings.php:128 src/models/globe-pro.php:143 1466 #: src/Services/Model/Pro/PluginSettings.php:128 1467 #: src/models/00-globe-pro.php:143 1282 1468 msgid "Border Radius" 1283 1469 msgstr "" 1284 1470 1285 #: src/Services/Model/Pro/PluginSettings.php:137 src/models/globe-pro.php:152 1471 #: src/Services/Model/Pro/PluginSettings.php:137 1472 #: src/models/00-globe-pro.php:152 1286 1473 msgid "Capabilities" 1287 1474 msgstr "" 1288 1475 1289 #: src/Services/Model/Pro/PluginSettings.php:138 src/models/globe-pro.php:153 1476 #: src/Services/Model/Pro/PluginSettings.php:138 1477 #: src/models/00-globe-pro.php:153 1290 1478 msgid "Add custom styles to the pages loading the layouts." 1291 1479 msgstr "" 1292 1480 1293 #: src/Services/Model/Pro/PluginSettings.php:143 src/models/globe-pro.php:158 1481 #: src/Services/Model/Pro/PluginSettings.php:143 1482 #: src/models/00-globe-pro.php:158 1294 1483 msgid "Capability Type" 1295 1484 msgstr "" 1296 1485 1297 #: src/Services/Model/Pro/PluginSettings.php:144 src/models/globe-pro.php:159 1486 #: src/Services/Model/Pro/PluginSettings.php:144 1487 #: src/models/00-globe-pro.php:159 1298 1488 msgid "" 1299 1489 "Refer to the <code>capability_type</code> argument from the " … … 1333 1523 msgstr "" 1334 1524 1335 #: src/models/globe-dotlabel.php:19 1525 #: src/models/00-globe-pro.php:138 1526 msgid "Active Color" 1527 msgstr "" 1528 1529 #: src/models/00-globe-pro.php:172 1530 msgid "Use default" 1531 msgstr "" 1532 1533 #: src/models/00-globe-pro.php:180 src/models/00-globe-pro.php:226 1534 msgid "Use defaults" 1535 msgstr "" 1536 1537 #: src/models/00-globe-pro.php:181 src/models/00-globe-pro.php:227 1538 msgid "Use default colors and actions." 1539 msgstr "" 1540 1541 #: src/models/01-globe-dotlabel.php:19 1336 1542 msgid "Clone Dot Label" 1337 1543 msgstr "" 1338 1544 1339 #: src/models/ globe-dotlabel.php:201545 #: src/models/01-globe-dotlabel.php:20 1340 1546 msgid "Create a copy of this dot label" 1341 1547 msgstr "" 1342 1548 1343 #: src/models/ globe-dotlabel.php:231549 #: src/models/01-globe-dotlabel.php:23 1344 1550 msgid "Download Dot Labels Export File" 1345 1551 msgstr "" 1346 1552 1347 #: src/models/globe-dotlabel.php:32 src/models/globe-line.php:41 1348 #: src/models/globe-point.php:28 src/models/globe-region.php:99 1553 #: src/models/01-globe-dotlabel.php:32 src/models/02-globe-point.php:28 1554 #: src/models/03-globe-line.php:41 src/models/04-globe-region.php:106 1555 #: src/models/06-globe-html.php:29 1349 1556 msgid "Parent Globe" 1350 1557 msgstr "" 1351 1558 1352 #: src/models/ globe-dotlabel.php:611559 #: src/models/01-globe-dotlabel.php:61 1353 1560 msgid "Dot Label" 1354 1561 msgstr "" 1355 1562 1356 #: src/models/ globe-dotlabel.php:651563 #: src/models/01-globe-dotlabel.php:65 1357 1564 msgid "Create New Dot Label" 1358 1565 msgstr "" 1359 1566 1360 #: src/models/globe-dotlabel.php:66 src/models/globe-line.php:75 1361 #: src/models/globe-point.php:60 src/models/globe-region.php:133 1567 #: src/models/01-globe-dotlabel.php:66 src/models/02-globe-point.php:60 1568 #: src/models/03-globe-line.php:75 src/models/04-globe-region.php:140 1569 #: src/models/06-globe-html.php:61 1362 1570 msgid "Edit" 1363 1571 msgstr "" 1364 1572 1365 #: src/models/ globe-dotlabel.php:671573 #: src/models/01-globe-dotlabel.php:67 1366 1574 msgid "New Dot Label" 1367 1575 msgstr "" 1368 1576 1369 #: src/models/ globe-dotlabel.php:681577 #: src/models/01-globe-dotlabel.php:68 1370 1578 msgid "View Dot Label" 1371 1579 msgstr "" 1372 1580 1373 #: src/models/ globe-dotlabel.php:691581 #: src/models/01-globe-dotlabel.php:69 1374 1582 msgid "View Dot Labels" 1375 1583 msgstr "" 1376 1584 1377 #: src/models/ globe-dotlabel.php:701585 #: src/models/01-globe-dotlabel.php:70 1378 1586 msgid "Search Dot Labels" 1379 1587 msgstr "" 1380 1588 1381 #: src/models/ globe-dotlabel.php:711589 #: src/models/01-globe-dotlabel.php:71 1382 1590 msgid "No Dot Labels found." 1383 1591 msgstr "" 1384 1592 1385 #: src/models/ globe-dotlabel.php:721593 #: src/models/01-globe-dotlabel.php:72 1386 1594 msgid "No Dot Labels found in Trash." 1387 1595 msgstr "" 1388 1596 1389 #: src/models/globe-dotlabel.php:73 src/models/globe-line.php:82 1390 #: src/models/globe-point.php:67 src/models/globe-region.php:140 1597 #: src/models/01-globe-dotlabel.php:73 src/models/02-globe-point.php:67 1598 #: src/models/03-globe-line.php:82 src/models/04-globe-region.php:147 1599 #: src/models/06-globe-html.php:68 1391 1600 msgid "Parent Globe:" 1392 1601 msgstr "" 1393 1602 1394 #: src/models/ globe-dotlabel.php:751603 #: src/models/01-globe-dotlabel.php:75 1395 1604 msgid "Dot Label Archives" 1396 1605 msgstr "" 1397 1606 1398 #: src/models/ globe-dotlabel.php:761607 #: src/models/01-globe-dotlabel.php:76 1399 1608 msgid "Dot Label Attributes" 1400 1609 msgstr "" 1401 1610 1402 #: src/models/ globe-dotlabel.php:771611 #: src/models/01-globe-dotlabel.php:77 1403 1612 msgid "Insert into Dot Label" 1404 1613 msgstr "" 1405 1614 1406 #: src/models/ globe-dotlabel.php:781615 #: src/models/01-globe-dotlabel.php:78 1407 1616 msgid "Uploaded to this Dot Label" 1408 1617 msgstr "" 1409 1618 1410 #: src/models/ globe-dotlabel.php:791619 #: src/models/01-globe-dotlabel.php:79 1411 1620 msgid "Filter Dot Label list" 1412 1621 msgstr "" 1413 1622 1414 #: src/models/ globe-dotlabel.php:801623 #: src/models/01-globe-dotlabel.php:80 1415 1624 msgid "Dot Label list navigation" 1416 1625 msgstr "" 1417 1626 1418 #: src/models/ globe-dotlabel.php:811627 #: src/models/01-globe-dotlabel.php:81 1419 1628 msgid "Dot Label list" 1420 1629 msgstr "" 1421 1630 1422 #: src/models/ globe-dotlabel.php:821631 #: src/models/01-globe-dotlabel.php:82 1423 1632 msgid "Dot Label Cover Image" 1424 1633 msgstr "" 1425 1634 1426 #: src/models/ globe-dotlabel.php:831635 #: src/models/01-globe-dotlabel.php:83 1427 1636 msgid "Set Dot Label Cover Image" 1428 1637 msgstr "" 1429 1638 1430 #: src/models/ globe-dotlabel.php:841639 #: src/models/01-globe-dotlabel.php:84 1431 1640 msgid "Remove Dot Label Cover" 1432 1641 msgstr "" 1433 1642 1434 #: src/models/ globe-dotlabel.php:851643 #: src/models/01-globe-dotlabel.php:85 1435 1644 msgid "Use as Dot Label Cover" 1436 1645 msgstr "" 1437 1646 1438 #: src/models/ globe-dotlabel.php:891647 #: src/models/01-globe-dotlabel.php:89 1439 1648 msgid "" 1440 1649 "Dot Label information updated. <a href=\"{permalink}\" " … … 1442 1651 msgstr "" 1443 1652 1444 #: src/models/ globe-dotlabel.php:901653 #: src/models/01-globe-dotlabel.php:90 1445 1654 msgid "Dot Label info updated" 1446 1655 msgstr "" 1447 1656 1448 #: src/models/ globe-dotlabel.php:931657 #: src/models/01-globe-dotlabel.php:93 1449 1658 msgid "Dot Label content restored from revision" 1450 1659 msgstr "" 1451 1660 1452 #: src/models/ globe-dotlabel.php:941661 #: src/models/01-globe-dotlabel.php:94 1453 1662 msgid "Dot Label Published" 1454 1663 msgstr "" 1455 1664 1456 #: src/models/ globe-dotlabel.php:951665 #: src/models/01-globe-dotlabel.php:95 1457 1666 msgid "Dot Label information saved." 1458 1667 msgstr "" 1459 1668 1460 #: src/models/ globe-dotlabel.php:961669 #: src/models/01-globe-dotlabel.php:96 1461 1670 msgid "Dot Label submitted. <a href=\"{preview_url}\" target=\"_blank\">Preview</a>" 1462 1671 msgstr "" 1463 1672 1464 #: src/models/ globe-dotlabel.php:971673 #: src/models/01-globe-dotlabel.php:97 1465 1674 msgid "" 1466 1675 "Dot Label scheduled for {date}. <a href=\"{preview_url}\" " … … 1468 1677 msgstr "" 1469 1678 1470 #: src/models/ globe-dotlabel.php:981679 #: src/models/01-globe-dotlabel.php:98 1471 1680 msgid "" 1472 1681 "Dot Label draft updated. <a href=\"{preview_url}\" " … … 1474 1683 msgstr "" 1475 1684 1476 #: src/models/ globe-dotlabel.php:1011685 #: src/models/01-globe-dotlabel.php:101 1477 1686 msgid "Dot Label updated. Yay!" 1478 1687 msgstr "" 1479 1688 1480 #: src/models/ globe-dotlabel.php:1021689 #: src/models/01-globe-dotlabel.php:102 1481 1690 msgid "%s Dot Label updated. Yay!" 1482 1691 msgstr "" 1483 1692 1484 #: src/models/ globe-dotlabel.php:1031693 #: src/models/01-globe-dotlabel.php:103 1485 1694 msgid "Dot Label not updated, somebody is editing it" 1486 1695 msgstr "" 1487 1696 1488 #: src/models/ globe-dotlabel.php:1041697 #: src/models/01-globe-dotlabel.php:104 1489 1698 msgid "%s Dot Label not updated, somebody is editing them" 1490 1699 msgstr "" 1491 1700 1492 #: src/models/ globe-dotlabel.php:1051701 #: src/models/01-globe-dotlabel.php:105 1493 1702 msgid "Dot Label permanetly deleted. Fahrenheit 451 team was here?" 1494 1703 msgstr "" 1495 1704 1496 #: src/models/ globe-dotlabel.php:1061705 #: src/models/01-globe-dotlabel.php:106 1497 1706 msgid "%s Dot Label permanently deleted. Why? :(" 1498 1707 msgstr "" 1499 1708 1500 #: src/models/ globe-dotlabel.php:1071709 #: src/models/01-globe-dotlabel.php:107 1501 1710 msgid "Dot Label moved to the trash. I'm sad :(" 1502 1711 msgstr "" 1503 1712 1504 #: src/models/ globe-dotlabel.php:1081713 #: src/models/01-globe-dotlabel.php:108 1505 1714 msgid "%s Dot Label moved to the trash. Why? :(" 1506 1715 msgstr "" 1507 1716 1508 #: src/models/ globe-dotlabel.php:1091717 #: src/models/01-globe-dotlabel.php:109 1509 1718 msgid "Dot Label recovered from trash. Well done!" 1510 1719 msgstr "" 1511 1720 1512 #: src/models/ globe-dotlabel.php:1101721 #: src/models/01-globe-dotlabel.php:110 1513 1722 msgid "%s Dot Label saved from the enemies!" 1514 1723 msgstr "" 1515 1724 1516 #: src/models/ globe-dotlabel.php:1141725 #: src/models/01-globe-dotlabel.php:114 1517 1726 msgid "Enter Dot Label name here" 1518 1727 msgstr "" 1519 1728 1520 #: src/models/globe-dotlabel.php:134 src/models/globe-line.php:141 1521 #: src/models/globe-point.php:128 src/models/globe-region.php:199 1729 #: src/models/01-globe-dotlabel.php:134 src/models/02-globe-point.php:128 1730 #: src/models/03-globe-line.php:141 src/models/04-globe-region.php:206 1731 #: src/models/06-globe-html.php:129 1522 1732 msgid "Information" 1523 1733 msgstr "" 1524 1734 1525 #: src/models/ globe-dotlabel.php:147 src/models/globe-line.php:1941526 #: src/models/ globe-point.php:1421735 #: src/models/01-globe-dotlabel.php:147 src/models/02-globe-point.php:142 1736 #: src/models/03-globe-line.php:194 src/models/06-globe-html.php:143 1527 1737 msgid "zoom" 1528 1738 msgstr "" 1529 1739 1530 #: src/models/ globe-dotlabel.php:156 src/models/globe-line.php:2031531 #: src/models/ globe-point.php:1511740 #: src/models/01-globe-dotlabel.php:156 src/models/02-globe-point.php:151 1741 #: src/models/03-globe-line.php:203 src/models/06-globe-html.php:152 1532 1742 msgid "address" 1533 1743 msgstr "" 1534 1744 1535 #: src/models/ globe-dotlabel.php:1981745 #: src/models/01-globe-dotlabel.php:198 1536 1746 msgid "Globe - Dot Label relationship" 1537 1747 msgstr "" 1538 1748 1539 #: src/models/globe-dotlabel.php:206 src/models/globe-dotlabel.php:208 1540 #: src/models/globe-dotlabel.php:223 src/models/globe-line.php:345 1541 #: src/models/globe-line.php:347 src/models/globe-line.php:362 1542 #: src/models/globe-point.php:202 src/models/globe-point.php:204 1543 #: src/models/globe-point.php:219 src/models/globe-region.php:278 1544 #: src/models/globe-region.php:280 src/models/globe-region.php:295 1749 #: src/models/01-globe-dotlabel.php:206 src/models/01-globe-dotlabel.php:208 1750 #: src/models/01-globe-dotlabel.php:223 src/models/02-globe-point.php:202 1751 #: src/models/02-globe-point.php:204 src/models/02-globe-point.php:219 1752 #: src/models/03-globe-line.php:345 src/models/03-globe-line.php:347 1753 #: src/models/03-globe-line.php:362 src/models/04-globe-region.php:292 1754 #: src/models/04-globe-region.php:308 src/models/06-globe-html.php:225 1755 #: src/models/06-globe-html.php:227 src/models/06-globe-html.php:242 1545 1756 msgid "Associated Globe" 1546 1757 msgstr "" 1547 1758 1548 #: src/models/globe-dotlabel.php:213 src/models/globe-line.php:352 1549 #: src/models/globe-point.php:209 src/models/globe-region.php:285 1759 #: src/models/01-globe-dotlabel.php:213 src/models/02-globe-point.php:209 1760 #: src/models/03-globe-line.php:352 src/models/04-globe-region.php:298 1761 #: src/models/06-globe-html.php:232 1550 1762 msgid "Select a Parent Globe" 1551 1763 msgstr "" 1552 1764 1553 #: src/models/globe-line.php:28 1765 #: src/models/02-globe-point.php:18 1766 msgid "Clone Point" 1767 msgstr "" 1768 1769 #: src/models/02-globe-point.php:19 1770 msgid "Create a copy of this point" 1771 msgstr "" 1772 1773 #: src/models/02-globe-point.php:56 src/models/02-globe-point.php:68 1774 #: src/models/03-globe-line.php:225 src/models/06-globe-html.php:57 1775 #: src/models/06-globe-html.php:58 1776 msgid "Markers" 1777 msgstr "" 1778 1779 #: src/models/02-globe-point.php:59 1780 msgid "Create New Marker" 1781 msgstr "" 1782 1783 #: src/models/02-globe-point.php:61 1784 msgid "New Marker" 1785 msgstr "" 1786 1787 #: src/models/02-globe-point.php:62 1788 msgid "View Marker" 1789 msgstr "" 1790 1791 #: src/models/02-globe-point.php:63 1792 msgid "View Markers" 1793 msgstr "" 1794 1795 #: src/models/02-globe-point.php:64 1796 msgid "Search Markers" 1797 msgstr "" 1798 1799 #: src/models/02-globe-point.php:65 1800 msgid "No Markers found." 1801 msgstr "" 1802 1803 #: src/models/02-globe-point.php:66 1804 msgid "No Markers found in Trash." 1805 msgstr "" 1806 1807 #: src/models/02-globe-point.php:69 1808 msgid "Marker Archives" 1809 msgstr "" 1810 1811 #: src/models/02-globe-point.php:70 1812 msgid "Marker Attributes" 1813 msgstr "" 1814 1815 #: src/models/02-globe-point.php:71 1816 msgid "Insert into Marker" 1817 msgstr "" 1818 1819 #: src/models/02-globe-point.php:72 1820 msgid "Uploaded to this Marker" 1821 msgstr "" 1822 1823 #: src/models/02-globe-point.php:73 1824 msgid "Filter Marker list" 1825 msgstr "" 1826 1827 #: src/models/02-globe-point.php:74 1828 msgid "Marker list navigation" 1829 msgstr "" 1830 1831 #: src/models/02-globe-point.php:75 1832 msgid "Marker list" 1833 msgstr "" 1834 1835 #: src/models/02-globe-point.php:76 1836 msgid "Marker Cover Image" 1837 msgstr "" 1838 1839 #: src/models/02-globe-point.php:77 1840 msgid "Set Marker Cover Image" 1841 msgstr "" 1842 1843 #: src/models/02-globe-point.php:78 1844 msgid "Remove Marker Cover" 1845 msgstr "" 1846 1847 #: src/models/02-globe-point.php:79 1848 msgid "Use as Marker Cover" 1849 msgstr "" 1850 1851 #: src/models/02-globe-point.php:83 1852 msgid "" 1853 "Marker information updated. <a href=\"{permalink}\" target=\"_blank\">View " 1854 "Globe</a>" 1855 msgstr "" 1856 1857 #: src/models/02-globe-point.php:84 1858 msgid "Marker info updated" 1859 msgstr "" 1860 1861 #: src/models/02-globe-point.php:87 1862 msgid "Marker content restored from revision" 1863 msgstr "" 1864 1865 #: src/models/02-globe-point.php:88 1866 msgid "Marker Published" 1867 msgstr "" 1868 1869 #: src/models/02-globe-point.php:89 1870 msgid "Marker information saved." 1871 msgstr "" 1872 1873 #: src/models/02-globe-point.php:90 1874 msgid "Point submitted. <a href=\"{preview_url}\" target=\"_blank\">Preview</a>" 1875 msgstr "" 1876 1877 #: src/models/02-globe-point.php:91 1878 msgid "" 1879 "Point scheduled for {date}. <a href=\"{preview_url}\" " 1880 "target=\"_blank\">Preview</a>" 1881 msgstr "" 1882 1883 #: src/models/02-globe-point.php:92 1884 msgid "Point draft updated. <a href=\"{preview_url}\" target=\"_blank\">Preview</a>" 1885 msgstr "" 1886 1887 #: src/models/02-globe-point.php:95 1888 msgid "Marker updated. Yay!" 1889 msgstr "" 1890 1891 #: src/models/02-globe-point.php:96 1892 msgid "%s Marker updated. Yay!" 1893 msgstr "" 1894 1895 #: src/models/02-globe-point.php:97 1896 msgid "Marker not updated, somebody is editing it" 1897 msgstr "" 1898 1899 #: src/models/02-globe-point.php:98 1900 msgid "%s Marker not updated, somebody is editing them" 1901 msgstr "" 1902 1903 #: src/models/02-globe-point.php:99 1904 msgid "Marker permanetly deleted. Fahrenheit 451 team was here?" 1905 msgstr "" 1906 1907 #: src/models/02-globe-point.php:100 1908 msgid "%s Marker permanently deleted. Why? :(" 1909 msgstr "" 1910 1911 #: src/models/02-globe-point.php:101 1912 msgid "Marker moved to the trash. I'm sad :(" 1913 msgstr "" 1914 1915 #: src/models/02-globe-point.php:102 1916 msgid "%s Marker moved to the trash. Why? :(" 1917 msgstr "" 1918 1919 #: src/models/02-globe-point.php:103 1920 msgid "Marker recovered from trash. Well done!" 1921 msgstr "" 1922 1923 #: src/models/02-globe-point.php:104 1924 msgid "%s Marker saved from the enemies!" 1925 msgstr "" 1926 1927 #: src/models/02-globe-point.php:108 1928 msgid "Enter Marker name here" 1929 msgstr "" 1930 1931 #: src/models/02-globe-point.php:194 src/models/03-globe-line.php:337 1932 #: src/models/04-globe-region.php:284 src/models/06-globe-html.php:217 1933 msgid "Globe rel" 1934 msgstr "" 1935 1936 #: src/models/03-globe-line.php:28 1554 1937 msgid "Clone Line" 1555 1938 msgstr "" 1556 1939 1557 #: src/models/ globe-line.php:291940 #: src/models/03-globe-line.php:29 1558 1941 msgid "Create a copy of this Line" 1559 1942 msgstr "" 1560 1943 1561 #: src/models/ globe-line.php:321944 #: src/models/03-globe-line.php:32 1562 1945 msgid "Download Lines Export File" 1563 1946 msgstr "" 1564 1947 1565 #: src/models/ globe-line.php:69 src/models/globe-line.php:711566 #: src/models/ globe-line.php:72 src/models/globe-line.php:831948 #: src/models/03-globe-line.php:69 src/models/03-globe-line.php:71 1949 #: src/models/03-globe-line.php:72 src/models/03-globe-line.php:83 1567 1950 msgid "Lines" 1568 1951 msgstr "" 1569 1952 1570 #: src/models/ globe-line.php:701953 #: src/models/03-globe-line.php:70 1571 1954 msgid "Line" 1572 1955 msgstr "" 1573 1956 1574 #: src/models/ globe-line.php:741957 #: src/models/03-globe-line.php:74 1575 1958 msgid "Create New Line" 1576 1959 msgstr "" 1577 1960 1578 #: src/models/ globe-line.php:761961 #: src/models/03-globe-line.php:76 1579 1962 msgid "New Line" 1580 1963 msgstr "" 1581 1964 1582 #: src/models/ globe-line.php:771965 #: src/models/03-globe-line.php:77 1583 1966 msgid "View Line" 1584 1967 msgstr "" 1585 1968 1586 #: src/models/ globe-line.php:781969 #: src/models/03-globe-line.php:78 1587 1970 msgid "View Lines" 1588 1971 msgstr "" 1589 1972 1590 #: src/models/ globe-line.php:791973 #: src/models/03-globe-line.php:79 1591 1974 msgid "Search Lines" 1592 1975 msgstr "" 1593 1976 1594 #: src/models/ globe-line.php:801977 #: src/models/03-globe-line.php:80 1595 1978 msgid "No Lines found." 1596 1979 msgstr "" 1597 1980 1598 #: src/models/ globe-line.php:811981 #: src/models/03-globe-line.php:81 1599 1982 msgid "No Lines found in Trash." 1600 1983 msgstr "" 1601 1984 1602 #: src/models/ globe-line.php:841985 #: src/models/03-globe-line.php:84 1603 1986 msgid "Line Archives" 1604 1987 msgstr "" 1605 1988 1606 #: src/models/ globe-line.php:851989 #: src/models/03-globe-line.php:85 1607 1990 msgid "Line Attributes" 1608 1991 msgstr "" 1609 1992 1610 #: src/models/ globe-line.php:861993 #: src/models/03-globe-line.php:86 1611 1994 msgid "Insert into Line" 1612 1995 msgstr "" 1613 1996 1614 #: src/models/ globe-line.php:871997 #: src/models/03-globe-line.php:87 1615 1998 msgid "Uploaded to this Line" 1616 1999 msgstr "" 1617 2000 1618 #: src/models/ globe-line.php:882001 #: src/models/03-globe-line.php:88 1619 2002 msgid "Filter Line list" 1620 2003 msgstr "" 1621 2004 1622 #: src/models/ globe-line.php:892005 #: src/models/03-globe-line.php:89 1623 2006 msgid "Line list navigation" 1624 2007 msgstr "" 1625 2008 1626 #: src/models/ globe-line.php:902009 #: src/models/03-globe-line.php:90 1627 2010 msgid "Line list" 1628 2011 msgstr "" 1629 2012 1630 #: src/models/ globe-line.php:912013 #: src/models/03-globe-line.php:91 1631 2014 msgid "Line Cover Image" 1632 2015 msgstr "" 1633 2016 1634 #: src/models/ globe-line.php:922017 #: src/models/03-globe-line.php:92 1635 2018 msgid "Set Line Cover Image" 1636 2019 msgstr "" 1637 2020 1638 #: src/models/ globe-line.php:932021 #: src/models/03-globe-line.php:93 1639 2022 msgid "Remove Line Cover" 1640 2023 msgstr "" 1641 2024 1642 #: src/models/ globe-line.php:942025 #: src/models/03-globe-line.php:94 1643 2026 msgid "Use as Line Cover" 1644 2027 msgstr "" 1645 2028 1646 #: src/models/ globe-line.php:982029 #: src/models/03-globe-line.php:98 1647 2030 msgid "" 1648 2031 "Line information updated. <a href=\"{permalink}\" target=\"_blank\">View " … … 1650 2033 msgstr "" 1651 2034 1652 #: src/models/ globe-line.php:992035 #: src/models/03-globe-line.php:99 1653 2036 msgid "Line info updated" 1654 2037 msgstr "" 1655 2038 1656 #: src/models/ globe-line.php:1022039 #: src/models/03-globe-line.php:102 1657 2040 msgid "Line content restored from revision" 1658 2041 msgstr "" 1659 2042 1660 #: src/models/ globe-line.php:1032043 #: src/models/03-globe-line.php:103 1661 2044 msgid "Line Published" 1662 2045 msgstr "" 1663 2046 1664 #: src/models/ globe-line.php:1042047 #: src/models/03-globe-line.php:104 1665 2048 msgid "Line information saved." 1666 2049 msgstr "" 1667 2050 1668 #: src/models/ globe-line.php:1052051 #: src/models/03-globe-line.php:105 1669 2052 msgid "Line submitted. <a href=\"{preview_url}\" target=\"_blank\">Preview</a>" 1670 2053 msgstr "" 1671 2054 1672 #: src/models/ globe-line.php:1062055 #: src/models/03-globe-line.php:106 1673 2056 msgid "" 1674 2057 "Line scheduled for {date}. <a href=\"{preview_url}\" " … … 1676 2059 msgstr "" 1677 2060 1678 #: src/models/ globe-line.php:1072061 #: src/models/03-globe-line.php:107 1679 2062 msgid "Line draft updated. <a href=\"{preview_url}\" target=\"_blank\">Preview</a>" 1680 2063 msgstr "" 1681 2064 1682 #: src/models/ globe-line.php:1102065 #: src/models/03-globe-line.php:110 1683 2066 msgid "Line updated. Yay!" 1684 2067 msgstr "" 1685 2068 1686 #: src/models/ globe-line.php:1112069 #: src/models/03-globe-line.php:111 1687 2070 msgid "%s Line updated. Yay!" 1688 2071 msgstr "" 1689 2072 1690 #: src/models/ globe-line.php:1122073 #: src/models/03-globe-line.php:112 1691 2074 msgid "Line not updated, somebody is editing it" 1692 2075 msgstr "" 1693 2076 1694 #: src/models/ globe-line.php:1132077 #: src/models/03-globe-line.php:113 1695 2078 msgid "%s Line not updated, somebody is editing them" 1696 2079 msgstr "" 1697 2080 1698 #: src/models/ globe-line.php:1142081 #: src/models/03-globe-line.php:114 1699 2082 msgid "Line permanetly deleted. Fahrenheit 451 team was here?" 1700 2083 msgstr "" 1701 2084 1702 #: src/models/ globe-line.php:1152085 #: src/models/03-globe-line.php:115 1703 2086 msgid "%s Line permanently deleted. Why? :(" 1704 2087 msgstr "" 1705 2088 1706 #: src/models/ globe-line.php:1162089 #: src/models/03-globe-line.php:116 1707 2090 msgid "Line moved to the trash. I'm sad :(" 1708 2091 msgstr "" 1709 2092 1710 #: src/models/ globe-line.php:1172093 #: src/models/03-globe-line.php:117 1711 2094 msgid "%s Line moved to the trash. Why? :(" 1712 2095 msgstr "" 1713 2096 1714 #: src/models/ globe-line.php:1182097 #: src/models/03-globe-line.php:118 1715 2098 msgid "Line recovered from trash. Well done!" 1716 2099 msgstr "" 1717 2100 1718 #: src/models/ globe-line.php:1192101 #: src/models/03-globe-line.php:119 1719 2102 msgid "%s Line saved from the enemies!" 1720 2103 msgstr "" 1721 2104 1722 #: src/models/ globe-line.php:1232105 #: src/models/03-globe-line.php:123 1723 2106 msgid "Enter Line name here" 1724 2107 msgstr "" 1725 2108 1726 #: src/models/ globe-line.php:151 src/models/globe-region.php:2062109 #: src/models/03-globe-line.php:151 src/models/04-globe-region.php:213 1727 2110 msgid "Details." 1728 2111 msgstr "" 1729 2112 1730 #: src/models/ globe-line.php:1582113 #: src/models/03-globe-line.php:158 1731 2114 msgid "Enter manually" 1732 2115 msgstr "" 1733 2116 1734 #: src/models/ globe-line.php:1592117 #: src/models/03-globe-line.php:159 1735 2118 msgid "Connect existing markers" 1736 2119 msgstr "" 1737 2120 1738 #: src/models/ globe-line.php:1662121 #: src/models/03-globe-line.php:166 1739 2122 msgid "Add More End Points" 1740 2123 msgstr "" 1741 2124 1742 #: src/models/ globe-line.php:1672125 #: src/models/03-globe-line.php:167 1743 2126 msgid "Locations to connect" 1744 2127 msgstr "" 1745 2128 1746 #: src/models/ globe-line.php:1902129 #: src/models/03-globe-line.php:190 1747 2130 msgid "Line Info" 1748 2131 msgstr "" 1749 2132 1750 #: src/models/globe-line.php:225 1751 msgid "Markers" 1752 msgstr "" 1753 1754 #: src/models/globe-line.php:227 2133 #: src/models/03-globe-line.php:227 1755 2134 msgid "Add More Markers" 1756 2135 msgstr "" 1757 2136 1758 #: src/models/ globe-line.php:2392137 #: src/models/03-globe-line.php:239 1759 2138 msgid "Select Marker" 1760 2139 msgstr "" 1761 2140 1762 #: src/models/ globe-line.php:2692141 #: src/models/03-globe-line.php:269 1763 2142 msgid "Line Color" 1764 2143 msgstr "" 1765 2144 1766 #: src/models/globe-line.php:337 src/models/globe-point.php:194 1767 #: src/models/globe-region.php:270 1768 msgid "Globe rel" 1769 msgstr "" 1770 1771 #: src/models/globe-point.php:18 1772 msgid "Clone Point" 1773 msgstr "" 1774 1775 #: src/models/globe-point.php:19 1776 msgid "Create a copy of this point" 1777 msgstr "" 1778 1779 #: src/models/globe-point.php:55 1780 msgid "Point" 1781 msgstr "" 1782 1783 #: src/models/globe-point.php:59 1784 msgid "Create New Point" 1785 msgstr "" 1786 1787 #: src/models/globe-point.php:61 1788 msgid "New Point" 1789 msgstr "" 1790 1791 #: src/models/globe-point.php:62 1792 msgid "View Point" 1793 msgstr "" 1794 1795 #: src/models/globe-point.php:63 1796 msgid "View Points" 1797 msgstr "" 1798 1799 #: src/models/globe-point.php:64 1800 msgid "Search Points" 1801 msgstr "" 1802 1803 #: src/models/globe-point.php:65 1804 msgid "No Points found." 1805 msgstr "" 1806 1807 #: src/models/globe-point.php:66 1808 msgid "No Points found in Trash." 1809 msgstr "" 1810 1811 #: src/models/globe-point.php:69 1812 msgid "Point Archives" 1813 msgstr "" 1814 1815 #: src/models/globe-point.php:70 1816 msgid "Point Attributes" 1817 msgstr "" 1818 1819 #: src/models/globe-point.php:71 1820 msgid "Insert into Point" 1821 msgstr "" 1822 1823 #: src/models/globe-point.php:72 1824 msgid "Uploaded to this Point" 1825 msgstr "" 1826 1827 #: src/models/globe-point.php:73 1828 msgid "Filter Point list" 1829 msgstr "" 1830 1831 #: src/models/globe-point.php:74 1832 msgid "Point list navigation" 1833 msgstr "" 1834 1835 #: src/models/globe-point.php:75 1836 msgid "Point list" 1837 msgstr "" 1838 1839 #: src/models/globe-point.php:76 1840 msgid "Point Cover Image" 1841 msgstr "" 1842 1843 #: src/models/globe-point.php:77 1844 msgid "Set Point Cover Image" 1845 msgstr "" 1846 1847 #: src/models/globe-point.php:78 1848 msgid "Remove Point Cover" 1849 msgstr "" 1850 1851 #: src/models/globe-point.php:79 1852 msgid "Use as Point Cover" 1853 msgstr "" 1854 1855 #: src/models/globe-point.php:83 1856 msgid "" 1857 "Point information updated. <a href=\"{permalink}\" target=\"_blank\">View " 1858 "Globe</a>" 1859 msgstr "" 1860 1861 #: src/models/globe-point.php:84 1862 msgid "Point info updated" 1863 msgstr "" 1864 1865 #: src/models/globe-point.php:87 1866 msgid "Point content restored from revision" 1867 msgstr "" 1868 1869 #: src/models/globe-point.php:88 1870 msgid "Point Published" 1871 msgstr "" 1872 1873 #: src/models/globe-point.php:89 1874 msgid "Point information saved." 1875 msgstr "" 1876 1877 #: src/models/globe-point.php:90 1878 msgid "Point submitted. <a href=\"{preview_url}\" target=\"_blank\">Preview</a>" 1879 msgstr "" 1880 1881 #: src/models/globe-point.php:91 1882 msgid "" 1883 "Point scheduled for {date}. <a href=\"{preview_url}\" " 1884 "target=\"_blank\">Preview</a>" 1885 msgstr "" 1886 1887 #: src/models/globe-point.php:92 1888 msgid "Point draft updated. <a href=\"{preview_url}\" target=\"_blank\">Preview</a>" 1889 msgstr "" 1890 1891 #: src/models/globe-point.php:95 1892 msgid "Point updated. Yay!" 1893 msgstr "" 1894 1895 #: src/models/globe-point.php:96 1896 msgid "%s Point updated. Yay!" 1897 msgstr "" 1898 1899 #: src/models/globe-point.php:97 1900 msgid "Point not updated, somebody is editing it" 1901 msgstr "" 1902 1903 #: src/models/globe-point.php:98 1904 msgid "%s Point not updated, somebody is editing them" 1905 msgstr "" 1906 1907 #: src/models/globe-point.php:99 1908 msgid "Point permanetly deleted. Fahrenheit 451 team was here?" 1909 msgstr "" 1910 1911 #: src/models/globe-point.php:100 1912 msgid "%s Point permanently deleted. Why? :(" 1913 msgstr "" 1914 1915 #: src/models/globe-point.php:101 1916 msgid "Point moved to the trash. I'm sad :(" 1917 msgstr "" 1918 1919 #: src/models/globe-point.php:102 1920 msgid "%s Point moved to the trash. Why? :(" 1921 msgstr "" 1922 1923 #: src/models/globe-point.php:103 1924 msgid "Point recovered from trash. Well done!" 1925 msgstr "" 1926 1927 #: src/models/globe-point.php:104 1928 msgid "%s Point saved from the enemies!" 1929 msgstr "" 1930 1931 #: src/models/globe-point.php:108 1932 msgid "Enter Point name here" 1933 msgstr "" 1934 1935 #: src/models/globe-pro.php:26 1936 msgid "Clone Globe" 1937 msgstr "" 1938 1939 #: src/models/globe-pro.php:27 1940 msgid "Create a copy of this globe" 1941 msgstr "" 1942 1943 #: src/models/globe-pro.php:138 1944 msgid "Active Color" 1945 msgstr "" 1946 1947 #: src/models/globe-pro.php:172 1948 msgid "Use default" 1949 msgstr "" 1950 1951 #: src/models/globe-pro.php:180 src/models/globe-pro.php:226 1952 msgid "Use defaults" 1953 msgstr "" 1954 1955 #: src/models/globe-pro.php:181 src/models/globe-pro.php:227 1956 msgid "Use default colors and actions." 1957 msgstr "" 1958 1959 #: src/models/globe-region.php:63 2145 #: src/models/04-globe-region.php:65 1960 2146 msgid "URL not found" 1961 2147 msgstr "" 1962 2148 1963 #: src/models/ globe-region.php:862149 #: src/models/04-globe-region.php:93 1964 2150 msgid "Clone Region" 1965 2151 msgstr "" 1966 2152 1967 #: src/models/ globe-region.php:872153 #: src/models/04-globe-region.php:94 1968 2154 msgid "Create a copy of this Region" 1969 2155 msgstr "" 1970 2156 1971 #: src/models/ globe-region.php:902157 #: src/models/04-globe-region.php:97 1972 2158 msgid "Download Regions Export File" 1973 2159 msgstr "" 1974 2160 1975 #: src/models/ globe-region.php:127 src/models/globe-region.php:1291976 #: src/models/ globe-region.php:130 src/models/globe-region.php:1412161 #: src/models/04-globe-region.php:134 src/models/04-globe-region.php:136 2162 #: src/models/04-globe-region.php:137 src/models/04-globe-region.php:148 1977 2163 msgid "Regions" 1978 2164 msgstr "" 1979 2165 1980 #: src/models/ globe-region.php:1282166 #: src/models/04-globe-region.php:135 1981 2167 msgid "Region" 1982 2168 msgstr "" 1983 2169 1984 #: src/models/ globe-region.php:1322170 #: src/models/04-globe-region.php:139 1985 2171 msgid "Create New Region" 1986 2172 msgstr "" 1987 2173 1988 #: src/models/ globe-region.php:1342174 #: src/models/04-globe-region.php:141 1989 2175 msgid "New Region" 1990 2176 msgstr "" 1991 2177 1992 #: src/models/ globe-region.php:1352178 #: src/models/04-globe-region.php:142 1993 2179 msgid "View Region" 1994 2180 msgstr "" 1995 2181 1996 #: src/models/ globe-region.php:1362182 #: src/models/04-globe-region.php:143 1997 2183 msgid "View Regions" 1998 2184 msgstr "" 1999 2185 2000 #: src/models/ globe-region.php:1372186 #: src/models/04-globe-region.php:144 2001 2187 msgid "Search Regions" 2002 2188 msgstr "" 2003 2189 2004 #: src/models/ globe-region.php:1382190 #: src/models/04-globe-region.php:145 2005 2191 msgid "No Regions found." 2006 2192 msgstr "" 2007 2193 2008 #: src/models/ globe-region.php:1392194 #: src/models/04-globe-region.php:146 2009 2195 msgid "No Regions found in Trash." 2010 2196 msgstr "" 2011 2197 2012 #: src/models/ globe-region.php:1422198 #: src/models/04-globe-region.php:149 2013 2199 msgid "Region Archives" 2014 2200 msgstr "" 2015 2201 2016 #: src/models/ globe-region.php:1432202 #: src/models/04-globe-region.php:150 2017 2203 msgid "Region Attributes" 2018 2204 msgstr "" 2019 2205 2020 #: src/models/ globe-region.php:1442206 #: src/models/04-globe-region.php:151 2021 2207 msgid "Insert into Region" 2022 2208 msgstr "" 2023 2209 2024 #: src/models/ globe-region.php:1452210 #: src/models/04-globe-region.php:152 2025 2211 msgid "Uploaded to this Region" 2026 2212 msgstr "" 2027 2213 2028 #: src/models/ globe-region.php:1462214 #: src/models/04-globe-region.php:153 2029 2215 msgid "Filter Region list" 2030 2216 msgstr "" 2031 2217 2032 #: src/models/ globe-region.php:1472218 #: src/models/04-globe-region.php:154 2033 2219 msgid "Region list navigation" 2034 2220 msgstr "" 2035 2221 2036 #: src/models/ globe-region.php:1482222 #: src/models/04-globe-region.php:155 2037 2223 msgid "Region list" 2038 2224 msgstr "" 2039 2225 2040 #: src/models/ globe-region.php:1492226 #: src/models/04-globe-region.php:156 2041 2227 msgid "Region Cover Image" 2042 2228 msgstr "" 2043 2229 2044 #: src/models/ globe-region.php:1502230 #: src/models/04-globe-region.php:157 2045 2231 msgid "Set Region Cover Image" 2046 2232 msgstr "" 2047 2233 2048 #: src/models/ globe-region.php:1512234 #: src/models/04-globe-region.php:158 2049 2235 msgid "Remove Region Cover" 2050 2236 msgstr "" 2051 2237 2052 #: src/models/ globe-region.php:1522238 #: src/models/04-globe-region.php:159 2053 2239 msgid "Use as Region Cover" 2054 2240 msgstr "" 2055 2241 2056 #: src/models/ globe-region.php:1562242 #: src/models/04-globe-region.php:163 2057 2243 msgid "" 2058 2244 "Region information updated. <a href=\"{permalink}\" target=\"_blank\">View " … … 2060 2246 msgstr "" 2061 2247 2062 #: src/models/ globe-region.php:1572248 #: src/models/04-globe-region.php:164 2063 2249 msgid "Region info updated" 2064 2250 msgstr "" 2065 2251 2066 #: src/models/ globe-region.php:1602252 #: src/models/04-globe-region.php:167 2067 2253 msgid "Region content restored from revision" 2068 2254 msgstr "" 2069 2255 2070 #: src/models/ globe-region.php:1612256 #: src/models/04-globe-region.php:168 2071 2257 msgid "Region Published" 2072 2258 msgstr "" 2073 2259 2074 #: src/models/ globe-region.php:1622260 #: src/models/04-globe-region.php:169 2075 2261 msgid "Region information saved." 2076 2262 msgstr "" 2077 2263 2078 #: src/models/ globe-region.php:1632264 #: src/models/04-globe-region.php:170 2079 2265 msgid "Region submitted. <a href=\"{preview_url}\" target=\"_blank\">Preview</a>" 2080 2266 msgstr "" 2081 2267 2082 #: src/models/ globe-region.php:1642268 #: src/models/04-globe-region.php:171 2083 2269 msgid "" 2084 2270 "Region scheduled for {date}. <a href=\"{preview_url}\" " … … 2086 2272 msgstr "" 2087 2273 2088 #: src/models/ globe-region.php:1652274 #: src/models/04-globe-region.php:172 2089 2275 msgid "" 2090 2276 "Region draft updated. <a href=\"{preview_url}\" " … … 2092 2278 msgstr "" 2093 2279 2094 #: src/models/ globe-region.php:1682280 #: src/models/04-globe-region.php:175 2095 2281 msgid "Region updated. Yay!" 2096 2282 msgstr "" 2097 2283 2098 #: src/models/ globe-region.php:1692284 #: src/models/04-globe-region.php:176 2099 2285 msgid "%s Region updated. Yay!" 2100 2286 msgstr "" 2101 2287 2102 #: src/models/ globe-region.php:1702288 #: src/models/04-globe-region.php:177 2103 2289 msgid "Region not updated, somebody is editing it" 2104 2290 msgstr "" 2105 2291 2106 #: src/models/ globe-region.php:1712292 #: src/models/04-globe-region.php:178 2107 2293 msgid "%s Region not updated, somebody is editing them" 2108 2294 msgstr "" 2109 2295 2110 #: src/models/ globe-region.php:1722296 #: src/models/04-globe-region.php:179 2111 2297 msgid "Region permanetly deleted. Fahrenheit 451 team was here?" 2112 2298 msgstr "" 2113 2299 2114 #: src/models/ globe-region.php:1732300 #: src/models/04-globe-region.php:180 2115 2301 msgid "%s Region permanently deleted. Why? :(" 2116 2302 msgstr "" 2117 2303 2118 #: src/models/ globe-region.php:1742304 #: src/models/04-globe-region.php:181 2119 2305 msgid "Region moved to the trash. I'm sad :(" 2120 2306 msgstr "" 2121 2307 2122 #: src/models/ globe-region.php:1752308 #: src/models/04-globe-region.php:182 2123 2309 msgid "%s Region moved to the trash. Why? :(" 2124 2310 msgstr "" 2125 2311 2126 #: src/models/ globe-region.php:1762312 #: src/models/04-globe-region.php:183 2127 2313 msgid "Region recovered from trash. Well done!" 2128 2314 msgstr "" 2129 2315 2130 #: src/models/ globe-region.php:1772316 #: src/models/04-globe-region.php:184 2131 2317 msgid "%s Region saved from the enemies!" 2132 2318 msgstr "" 2133 2319 2134 #: src/models/ globe-region.php:1812320 #: src/models/04-globe-region.php:188 2135 2321 msgid "Enter Region name here" 2136 2322 msgstr "" 2137 2323 2138 #: src/models/ globe-region.php:2132324 #: src/models/04-globe-region.php:220 2139 2325 msgid "Select a region" 2140 2326 msgstr "" 2141 2327 2142 #: src/models/ globe-region.php:2142328 #: src/models/04-globe-region.php:221 2143 2329 msgid "Region Code *" 2144 2330 msgstr "" 2145 2331 2146 #: src/models/ globe-region.php:2172332 #: src/models/04-globe-region.php:224 2147 2333 msgid "Fetching regions from: " 2334 msgstr "" 2335 2336 #: src/models/04-globe-region.php:273 2337 msgid "Border Color" 2338 msgstr "" 2339 2340 #: src/models/04-globe-region.php:274 2341 msgid "" 2342 "This color will be used for the border of this individual " 2343 "region.<br>WARNING: The region shape borders will overlap, so this region " 2344 "border might not be visible on all sides of the region if the neighbouring " 2345 "regions have a different color." 2346 msgstr "" 2347 2348 #: src/models/06-globe-html.php:19 2349 msgid "Clone HTML Marker" 2350 msgstr "" 2351 2352 #: src/models/06-globe-html.php:20 2353 msgid "Create a copy of this HTML Marker" 2354 msgstr "" 2355 2356 #: src/models/06-globe-html.php:56 2357 msgid "HTML Marker" 2358 msgstr "" 2359 2360 #: src/models/06-globe-html.php:60 2361 msgid "Create New HTML Marker" 2362 msgstr "" 2363 2364 #: src/models/06-globe-html.php:62 2365 msgid "New HTML Marker" 2366 msgstr "" 2367 2368 #: src/models/06-globe-html.php:63 2369 msgid "View HTML Marker" 2370 msgstr "" 2371 2372 #: src/models/06-globe-html.php:64 2373 msgid "View HTML Markers" 2374 msgstr "" 2375 2376 #: src/models/06-globe-html.php:65 2377 msgid "Search HTML Markers" 2378 msgstr "" 2379 2380 #: src/models/06-globe-html.php:66 2381 msgid "No HTML Markers found." 2382 msgstr "" 2383 2384 #: src/models/06-globe-html.php:67 2385 msgid "No HTML Markers found in Trash." 2386 msgstr "" 2387 2388 #: src/models/06-globe-html.php:70 2389 msgid "HTML Marker Archives" 2390 msgstr "" 2391 2392 #: src/models/06-globe-html.php:71 2393 msgid "HTML Marker Attributes" 2394 msgstr "" 2395 2396 #: src/models/06-globe-html.php:72 2397 msgid "Insert into HTML Marker" 2398 msgstr "" 2399 2400 #: src/models/06-globe-html.php:73 2401 msgid "Uploaded to this Point" 2402 msgstr "" 2403 2404 #: src/models/06-globe-html.php:74 2405 msgid "Filter Point list" 2406 msgstr "" 2407 2408 #: src/models/06-globe-html.php:75 2409 msgid "Point list navigation" 2410 msgstr "" 2411 2412 #: src/models/06-globe-html.php:76 2413 msgid "Point list" 2414 msgstr "" 2415 2416 #: src/models/06-globe-html.php:77 2417 msgid "HTML Marker Cover Image" 2418 msgstr "" 2419 2420 #: src/models/06-globe-html.php:78 2421 msgid "Set HTML Marker Cover Image" 2422 msgstr "" 2423 2424 #: src/models/06-globe-html.php:79 2425 msgid "Remove HTML Marker Cover" 2426 msgstr "" 2427 2428 #: src/models/06-globe-html.php:80 2429 msgid "Use as HTML Marker Cover" 2430 msgstr "" 2431 2432 #: src/models/06-globe-html.php:84 2433 msgid "" 2434 "HTML Marker information updated. <a href=\"{permalink}\" " 2435 "target=\"_blank\">View Globe</a>" 2436 msgstr "" 2437 2438 #: src/models/06-globe-html.php:85 2439 msgid "HTML Marker info updated" 2440 msgstr "" 2441 2442 #: src/models/06-globe-html.php:88 2443 msgid "HTML Marker content restored from revision" 2444 msgstr "" 2445 2446 #: src/models/06-globe-html.php:89 2447 msgid "HTML Marker Published" 2448 msgstr "" 2449 2450 #: src/models/06-globe-html.php:90 2451 msgid "HTML Marker information saved." 2452 msgstr "" 2453 2454 #: src/models/06-globe-html.php:91 2455 msgid "" 2456 "HTML Marker submitted. <a href=\"{preview_url}\" " 2457 "target=\"_blank\">Preview</a>" 2458 msgstr "" 2459 2460 #: src/models/06-globe-html.php:92 2461 msgid "" 2462 "HTML Marker scheduled for {date}. <a href=\"{preview_url}\" " 2463 "target=\"_blank\">Preview</a>" 2464 msgstr "" 2465 2466 #: src/models/06-globe-html.php:93 2467 msgid "" 2468 "HTML Marker draft updated. <a href=\"{preview_url}\" " 2469 "target=\"_blank\">Preview</a>" 2470 msgstr "" 2471 2472 #: src/models/06-globe-html.php:96 2473 msgid "HTML Marker updated. Yay!" 2474 msgstr "" 2475 2476 #: src/models/06-globe-html.php:97 2477 msgid "%s HTML Marker updated. Yay!" 2478 msgstr "" 2479 2480 #: src/models/06-globe-html.php:98 2481 msgid "HTML Marker not updated, somebody is editing it" 2482 msgstr "" 2483 2484 #: src/models/06-globe-html.php:99 2485 msgid "%s HTML Marker not updated, somebody is editing them" 2486 msgstr "" 2487 2488 #: src/models/06-globe-html.php:100 2489 msgid "HTML Marker permanetly deleted. Fahrenheit 451 team was here?" 2490 msgstr "" 2491 2492 #: src/models/06-globe-html.php:101 2493 msgid "%s HTML Marker permanently deleted. Why? :(" 2494 msgstr "" 2495 2496 #: src/models/06-globe-html.php:102 2497 msgid "HTML Marker moved to the trash. I'm sad :(" 2498 msgstr "" 2499 2500 #: src/models/06-globe-html.php:103 2501 msgid "%s HTML Marker moved to the trash. Why? :(" 2502 msgstr "" 2503 2504 #: src/models/06-globe-html.php:104 2505 msgid "HTML Marker recovered from trash. Well done!" 2506 msgstr "" 2507 2508 #: src/models/06-globe-html.php:105 2509 msgid "%s HTML Marker saved from the enemies!" 2510 msgstr "" 2511 2512 #: src/models/06-globe-html.php:109 2513 msgid "Enter HTML Marker name here" 2514 msgstr "" 2515 2516 #: src/models/06-globe-html.php:193 2517 msgid "Define individual click action and template." 2518 msgstr "" 2519 2520 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/admin-options.class.php:169 2521 msgid "Error while saving the changes." 2522 msgstr "" 2523 2524 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/admin-options.class.php:229 2525 msgid "Settings successfully imported." 2526 msgstr "" 2527 2528 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/admin-options.class.php:241 2529 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/admin-options.class.php:257 2530 msgid "Default settings restored." 2531 msgstr "" 2532 2533 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/admin-options.class.php:328 2534 msgid "Settings saved." 2535 msgstr "" 2536 2537 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/admin-options.class.php:509 2538 msgid "You have unsaved changes, save your changes!" 2539 msgstr "" 2540 2541 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/admin-options.class.php:511 2542 msgid "show all settings" 2543 msgstr "" 2544 2545 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/admin-options.class.php:516 2546 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/admin-options.class.php:639 2547 msgid "Save" 2548 msgstr "" 2549 2550 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/admin-options.class.php:516 2551 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/admin-options.class.php:639 2552 msgid "Saving..." 2553 msgstr "" 2554 2555 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/admin-options.class.php:517 2556 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/admin-options.class.php:640 2557 msgid "Reset Section" 2558 msgstr "" 2559 2560 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/admin-options.class.php:517 2561 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/admin-options.class.php:640 2562 msgid "Are you sure to reset this section options?" 2563 msgstr "" 2564 2565 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/admin-options.class.php:518 2566 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/admin-options.class.php:641 2567 msgid "Reset All" 2568 msgstr "" 2569 2570 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/admin-options.class.php:518 2571 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/admin-options.class.php:641 2572 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/comment-options.class.php:201 2573 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/metabox-options.class.php:280 2574 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/backup/backup.php:31 2575 msgid "Reset" 2576 msgstr "" 2577 2578 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/admin-options.class.php:518 2579 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/admin-options.class.php:641 2580 msgid "Are you sure you want to reset all settings to default values?" 2581 msgstr "" 2582 2583 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/admin-options.class.php:616 2584 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/comment-options.class.php:184 2585 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/metabox-options.class.php:263 2586 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/button_set/button_set.php:56 2587 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/checkbox/checkbox.php:82 2588 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/radio/radio.php:75 2589 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/select/select.php:113 2590 #: vendor-prefixed/saltus/framework/lib/codestar-framework/functions/actions.php:41 2591 msgid "No data available." 2592 msgstr "" 2593 2594 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/comment-options.class.php:202 2595 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/metabox-options.class.php:281 2596 msgid "update post" 2597 msgstr "" 2598 2599 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/comment-options.class.php:202 2600 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/metabox-options.class.php:281 2601 msgid "Cancel" 2602 msgstr "" 2603 2604 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/setup.class.php:606 2605 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/setup.class.phpsetup.class.php:606 2606 msgid "Are you sure?" 2607 msgstr "" 2608 2609 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/setup.class.php:607 2610 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/setup.class.phpsetup.class.php:607 2611 msgid "Please enter %s or more characters" 2612 msgstr "" 2613 2614 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/setup.class.php:608 2615 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/setup.class.phpsetup.class.php:608 2616 msgid "Searching..." 2617 msgstr "" 2618 2619 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/setup.class.php:609 2620 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/setup.class.phpsetup.class.php:609 2621 msgid "No results found." 2622 msgstr "" 2623 2624 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/setup.class.php:710 2625 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/setup.class.phpsetup.class.php:710 2626 msgid "Oops! Not allowed." 2627 msgstr "" 2628 2629 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/setup.class.php:778 2630 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/setup.class.php:782 2631 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/setup.class.phpsetup.class.php:778 2632 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/setup.class.phpsetup.class.php:782 2633 msgid "Field not found!" 2634 msgstr "" 2635 2636 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/shortcode-options.class.php:210 2637 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/group/group.php:23 2638 msgid "Add New" 2639 msgstr "" 2640 2641 #: vendor-prefixed/saltus/framework/lib/codestar-framework/classes/shortcode-options.class.php:247 2642 #: vendor-prefixed/saltus/framework/lib/codestar-framework/functions/actions.php:16 2643 #: vendor-prefixed/saltus/framework/lib/codestar-framework/functions/actions.php:68 2644 #: vendor-prefixed/saltus/framework/lib/codestar-framework/functions/actions.php:106 2645 #: vendor-prefixed/saltus/framework/lib/codestar-framework/functions/actions.php:141 2646 #: vendor-prefixed/saltus/framework/lib/codestar-framework/functions/actions.php:170 2647 msgid "Error: Invalid nonce verification." 2648 msgstr "" 2649 2650 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:36 2651 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/media/media.php:59 2652 msgid "Not selected" 2653 msgstr "" 2654 2655 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:72 2656 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/date/date.php:31 2657 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/datetime/datetime.php:36 2658 msgid "From" 2659 msgstr "" 2660 2661 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:90 2662 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/date/date.php:32 2663 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/datetime/datetime.php:37 2664 msgid "To" 2665 msgstr "" 2666 2667 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:108 2668 msgid "Direction" 2669 msgstr "" 2670 2671 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:114 2672 msgid "Gradient Direction" 2673 msgstr "" 2674 2675 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:115 2676 msgid "⇓ top to bottom" 2677 msgstr "" 2678 2679 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:116 2680 msgid "⇒ left to right" 2681 msgstr "" 2682 2683 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:117 2684 msgid "⇘ corner top to right" 2685 msgstr "" 2686 2687 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:118 2688 msgid "⇙ corner top to left" 2689 msgstr "" 2690 2691 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:161 2692 msgid "Background Position" 2693 msgstr "" 2694 2695 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:162 2696 msgid "Left Top" 2697 msgstr "" 2698 2699 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:163 2700 msgid "Left Center" 2701 msgstr "" 2702 2703 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:164 2704 msgid "Left Bottom" 2705 msgstr "" 2706 2707 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:165 2708 msgid "Center Top" 2709 msgstr "" 2710 2711 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:166 2712 msgid "Center Center" 2713 msgstr "" 2714 2715 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:167 2716 msgid "Center Bottom" 2717 msgstr "" 2718 2719 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:168 2720 msgid "Right Top" 2721 msgstr "" 2722 2723 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:169 2724 msgid "Right Center" 2725 msgstr "" 2726 2727 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:170 2728 msgid "Right Bottom" 2729 msgstr "" 2730 2731 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:184 2732 msgid "Background Repeat" 2733 msgstr "" 2734 2735 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:185 2736 msgid "Repeat" 2737 msgstr "" 2738 2739 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:186 2740 msgid "No Repeat" 2741 msgstr "" 2742 2743 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:187 2744 msgid "Repeat Horizontally" 2745 msgstr "" 2746 2747 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:188 2748 msgid "Repeat Vertically" 2749 msgstr "" 2750 2751 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:202 2752 msgid "Background Attachment" 2753 msgstr "" 2754 2755 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:203 2756 msgid "Scroll" 2757 msgstr "" 2758 2759 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:204 2760 msgid "Fixed" 2761 msgstr "" 2762 2763 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:218 2764 msgid "Background Size" 2765 msgstr "" 2766 2767 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:219 2768 msgid "Cover" 2769 msgstr "" 2770 2771 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:220 2772 msgid "Contain" 2773 msgstr "" 2774 2775 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:221 2776 msgid "Auto" 2777 msgstr "" 2778 2779 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:235 2780 msgid "Background Origin" 2781 msgstr "" 2782 2783 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:236 2784 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:254 2785 msgid "Padding Box" 2786 msgstr "" 2787 2788 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:237 2789 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:253 2790 msgid "Border Box" 2791 msgstr "" 2792 2793 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:238 2794 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:255 2795 msgid "Content Box" 2796 msgstr "" 2797 2798 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:252 2799 msgid "Background Clip" 2800 msgstr "" 2801 2802 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:269 2803 msgid "Background Blend Mode" 2804 msgstr "" 2805 2806 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:270 2807 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/link_color/link_color.php:36 2808 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:186 2809 msgid "Normal" 2810 msgstr "" 2811 2812 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:271 2813 msgid "Multiply" 2814 msgstr "" 2815 2816 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:272 2817 msgid "Screen" 2818 msgstr "" 2819 2820 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:273 2821 msgid "Overlay" 2822 msgstr "" 2823 2824 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:274 2825 msgid "Darken" 2826 msgstr "" 2827 2828 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:275 2829 msgid "Lighten" 2830 msgstr "" 2831 2832 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:276 2833 msgid "Color Dodge" 2834 msgstr "" 2835 2836 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:277 2837 msgid "Saturation" 2838 msgstr "" 2839 2840 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php:279 2841 msgid "Luminosity" 2842 msgstr "" 2843 2844 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/backup/backup.php:26 2845 msgid "Import" 2846 msgstr "" 2847 2848 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/backup/backup.php:29 2849 msgid "Export & Download" 2850 msgstr "" 2851 2852 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/border/border.php:25 2853 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/spacing/spacing.php:25 2854 msgid "top" 2855 msgstr "" 2856 2857 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/border/border.php:26 2858 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/spacing/spacing.php:26 2859 msgid "right" 2860 msgstr "" 2861 2862 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/border/border.php:27 2863 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/spacing/spacing.php:27 2864 msgid "bottom" 2865 msgstr "" 2866 2867 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/border/border.php:28 2868 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/spacing/spacing.php:28 2869 msgid "left" 2870 msgstr "" 2871 2872 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/border/border.php:29 2873 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/spacing/spacing.php:29 2874 msgid "all" 2875 msgstr "" 2876 2877 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/border/border.php:51 2878 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:214 2879 msgid "Solid" 2880 msgstr "" 2881 2882 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/border/border.php:52 2883 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:217 2884 msgid "Dashed" 2885 msgstr "" 2886 2887 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/border/border.php:53 2888 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:216 2889 msgid "Dotted" 2890 msgstr "" 2891 2892 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/border/border.php:54 2893 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:215 2894 msgid "Double" 2895 msgstr "" 2896 2897 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/border/border.php:55 2898 msgid "Inset" 2899 msgstr "" 2900 2901 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/border/border.php:56 2902 msgid "Outset" 2903 msgstr "" 2904 2905 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/border/border.php:57 2906 msgid "Groove" 2907 msgstr "" 2908 2909 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/border/border.php:58 2910 msgid "ridge" 2911 msgstr "" 2912 2913 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/checkbox/checkbox.php:23 2914 msgid "Check/Uncheck All" 2915 msgstr "" 2916 2917 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/dimensions/dimensions.php:22 2918 msgid "width" 2919 msgstr "" 2920 2921 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/dimensions/dimensions.php:23 2922 msgid "height" 2923 msgstr "" 2924 2925 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/gallery/gallery.php:20 2926 msgid "Add Gallery" 2927 msgstr "" 2928 2929 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/gallery/gallery.php:21 2930 msgid "Edit Gallery" 2931 msgstr "" 2932 2933 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/gallery/gallery.php:22 2934 msgid "Clear" 2935 msgstr "" 2936 2937 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/group/group.php:41 2938 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/repeater/repeater.php:27 2939 msgid "Error: Field ID conflict." 2940 msgstr "" 2941 2942 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/group/group.php:52 2943 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/group/group.php:107 2944 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/repeater/repeater.php:48 2945 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/repeater/repeater.php:76 2946 msgid "Are you sure to delete this item?" 2947 msgstr "" 2948 2949 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/group/group.php:141 2950 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/repeater/repeater.php:89 2951 msgid "You cannot add more." 2952 msgstr "" 2953 2954 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/group/group.php:142 2955 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/repeater/repeater.php:90 2956 msgid "You cannot remove more." 2957 msgstr "" 2958 2959 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/icon/icon.php:20 2960 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/icon/icon.php:53 2961 msgid "Add Icon" 2962 msgstr "" 2963 2964 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/icon/icon.php:21 2965 msgid "Remove Icon" 2966 msgstr "" 2967 2968 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/link/link.php:20 2969 msgid "Add Link" 2970 msgstr "" 2971 2972 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/link/link.php:21 2973 msgid "Edit Link" 2974 msgstr "" 2975 2976 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/link/link.php:22 2977 msgid "Remove Link" 2978 msgstr "" 2979 2980 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/link_color/link_color.php:37 2981 msgid "Hover" 2982 msgstr "" 2983 2984 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/link_color/link_color.php:38 2985 msgid "Active" 2986 msgstr "" 2987 2988 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/link_color/link_color.php:39 2989 msgid "Visited" 2990 msgstr "" 2991 2992 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/link_color/link_color.php:40 2993 msgid "Focus" 2994 msgstr "" 2995 2996 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/media/media.php:25 2997 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/upload/upload.php:24 2998 msgid "Upload" 2999 msgstr "" 3000 3001 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/media/media.php:26 3002 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/upload/upload.php:25 3003 msgid "Remove" 3004 msgstr "" 3005 3006 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/switcher/switcher.php:20 3007 msgid "On" 3008 msgstr "" 3009 3010 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/switcher/switcher.php:21 3011 msgid "Off" 3012 msgstr "" 3013 3014 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:97 3015 msgid "Select a font" 3016 msgstr "" 3017 3018 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:105 3019 msgid "Backup Font Family" 3020 msgstr "" 3021 3022 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:130 3023 msgid "Font Style" 3024 msgstr "" 3025 3026 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:144 3027 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:145 3028 msgid "Load Extra Styles" 3029 msgstr "" 3030 3031 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:158 3032 msgid "Subset" 3033 msgstr "" 3034 3035 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:168 3036 msgid "Text Align" 3037 msgstr "" 3038 3039 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:170 3040 msgid "Inherit" 3041 msgstr "" 3042 3043 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:171 3044 msgid "Left" 3045 msgstr "" 3046 3047 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:172 3048 msgid "Center" 3049 msgstr "" 3050 3051 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:174 3052 msgid "Justify" 3053 msgstr "" 3054 3055 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:175 3056 msgid "Initial" 3057 msgstr "" 3058 3059 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:184 3060 msgid "Font Variant" 3061 msgstr "" 3062 3063 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:187 3064 msgid "Small Caps" 3065 msgstr "" 3066 3067 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:188 3068 msgid "All Small Caps" 3069 msgstr "" 3070 3071 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:197 3072 msgid "Text Transform" 3073 msgstr "" 3074 3075 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:200 3076 msgid "Capitalize" 3077 msgstr "" 3078 3079 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:201 3080 msgid "Uppercase" 3081 msgstr "" 3082 3083 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:202 3084 msgid "Lowercase" 3085 msgstr "" 3086 3087 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:211 3088 msgid "Text Decoration" 3089 msgstr "" 3090 3091 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:218 3092 msgid "Wavy" 3093 msgstr "" 3094 3095 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:219 3096 msgid "Overline" 3097 msgstr "" 3098 3099 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:220 3100 msgid "Line-through" 3101 msgstr "" 3102 3103 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:233 3104 msgid "Font Size" 3105 msgstr "" 3106 3107 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:245 3108 msgid "Line Height" 3109 msgstr "" 3110 3111 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:257 3112 msgid "Letter Spacing" 3113 msgstr "" 3114 3115 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:269 3116 msgid "Word Spacing" 3117 msgstr "" 3118 3119 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:284 3120 msgid "Font Color" 3121 msgstr "" 3122 3123 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:295 3124 msgid "Custom Style" 3125 msgstr "" 3126 3127 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:362 3128 msgid "Custom Web Fonts" 3129 msgstr "" 3130 3131 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:368 3132 msgid "Safe Web Fonts" 3133 msgstr "" 3134 3135 #: vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php:388 3136 msgid "Google Web Fonts" 3137 msgstr "" 3138 3139 #: vendor-prefixed/saltus/framework/lib/codestar-framework/functions/actions.php:72 3140 #: vendor-prefixed/saltus/framework/lib/codestar-framework/functions/actions.php:110 3141 msgid "Error: Invalid key." 3142 msgstr "" 3143 3144 #: vendor-prefixed/saltus/framework/lib/codestar-framework/functions/actions.php:114 3145 msgid "Error: The response is not a valid JSON response." 3146 msgstr "" 3147 3148 #: vendor-prefixed/saltus/framework/lib/codestar-framework/functions/actions.php:174 3149 msgid "Error: Invalid term ID." 3150 msgstr "" 3151 3152 #: vendor-prefixed/saltus/framework/lib/codestar-framework/functions/actions.php:180 3153 msgid "Error: You do not have permission to do that." 3154 msgstr "" 3155 3156 #: vendor-prefixed/saltus/framework/lib/codestar-framework/functions/validate.php:14 3157 #: vendor-prefixed/saltus/framework/lib/codestar-framework/functions/validate.php:86 3158 msgid "Please enter a valid email address." 3159 msgstr "" 3160 3161 #: vendor-prefixed/saltus/framework/lib/codestar-framework/functions/validate.php:32 3162 #: vendor-prefixed/saltus/framework/lib/codestar-framework/functions/validate.php:106 3163 msgid "Please enter a valid number." 3164 msgstr "" 3165 3166 #: vendor-prefixed/saltus/framework/lib/codestar-framework/functions/validate.php:50 3167 #: vendor-prefixed/saltus/framework/lib/codestar-framework/functions/validate.php:126 3168 msgid "This field is required." 3169 msgstr "" 3170 3171 #: vendor-prefixed/saltus/framework/lib/codestar-framework/functions/validate.php:68 3172 #: vendor-prefixed/saltus/framework/lib/codestar-framework/functions/validate.php:146 3173 msgid "Please enter a valid URL." 3174 msgstr "" 3175 3176 #: vendor-prefixed/saltus/framework/src/Features/AdminCols/SaltusAdminCols.php:139 3177 #: vendor-prefixed/saltus/framework/src/Features/AdminFilters/SaltusAdminFilters.php:408 3178 msgid "Author" 3179 msgstr "" 3180 3181 #: vendor-prefixed/saltus/framework/src/Features/AdminFilters/SaltusAdminFilters.php:404 3182 msgid "All Authors" 3183 msgstr "" 3184 3185 #: vendor-prefixed/saltus/framework/src/Features/Duplicate/SaltusDuplicate.php:68 3186 msgid "Item cannot be found. Please select one to duplicate." 3187 msgstr "" 3188 3189 #: vendor-prefixed/saltus/framework/src/Features/Duplicate/SaltusDuplicate.php:72 3190 msgid "Please select an item to duplicate." 2148 3191 msgstr "" 2149 3192 -
interactive-globes/trunk/src/Core.php
r3207680 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes;2 namespace Saltus\WP\Plugin\InteractiveGlobes; 3 3 4 use Saltus\WP\ Framework\Infrastructure\Container\ServiceContainer;4 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Container\ServiceContainer; 5 5 6 use Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Features\Shortcode\ShortcodeFeature;7 use Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Features\Shortcode\ShortcodeCore;8 use Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Features\Meta\MetaFeature;9 use Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Features\Duplicate\DuplicateFeature;10 use Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Features\CptManager\CptManagerFeature;11 use Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Features\Sales\UpsellPageFeature;12 use Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Features\Updater\UpdateFeature;6 use Saltus\WP\Plugin\InteractiveGlobes\Features\Shortcode\ShortcodeFeature; 7 use Saltus\WP\Plugin\InteractiveGlobes\Features\Shortcode\ShortcodeCore; 8 use Saltus\WP\Plugin\InteractiveGlobes\Features\Meta\MetaFeature; 9 use Saltus\WP\Plugin\InteractiveGlobes\Features\Duplicate\DuplicateFeature; 10 use Saltus\WP\Plugin\InteractiveGlobes\Features\CptManager\CptManagerFeature; 11 use Saltus\WP\Plugin\InteractiveGlobes\Features\Sales\UpsellPageFeature; 12 use Saltus\WP\Plugin\InteractiveGlobes\Features\Updater\UpdateFeature; 13 13 // services 14 use Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Services\Assets\AssetsService;14 use Saltus\WP\Plugin\InteractiveGlobes\Services\Assets\AssetsService; 15 15 16 16 /** -
interactive-globes/trunk/src/Features/CptManager/CptManagerCore.php
r3207680 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\Saltus\InteractiveGlobes\Features\CptManager; 3 4 use Saltus\WP\Framework\Infrastructure\Plugin\Registerable; 2 namespace Saltus\WP\Plugin\InteractiveGlobes\Features\CptManager; 3 4 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Container\Invalid; 5 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Container\ServiceContainer; 6 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Plugin\Registerable; 5 7 6 8 /** … … 9 11 class CptManagerCore implements Registerable { 10 12 11 public function __construct( ...$dependencies ) {} 13 private $services; 14 public function __construct( ...$dependencies ) { 15 16 if ( empty( $dependencies[1] ) ) { 17 throw Invalid::from( 'Services' ); 18 } 19 if ( ! $dependencies[1] instanceof ServiceContainer ) { 20 throw Invalid::from( $dependencies[1] ); 21 } 22 23 $this->services = $dependencies[1]; 24 } 12 25 13 26 /** … … 17 30 // single globe page filter 18 31 add_filter( 'admin_head', [ $this, 'prepare_iframe' ] ); 32 add_action( 'admin_enqueue_scripts', array( $this, 'load_admin_styles' ) ); 33 } 34 35 public function load_admin_styles() { 36 if ( ! isset( $_GET['iframe'] ) ) { 37 return; 38 } 39 try { 40 $assets = $this->services->get( 'assets' )->create(); 41 $name = $assets->register_style( '/assets/css/features/cptmanager/modal.css' ); 42 wp_enqueue_style( $name ); 43 } catch ( \Exception $exception ) { 44 45 if ( defined( 'WP_DEBUG' ) && WP_DEBUG === true ) { 46 // phpcs:ignore WordPress.PHP.DevelopmentFunctions 47 error_log( 'Failed to load styles' ); 48 } 49 } 19 50 } 20 51 … … 31 62 return; 32 63 } 33 echo '<style> 34 body { overflow: scroll; background:#FFFFFF; }35 html.wp-toolbar { padding-top:0; }36 .csf-theme-light .csf-nav-inline {37 border-top: 1px solid #ccd0d4;38 }39 .geocoding-hide { display:none; }40 < /style>';64 65 echo ' 66 <!DOCTYPE html> 67 <html> 68 <head>'; 69 wp_print_media_templates(); 70 echo '</head> 71 <body>'; 41 72 42 73 $this->render_fields( $post, $parent_id ); 74 // add media library 43 75 do_action( 'admin_print_footer_scripts' ); 76 echo ' 77 </body> 78 </html> 79 '; 44 80 exit(); 45 81 } … … 104 140 data-parent_id="%6$s" 105 141 data-refresh_lis="%6$s" 142 class="wp-core-ui" 106 143 > 107 144 <div class="csf-field-text modal-title-field" style="margin:20px 0"> -
interactive-globes/trunk/src/Features/CptManager/CptManagerFeature.php
r3098987 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Features\CptManager;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Features\CptManager; 3 3 4 use Saltus\WP\ Framework\Infrastructure\Service\{4 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Service\{ 5 5 Actionable, 6 6 Service, -
interactive-globes/trunk/src/Features/Duplicate/DuplicateCore.php
r3207680 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Features\Duplicate;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Features\Duplicate; 3 3 4 use Saltus\WP\ Framework\Infrastructure\Plugin\Registerable;4 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Plugin\Registerable; 5 5 6 6 /** … … 28 28 return; 29 29 } 30 30 31 31 // Query for all posts that have the meta field 'globe_id' equal to $post_id 32 32 $args = [ … … 43 43 ), 44 44 ]; 45 45 46 46 $posts = get_posts($args); 47 47 48 48 // Loop through the results 49 49 foreach ($posts as $post) { … … 60 60 'post_date_gmt' => $post->post_date_gmt, 61 61 ); 62 62 63 63 $new_clone_id = wp_insert_post($new_post); 64 64 65 65 // Clone all meta data 66 66 $meta_data = get_post_meta($post->ID); … … 70 70 } 71 71 } 72 72 73 73 // Change the globe_id meta field of the new post 74 74 update_post_meta($new_clone_id, 'globe_id', $new_post_id); -
interactive-globes/trunk/src/Features/Duplicate/DuplicateFeature.php
r3207680 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Features\Duplicate;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Features\Duplicate; 3 3 4 use Saltus\WP\ Framework\Infrastructure\Service\{4 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Service\{ 5 5 Actionable, 6 6 Service, -
interactive-globes/trunk/src/Features/Meta/MetaCore.php
r3207712 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Features\Meta;3 4 use Saltus\WP\ Framework\Infrastructure\Container\Invalid;5 use Saltus\WP\ Framework\Infrastructure\Container\ServiceContainer;6 use Saltus\WP\ Framework\Infrastructure\Plugin\Registerable;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Features\Meta; 3 4 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Container\Invalid; 5 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Container\ServiceContainer; 6 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Plugin\Registerable; 7 7 8 8 /** … … 30 30 public function register() { 31 31 32 add_action( 'admin_enqueue_scripts', array( $this, 'load_admin_styles' ) ); 33 34 add_action( 'add_meta_boxes', [ $this, 'meta_box_shortcode' ] ); 35 add_action( 'add_meta_boxes', [ $this, 'remove_custom_meta_form' ] ); 36 37 add_action( 'rest_api_init', [ $this, 'custom_endpoints' ] ); 38 } 39 40 public function load_admin_styles() { 32 41 try { 33 42 $assets = $this->services->get( 'assets' )->create(); 34 $assets->load_admin_styles( '/assets/css/features/meta/meta-admin.css' );35 43 } catch ( \Exception $exception ) { 36 44 … … 40 48 } 41 49 } 42 43 add_action( 'add_meta_boxes', [ $this, 'meta_box_shortcode' ] ); 44 45 add_action( 'rest_api_init', [ $this, 'custom_endpoints' ] ); 46 47 add_action( 'add_meta_boxes', [ $this, 'remove_custom_meta_form' ] ); 50 $name = $assets->register_style( '/assets/css/features/meta/meta-admin.css' ); 51 wp_enqueue_style( $name ); 48 52 } 49 53 … … 124 128 public function render_custom_data_meta_box() { 125 129 global $post; 126 printf( '<div class="meta_box_shortcode-code_container"><span id="meta_box_shortcode-code">[display-globe id="%1$s"]</span> <button id="ittglobe-copy-button" type="button" class="dashicons dashicons-admin-page" title="Copy to clipboard"></button></div>', (int) esc_attr( $post->ID ) ); 130 printf( 131 '<div class="meta_box_shortcode-code_container"><span id="meta_box_shortcode-code">[display-globe id="%1$s"]</span> <button id="ittglobe-copy-button" type="button" class="dashicons dashicons-admin-page" title="%2$s"></button></div>', 132 (int) esc_attr( $post->ID ), 133 esc_html__( 'Copy to clipboard', 'interactive-globes' ) 134 ); 127 135 } 128 136 … … 252 260 position: relative; 253 261 width: 80%; 254 height: 8 0%;262 height: 85%; 255 263 text-align: center; 256 264 margin:5vh auto 0 auto; … … 263 271 background:#f9f9f9; 264 272 text-align: right; 265 margin:0 auto; 273 margin-left:auto; 274 margin-right:auto; 275 margin-bottom:0; 276 margin-top:-60px; 277 z-index:9992; 278 position:relative; 266 279 border-top:1px solid #ccc; 267 280 box-shadow: 0px -4px 5px -3px rgba(0,0,0,0.75); … … 290 303 } 291 304 305 .overlay a.closebtn.disabled { 306 opacity: 0.5; 307 pointer-events: none; 308 } 309 292 310 .overlay .overlay-content-loading { 293 311 position: absolute; … … 295 313 left: 50%; 296 314 transform: translate(-50%, -50%); 315 } 316 317 .overlay-controls.disabled { 318 opacity: 0; 319 pointer-events: none; 297 320 } 298 321 -
interactive-globes/trunk/src/Features/Meta/MetaFeature.php
r3098987 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Features\Meta;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Features\Meta; 3 3 4 use Saltus\WP\ Framework\Infrastructure\Service\{4 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Service\{ 5 5 Actionable, 6 6 Service, -
interactive-globes/trunk/src/Features/Sales/UpsellPage.php
r3158721 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Features\Sales;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Features\Sales; 3 3 4 use Saltus\WP\ Framework\Infrastructure\Container\Invalid;5 use Saltus\WP\ Framework\Infrastructure\Container\ServiceContainer;6 use Saltus\WP\ Framework\Infrastructure\Plugin\Registerable;4 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Container\Invalid; 5 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Container\ServiceContainer; 6 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Plugin\Registerable; 7 7 8 8 /** … … 30 30 */ 31 31 public function register() { 32 try {33 $assets = $this->services->get( 'assets' )->create();34 $assets->load_admin_styles( '/assets/css/features/sales/upsell-page.css' );35 } catch ( \Exception $exception ) {36 32 37 if ( defined( 'WP_DEBUG' ) && WP_DEBUG === true ) { 38 // phpcs:ignore WordPress.PHP.DevelopmentFunctions 39 error_log( 'Failed to load styles' ); 40 } 41 } 33 add_action( 'admin_enqueue_scripts', array( $this, 'load_admin_styles' ) ); 34 42 35 // single globe page filter 43 36 add_action( … … 56 49 } 57 50 51 public function load_admin_styles() { 52 try { 53 $assets = $this->services->get( 'assets' )->create(); 54 55 } catch ( \Exception $exception ) { 56 57 if ( defined( 'WP_DEBUG' ) && WP_DEBUG === true ) { 58 // phpcs:ignore WordPress.PHP.DevelopmentFunctions 59 error_log( 'Failed to load styles' ); 60 } 61 } 62 $name = $assets->register_style( '/assets/css/features/sales/upsell-page.css' ); 63 wp_enqueue_style( $name ); 64 } 58 65 59 66 public function globe_go_pro_page() { … … 94 101 <h3>Lifetime License</h3> 95 102 <p class="price"><s>$89</s></p> 96 <p class="price">$ 49</p>103 <p class="price">$59</p> 97 104 <p>One-time payment.</p> 98 105 </div> … … 103 110 <h2>Ready to Upgrade?</h2> 104 111 <p>Get the Pro version today and take your 3D Globes to the next level!</p> 105 <a href="https://wpinteractiveglobes.com/get-pro/" target="_blank" class="upgrade-button"> Get Pro</a>112 <a href="https://wpinteractiveglobes.com/get-pro/" target="_blank" class="upgrade-button">Free 7 Day Trial</a> 106 113 </div> 107 114 -
interactive-globes/trunk/src/Features/Sales/UpsellPageFeature.php
r3158721 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Features\Sales;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Features\Sales; 3 3 4 use Saltus\WP\ Framework\Infrastructure\Service\{4 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Service\{ 5 5 Actionable, 6 6 Service, 7 7 Conditional 8 8 }; 9 use Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Features\Sales\UpsellPage;9 use Saltus\WP\Plugin\InteractiveGlobes\Features\Sales\UpsellPage; 10 10 11 11 /** -
interactive-globes/trunk/src/Features/Shortcode/ShortcodeCore.php
r3207680 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\Saltus\InteractiveGlobes\Features\Shortcode; 3 4 use Saltus\WP\Plugin\Saltus\InteractiveGlobes\Project; 5 use Saltus\WP\Framework\Infrastructure\Container\Invalid; 6 use Saltus\WP\Framework\Infrastructure\Container\ServiceContainer; 7 use Saltus\WP\Framework\Infrastructure\Plugin\Registerable; 8 use Saltus\WP\Plugin\Saltus\InteractiveGlobes\Services\Assets\HasAssets; 2 namespace Saltus\WP\Plugin\InteractiveGlobes\Features\Shortcode; 3 4 use Saltus\WP\Plugin\InteractiveGlobes\Project; 5 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Container\Invalid; 6 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Container\ServiceContainer; 7 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Plugin\Registerable; 8 use Saltus\WP\Plugin\InteractiveGlobes\Plugin\Assets; 9 use Saltus\WP\Plugin\InteractiveGlobes\Services\Assets\HasAssets; 9 10 10 11 /** … … 16 17 17 18 private $services; 18 /**19 * Options for Globe CPT20 */21 private $options;22 19 23 20 /** … … 46 43 } 47 44 /** 48 * Register Shortcode 45 * Register Shortcodes 49 46 */ 50 47 public function register() { 51 48 add_shortcode( 'display-globe', array( $this, 'render_shortcode' ) ); 49 50 //region count shortcode 51 add_shortcode( 'display-globe-region-count', array( $this, 'render_region_count_shortcode' ) ); 52 52 53 53 // Hook the function to admin_footer … … 136 136 } 137 137 } 138 139 // temp, move out to services 140 $globe_assets = new Assets( $this->project, $this->services ); 141 $globe_assets->load_globe_styles(); 138 142 139 143 $id = absint( $atts['id'] ); … … 145 149 $data['isAdmin'] = true; 146 150 } 151 $name = $assets->register_script( 152 '/assets/js/vendor/public/globe.gl.js', 153 [], 154 true 155 ); 156 wp_enqueue_script( $name ); 147 157 148 158 $name = $assets->register_script( … … 179 189 $this->setup_meta( $atts ); 180 190 $this->meta = apply_filters( 'itt_globes/render/post_setup_meta', $this->meta, $id ); 181 $namespace = 'Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Features\ClickActions\\';191 $namespace = 'Saltus\WP\Plugin\InteractiveGlobes\Features\ClickActions\\'; 182 192 183 193 // prepare overlays … … 198 208 unset( $layer_meta['search'] ); 199 209 200 210 201 211 $new_meta = apply_filters( 'itt_globes/render/post_setup_meta', $layer_meta, $layer_id ); 202 212 $this->meta['layers'][] = $new_meta; -
interactive-globes/trunk/src/Features/Shortcode/ShortcodeFeature.php
r3098987 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Features\Shortcode;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Features\Shortcode; 3 3 4 use Saltus\WP\ Framework\Infrastructure\Service\{4 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Service\{ 5 5 Actionable, 6 6 Service, -
interactive-globes/trunk/src/Features/SinglePage/SinglePageCore.php
r3098987 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Features\SinglePage;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Features\SinglePage; 3 3 4 use Saltus\WP\ Framework\Infrastructure\Plugin\Registerable;4 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Plugin\Registerable; 5 5 6 6 /** -
interactive-globes/trunk/src/Features/SinglePage/SinglePageFeature.php
r3098987 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Features\SinglePage;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Features\SinglePage; 3 3 4 use Saltus\WP\ Framework\Infrastructure\Service\{4 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Service\{ 5 5 Actionable, 6 6 Service, -
interactive-globes/trunk/src/Features/Tooltip/TooltipCore.php
r3207680 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Features\Tooltip;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Features\Tooltip; 3 3 4 use Saltus\WP\ Framework\Infrastructure\Plugin\Registerable;4 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Plugin\Registerable; 5 5 6 6 /** … … 26 26 public function content_before( $before, $id ) { 27 27 $meta = get_post_meta( $id, 'globe_info', true ); 28 28 29 29 if ( empty( $meta['tooltip'] ) ) { 30 30 return $before; … … 63 63 $border_rule = $border ? $border['all'] .'px ' . $border['style'] . ' ' . $border['color'] : 'none'; 64 64 65 65 66 66 $style .= sprintf( ' 67 67 .itt_globe_%11$s.itt_globe_tooltip { -
interactive-globes/trunk/src/Features/Tooltip/TooltipFeature.php
r3098987 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Features\Tooltip;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Features\Tooltip; 3 3 4 use Saltus\WP\ Framework\Infrastructure\Service\{4 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Service\{ 5 5 Actionable, 6 6 Service, -
interactive-globes/trunk/src/Features/Updater/UpdateCore.php
r3098987 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Features\Updater;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Features\Updater; 3 3 4 use Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Project;5 use Saltus\WP\ Framework\Infrastructure\Container\Invalid;6 use Saltus\WP\ Framework\Infrastructure\Plugin\Registerable;4 use Saltus\WP\Plugin\InteractiveGlobes\Project; 5 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Container\Invalid; 6 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Plugin\Registerable; 7 7 8 8 /** -
interactive-globes/trunk/src/Features/Updater/UpdateFeature.php
r3098987 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Features\Updater;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Features\Updater; 3 3 4 use Saltus\WP\ Framework\Infrastructure\Service\{4 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Service\{ 5 5 Actionable, 6 6 Service, -
interactive-globes/trunk/src/Loader.php
r2986425 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes;2 namespace Saltus\WP\Plugin\InteractiveGlobes; 3 3 4 4 /** -
interactive-globes/trunk/src/Plugin/Assets.php
r3207680 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Plugin;3 4 use Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Project;5 6 use Saltus\WP\ Framework\Infrastructure\Container\ServiceContainer;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Plugin; 3 4 use Saltus\WP\Plugin\InteractiveGlobes\Project; 5 6 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Container\ServiceContainer; 7 7 8 8 /** … … 25 25 26 26 /** 27 * Suffix for filename28 */29 private $suffix;30 31 /**32 * Assets Directory33 */34 private $dir;35 36 /**37 27 * Define Assets 38 28 * … … 41 31 public function __construct( Project $project, ServiceContainer $services ) { 42 32 $this->project = $project; 43 $this->dir = WP_ENV === 'development' ? '' : 'dist';44 $this->suffix = WP_ENV === 'development' ? '' : '.min';45 33 $this->services = $services; 46 34 } 35 47 36 public function add_type_attribute( $tag, $handle, $src ) { 48 // if not your script, do nothing and return original $tag37 // if not the plugins's scripts, do nothing and return original $tag 49 38 if ( $this->project->name . '_globe' !== $handle && 50 39 $this->project->name . '_globe-pro' !== $handle && … … 56 45 57 46 // change the script tag by adding type="module" and return it. 47 //phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript 58 48 $tag = '<script type="module" src="' . esc_url( $src ) . '"></script>'; 59 49 return $tag; … … 67 57 return; 68 58 } 69 $this->load_public_assets();70 } 59 } 60 71 61 /** 72 62 * Load admin assets. … … 77 67 add_action( 'admin_enqueue_scripts', array( $this, 'load_globe_styles' ) ); 78 68 add_action( 'admin_enqueue_scripts', array( $this, 'load_admin_styles' ) ); 79 add_action( 'admin_enqueue_scripts', array( $this, 'load_globe_scripts' ) );80 69 add_action( 'admin_enqueue_scripts', array( $this, 'load_admin_scripts' ) ); 81 70 } 82 71 83 72 /** 84 * Load globe assets85 *86 * @param array $meta87 * @return void88 */89 public function load_public_assets() {90 91 add_action( 'wp_enqueue_scripts', array( $this, 'load_globe_assets' ) );92 }93 94 public function load_globe_assets() {95 96 $this->load_globe_styles();97 $this->load_globe_scripts();98 }99 100 /**101 73 * Load globe styles 102 74 * 103 75 */ 104 76 public function load_globe_styles() { 77 78 if ( is_admin() && ! $this->is_globe_admin() ) { 79 return; 80 } 105 81 106 82 try { … … 112 88 } 113 89 } 114 if ( is_admin() && ! $this->is_globe_admin() ) {115 return;116 }117 90 118 91 $name = $assets->register_style( … … 138 111 } 139 112 140 /** 141 * Load globe scripts 142 * 143 */ 144 public function load_globe_scripts() { 145 if ( is_admin() && ! $this->is_view_editor() ) { 113 114 /** 115 * Load admin styles 116 * 117 */ 118 public function load_admin_styles() { 119 120 if ( ! $this->is_globe_admin() ) { 146 121 return; 147 122 } … … 150 125 $assets = $this->services->get( 'assets' )->create(); 151 126 } catch ( \Exception $exception ) { 152 153 127 if ( defined( 'WP_DEBUG' ) && WP_DEBUG === true ) { 154 128 // phpcs:ignore WordPress.PHP.DevelopmentFunctions 155 error_log( 'Failed to load styles' );129 error_log( 'Failed to load assets' ); 156 130 } 157 131 } 158 $name = $assets->register_script( 159 '/assets/js/vendor/public/globe.gl.js', 160 [], 161 true 162 ); 163 wp_enqueue_script( $name ); 164 } 165 166 /** 167 * Load admin styles 168 * 169 */ 170 public function load_admin_styles() { 171 172 if ( ! $this->is_globe_admin() ) { 173 return; 174 } 175 // might need styles across all admin, because of menu styles 176 wp_register_style( 177 $this->project->name . '_admin', 178 plugins_url( "{$this->dir}/assets/css/admin/admin-style{$this->suffix}.css", $this->project->file_path ), 179 false, 180 $this->project->version 181 ); 182 183 wp_enqueue_style( $this->project->name . '_admin' ); 132 $name = $assets->register_style( 133 '/assets/css/admin/admin-style.css', 134 [] 135 ); 136 wp_enqueue_style( $name ); 184 137 } 185 138 … … 190 143 public function load_admin_scripts() { 191 144 145 if ( ! is_admin() ) { 146 return; 147 } 192 148 if ( ! $this->is_view_editor() ) { 193 149 return; … … 290 246 global $typenow; 291 247 global $pagenow; 292 return true; //TODO by pcarvalho: revert this293 248 if ( $typenow !== 'iglobe' || ( $pagenow !== 'post.php' && $pagenow !== 'post-new.php' ) ) { 294 249 return false; -
interactive-globes/trunk/src/Plugin/I18n.php
r3098987 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Plugin;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Plugin; 3 3 4 4 /** -
interactive-globes/trunk/src/Plugin/Lifecycle.php
r3098987 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Plugin;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Plugin; 3 3 4 use Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Project;4 use Saltus\WP\Plugin\InteractiveGlobes\Project; 5 5 6 6 /** -
interactive-globes/trunk/src/Project.php
r2986425 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes;2 namespace Saltus\WP\Plugin\InteractiveGlobes; 3 3 4 4 /** -
interactive-globes/trunk/src/Services/Assets/AssetsCore.php
r3158721 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Services\Assets;3 4 use Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Project;5 use Saltus\WP\ Framework\Infrastructure\Container\Invalid;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Services\Assets; 3 4 use Saltus\WP\Plugin\InteractiveGlobes\Project; 5 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Container\Invalid; 6 6 7 7 /** -
interactive-globes/trunk/src/Services/Assets/AssetsService.php
r2986425 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Services\Assets;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Services\Assets; 3 3 4 use Saltus\WP\ Framework\Infrastructure\Service\{4 use Saltus\WP\Plugin\InteractiveGlobes\Saltus\WP\Framework\Infrastructure\Service\{ 5 5 Service 6 6 }; 7 8 use Saltus\WP\Plugin\InteractiveGlobes\Services\Creatable; 7 9 8 10 /** 9 11 * Manage Assets like scripts and styles. 10 12 */ 11 class AssetsService implements Service {13 class AssetsService implements Service, Creatable { 12 14 13 15 private static $instance; … … 26 28 * @return object The new instance 27 29 */ 28 public static function make( $name, $project, $args ) {29 return self::$instance;30 }31 32 30 public static function create() { 33 31 return self::$instance; -
interactive-globes/trunk/src/Services/Assets/HasAssets.php
r3158721 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Services\Assets;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Services\Assets; 3 3 4 4 interface HasAssets { -
interactive-globes/trunk/src/Services/Model/Assembler.php
r3158721 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Services\Model;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Services\Model; 3 3 4 4 /** -
interactive-globes/trunk/src/Services/Model/Base/Features.php
r3207680 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Services\Model\Base;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Services\Model\Base; 3 3 4 4 /** -
interactive-globes/trunk/src/Services/Model/Base/Labels.php
r3115164 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Services\Model\Base;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Services\Model\Base; 3 3 4 4 /** -
interactive-globes/trunk/src/Services/Model/Base/Meta.php
r3158721 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Services\Model\Base;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Services\Model\Base; 3 3 4 4 /** … … 65 65 <option value="itt_globe_dotlabel">Dot Label</option> 66 66 </select> 67 67 68 68 </div> 69 69 </div> … … 138 138 ), 139 139 ), 140 'altitude' => array( 141 'type' => 'spinner', 142 'default' => 1.7, 143 'step' => 0.01, 144 'desc' => __( 'Controls the initial globe scale', 'interactive-globes' ), 145 'title' => __( 'Initial altitude/scale', 'interactive-globes' ), 140 'altitudeOptions' => array( 141 'type' => 'fieldset', 142 'title' => __( 'Altitude/Scale Settings', 'interactive-globes' ), 143 'subtitle' => __( 'Controls the default zoom position and the min/max zoom levels (but the other way around). Think of it as the "camara" altitude. The smaller the value, the closer to the globe surface. Check the "Altitude" value in the "Center Coordinates" in the preview.', 'interactive-globes' ), 144 'fields' => array( 145 'altitude' => array( 146 'type' => 'spinner', 147 'default' => 1.7, 148 'step' => 0.01, 149 'desc' => __( 'Controls the initial globe scale', 'interactive-globes' ), 150 'title' => __( 'Initial', 'interactive-globes' ), 151 ), 152 'minAltitude' => array( 153 'type' => 'spinner', 154 'default' => '', 155 'step' => 0.1, 156 'desc' => __( 'Controls the minimum altitude/scale. Use this option to prevent users to zoom in too much into the globe. The smaller the value, the closer to the globe surface. Leave empty to disable.', 'interactive-globes' ), 157 'title' => __( 'Minimum', 'interactive-globes' ), 158 ), 159 'maxAltitude' => array( 160 'type' => 'spinner', 161 'default' => '', 162 'step' => 0.1, 163 'desc' => __( 'Controls the maximum altitude/scale. Use this option to prevent users to zoom out too much from the globe. The larger the value, the further away from the globe. Leave empty to disable.', 'interactive-globes' ), 164 'title' => __( 'Maximum', 'interactive-globes' ), 165 ), 166 ), 146 167 ), 147 168 'centerCoordinates' => array( -
interactive-globes/trunk/src/Services/Model/Base/MetaDotLabel.php
r3207680 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Services\Model\Base;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Services\Model\Base; 3 3 4 use Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Features\Meta\MetaCore;4 use Saltus\WP\Plugin\InteractiveGlobes\Features\Meta\MetaCore; 5 5 6 6 /** -
interactive-globes/trunk/src/Services/Model/Base/MetaPoint.php
r3158721 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Services\Model\Base;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Services\Model\Base; 3 3 4 use Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Features\Meta\MetaCore;4 use Saltus\WP\Plugin\InteractiveGlobes\Features\Meta\MetaCore; 5 5 /** 6 6 * common meta … … 19 19 $meta['globe_info']['sections']['points'] = [ 20 20 21 'title' => __( ' Points', 'interactive-globes' ),21 'title' => __( '3D Markers', 'interactive-globes' ), 22 22 'icon' => 'fa fa-circle fa-lg', 23 23 'class' => 'tab_itt_globe_point', … … 25 25 'points_info' => array( 26 26 'type' => 'content', 27 'content' => '<div class="itt_globe_admin_example"><div>' . __( 'Add <strong> cylinderpoint markers</strong> to the globe. <br>Click "Add New Point" below to start adding points.', 'interactive-globes' )27 'content' => '<div class="itt_globe_admin_example"><div>' . __( 'Add <strong>3D point markers</strong> to the globe. <br>Click "Add New Point" below to start adding points.', 'interactive-globes' ) 28 28 . '<br> ' . 29 29 /* translators: %s will be a link to an external website */ … … 107 107 'default' => 'none', 108 108 ), 109 // placeholder for type field 110 'type' => array( 111 'type' => 'content', 112 'class' => 'hidden', 113 'content' => '', 114 ), 109 115 'radius' => array( 110 116 'type' => 'spinner', 111 117 'default' => 20, 112 118 'step' => 1, 113 'title' => __( 'Radius ', 'interactive-globes' ),119 'title' => __( 'Radius / Size', 'interactive-globes' ), 114 120 ), 115 121 'altitude' => array( -
interactive-globes/trunk/src/Services/Model/Base/Model.php
r3115164 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Services\Model\Base;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Services\Model\Base; 3 3 4 4 /** -
interactive-globes/trunk/src/Services/Model/Base/Options.php
r3115164 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Services\Model\Base;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Services\Model\Base; 3 3 4 4 /** -
interactive-globes/trunk/src/Services/Model/Base/SafeNL2BR.php
r3207680 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Services\Model\Base;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Services\Model\Base; 3 3 4 4 /** -
interactive-globes/trunk/src/Services/Model/Base/Settings.php
r3207680 r3263746 1 1 <?php 2 namespace Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Services\Model\Base;2 namespace Saltus\WP\Plugin\InteractiveGlobes\Services\Model\Base; 3 3 4 4 /** -
interactive-globes/trunk/src/models/00-globe-free.php
r3207680 r3263746 8 8 9 9 // Assemblers 10 use Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Services\Model\Assembler;11 use Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Services\Model\Base;10 use Saltus\WP\Plugin\InteractiveGlobes\Services\Model\Assembler; 11 use Saltus\WP\Plugin\InteractiveGlobes\Services\Model\Base; 12 12 13 13 function itt_globe_model_free() { -
interactive-globes/trunk/src/models/01-globe-dotlabel.php
r3207680 r3263746 1 1 <?php 2 2 3 use Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Services\Model\Base\SafeNL2BR;3 use Saltus\WP\Plugin\InteractiveGlobes\Services\Model\Base\SafeNL2BR; 4 4 $options = get_option( 'ittglobes' ); 5 5 … … 239 239 add_filter( 'itt_globes/render/post_setup_meta', 'add_dotlabel_to_shortcode', 10, 2 ); 240 240 function add_dotlabel_to_shortcode( $globe_meta, $globe_id ) { 241 242 if ( $globe_id === 0 ) { 243 return $globe_meta; 244 } 241 245 // dotlabel 242 246 $args = [ -
interactive-globes/trunk/src/models/02-globe-point.php
r3207680 r3263746 1 1 <?php 2 use Saltus\WP\Plugin\ Saltus\InteractiveGlobes\Services\Model\Base\SafeNL2BR;2 use Saltus\WP\Plugin\InteractiveGlobes\Services\Model\Base\SafeNL2BR; 3 3 4 4 $options = get_option( 'ittglobes' ); … … 47 47 ], 48 48 'labels' => [ 49 'has_one' => ' Point',50 'has_many' => ' Points',49 'has_one' => 'Marker', 50 'has_many' => 'Markers', 51 51 // optional, but better for translation 52 52 'overrides' => array( 53 53 'labels' => array( 54 'name' => __( ' Points', 'interactive-globes' ),55 'singular_name' => __( ' Point', 'interactive-globes' ),56 'menu_name' => __( ' Points', 'interactive-globes' ),57 'name_admin_bar' => __( ' Points', 'interactive-globes' ),54 'name' => __( '3D Markers', 'interactive-globes' ), 55 'singular_name' => __( 'Marker', 'interactive-globes' ), 56 'menu_name' => __( 'Markers', 'interactive-globes' ), 57 'name_admin_bar' => __( 'Marker', 'interactive-globes' ), 58 58 'add_new' => __( 'Create New', 'interactive-globes' ), 59 'add_new_item' => __( 'Create New Point', 'interactive-globes' ),59 'add_new_item' => __( 'Create New Marker', 'interactive-globes' ), 60 60 'edit_item' => __( 'Edit', 'interactive-globes' ), 61 'new_item' => __( 'New Point', 'interactive-globes' ),62 'view_item' => __( 'View Point', 'interactive-globes' ),63 'view_items' => __( 'View Points', 'interactive-globes' ),64 'search_items' => __( 'Search Points', 'interactive-globes' ),65 'not_found' => __( 'No Points found.', 'interactive-globes' ),66 'not_found_in_trash' => __( 'No Points found in Trash.', 'interactive-globes' ),61 'new_item' => __( 'New Marker', 'interactive-globes' ), 62 'view_item' => __( 'View Marker', 'interactive-globes' ), 63 'view_items' => __( 'View Markers', 'interactive-globes' ), 64 'search_items' => __( 'Search Markers', 'interactive-globes' ), 65 'not_found' => __( 'No Markers found.', 'interactive-globes' ), 66 'not_found_in_trash' => __( 'No Markers found in Trash.', 'interactive-globes' ), 67 67 'parent_item-colon' => __( 'Parent Globe:', 'interactive-globes' ), 68 'all_items' => '⚬ ' . __( ' Points', 'interactive-globes' ),69 'archives' => __( ' PointArchives', 'interactive-globes' ),70 'attributes' => __( ' PointAttributes', 'interactive-globes' ),71 'insert_into_item' => __( 'Insert into Point', 'interactive-globes' ),72 'uploaded_to_this_item' => __( 'Uploaded to this Point', 'interactive-globes' ),73 'filter_items_list' => __( 'Filter Pointlist', 'interactive-globes' ),74 'items_list_navigation' => __( ' Pointlist navigation', 'interactive-globes' ),75 'items_list' => __( ' Pointlist', 'interactive-globes' ),76 'featured_image' => __( ' PointCover Image', 'interactive-globes' ),77 'set_featured_image' => __( 'Set PointCover Image', 'interactive-globes' ),78 'remove_featured_image' => __( 'Remove PointCover', 'interactive-globes' ),79 'use_featured_image' => __( 'Use as PointCover', 'interactive-globes' ),68 'all_items' => '⚬ ' . __( 'Markers', 'interactive-globes' ), 69 'archives' => __( 'Marker Archives', 'interactive-globes' ), 70 'attributes' => __( 'Marker Attributes', 'interactive-globes' ), 71 'insert_into_item' => __( 'Insert into Marker', 'interactive-globes' ), 72 'uploaded_to_this_item' => __( 'Uploaded to this Marker', 'interactive-globes' ), 73 'filter_items_list' => __( 'Filter Marker list', 'interactive-globes' ), 74 'items_list_navigation' => __( 'Marker list navigation', 'interactive-globes' ), 75 'items_list' => __( 'Marker list', 'interactive-globes' ), 76 'featured_image' => __( 'Marker Cover Image', 'interactive-globes' ), 77 'set_featured_image' => __( 'Set Marker Cover Image', 'interactive-globes' ), 78 'remove_featured_image' => __( 'Remove Marker Cover', 'interactive-globes' ), 79 'use_featured_image' => __( 'Use as Marker Cover', 'interactive-globes' ), 80 80 ), 81 81 // you can use the placeholders {permalink}, {preview_url}, {date} 82 82 'messages' => array( 83 'post_updated' => __( ' Pointinformation updated. <a href="{permalink}" target="_blank">View Globe</a>', 'interactive-globes' ),84 'post_updated_short' => __( ' Pointinfo updated', 'interactive-globes' ),83 'post_updated' => __( 'Marker information updated. <a href="{permalink}" target="_blank">View Globe</a>', 'interactive-globes' ), 84 'post_updated_short' => __( 'Marker info updated', 'interactive-globes' ), 85 85 'custom_field_updated' => __( 'Custom field updated', 'interactive-globes' ), 86 86 'custom_field_deleted' => __( 'Custom field deleted', 'interactive-globes' ), 87 'restored_to_revision' => __( ' Pointcontent restored from revision', 'interactive-globes' ),88 'post_published' => __( ' PointPublished', 'interactive-globes' ),89 'post_saved' => __( ' Pointinformation saved.', 'interactive-globes' ),87 'restored_to_revision' => __( 'Marker content restored from revision', 'interactive-globes' ), 88 'post_published' => __( 'Marker Published', 'interactive-globes' ), 89 'post_saved' => __( 'Marker information saved.', 'interactive-globes' ), 90 90 'post_submitted' => __( 'Point submitted. <a href="{preview_url}" target="_blank">Preview</a>', 'interactive-globes' ), 91 91 'post_schedulled' => __( 'Point scheduled for {date}. <a href="{preview_url}" target="_blank">Preview</a>', 'interactive-globes' ), … … 93 93 ), 94 94 'bulk_messages' => array( 95 'updated_singular' => __( ' Pointupdated. Yay!', 'interactive-globes' ),96 'updated_plural' => __( '%s Pointupdated. Yay!', 'interactive-globes' ),97 'locked_singular' => __( ' Pointnot updated, somebody is editing it', 'interactive-globes' ),98 'locked_plural' => __( '%s Pointnot updated, somebody is editing them', 'interactive-globes' ),99 'deleted_singular' => __( ' Pointpermanetly deleted. Fahrenheit 451 team was here?', 'interactive-globes' ),100 'deleted_plural' => __( '%s Pointpermanently deleted. Why? :(', 'interactive-globes' ),101 'trashed_singular' => __( ' Pointmoved to the trash. I\'m sad :(', 'interactive-globes' ),102 'trashed_plural' => __( '%s Pointmoved to the trash. Why? :(', 'interactive-globes' ),103 'untrashed_singular' => __( ' Pointrecovered from trash. Well done!', 'interactive-globes' ),104 'untrashed_plural' => __( '%s Pointsaved from the enemies!', 'interactive-globes' ),95 'updated_singular' => __( 'Marker updated. Yay!', 'interactive-globes' ), 96 'updated_plural' => __( '%s Marker updated. Yay!', 'interactive-globes' ), 97 'locked_singular' => __( 'Marker not updated, somebody is editing it', 'interactive-globes' ), 98 'locked_plural' => __( '%s Marker not updated, somebody is editing them', 'interactive-globes' ), 99 'deleted_singular' => __( 'Marker permanetly deleted. Fahrenheit 451 team was here?', 'interactive-globes' ), 100 'deleted_plural' => __( '%s Marker permanently deleted. Why? :(', 'interactive-globes' ), 101 'trashed_singular' => __( 'Marker moved to the trash. I\'m sad :(', 'interactive-globes' ), 102 'trashed_plural' => __( '%s Marker moved to the trash. Why? :(', 'interactive-globes' ), 103 'untrashed_singular' => __( 'Marker recovered from trash. Well done!', 'interactive-globes' ), 104 'untrashed_plural' => __( '%s Marker saved from the enemies!', 'interactive-globes' ), 105 105 ), 106 106 // overrides some of the available button labels and placeholders 107 107 'ui' => array( 108 'enter_title_here' => __( 'Enter Pointname here', 'interactive-globes' ),108 'enter_title_here' => __( 'Enter Marker name here', 'interactive-globes' ), 109 109 ), 110 110 ), … … 235 235 add_filter( 'itt_globes/render/post_setup_meta', 'add_point_to_shortcode', 10, 2 ); 236 236 function add_point_to_shortcode( $globe_meta, $globe_id ) { 237 $args = [ 237 238 if ( $globe_id === 0 ) { 239 return $globe_meta; 240 } 241 $args = [ 238 242 'post_type' => 'itt_globe_point', 239 243 'posts_per_page' => -1, … … 247 251 ], 248 252 ]; 249 $cpt_list = []; 253 $cpt_points_list = []; 254 $cpt_objects_list = []; 255 250 256 $cpt_query = new \WP_Query( $args ); 251 257 $click_actions = []; … … 273 279 $cpt_info['globe_id'] = $globe_id; 274 280 275 $cpt_list[] = $cpt_info; 281 // check type - cylinder is the default point type 282 if ( empty( $cpt_info['useCustom'] ) || $cpt_info['useCustom'] === false || empty( $cpt_info['type'] ) ) { 283 $cpt_info['type'] = isset( $globe_meta['pointDefaults']['type'] ) ? $globe_meta['pointDefaults']['type'] : 'cylinder'; 284 } 285 286 if ( ! empty( $cpt_info['type'] ) && is_array( $cpt_info['type'] ) ) { 287 $cpt_info['type'] = $cpt_info['type'][0]; 288 } 289 290 if ( $cpt_info['type'] === 'cylinder' ) { 291 $cpt_points_list[] = $cpt_info; 292 } else { 293 $cpt_objects_list[] = $cpt_info; 294 } 276 295 277 296 if ( ! empty( $cpt_info['action'] ) && 278 297 $cpt_info['action'] !== 'none' ) { 279 298 280 if (is_array($cpt_info['action'])) {299 if ( is_array( $cpt_info['action'] ) ) { 281 300 $cpt_info['action'] = $cpt_info['action'][0]; 282 301 } 283 302 284 303 $click_actions[] = $cpt_info['action']; 285 304 } … … 289 308 wp_reset_query(); 290 309 291 $globe_meta['points'] = $cpt_list; 310 $globe_meta['points'] = $cpt_points_list; 311 $globe_meta['objects'] = $cpt_objects_list; 292 312 293 313 $globe_meta['enabled_click_actions'] = $globe_meta['enabled_click_actions'] ?? []; -
interactive-globes/trunk/vendor/autoload.php
r3098987 r3263746 23 23 require_once __DIR__ . '/composer/autoload_real.php'; 24 24 25 return ComposerAutoloaderInit2 a3c1dd1c0353fd131878c23d1c156ec::getLoader();25 return ComposerAutoloaderInit25dbc9f91dd60cec63ebce8f5ddfa9d1::getLoader(); -
interactive-globes/trunk/vendor/composer/InstalledVersions.php
r2986425 r3263746 32 32 */ 33 33 private static $installed; 34 35 /** 36 * @var bool 37 */ 38 private static $installedIsLocalDir; 34 39 35 40 /** … … 310 315 self::$installed = $data; 311 316 self::$installedByVendor = array(); 317 318 // when using reload, we disable the duplicate protection to ensure that self::$installed data is 319 // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not, 320 // so we have to assume it does not, and that may result in duplicate data being returned when listing 321 // all installed packages for example 322 self::$installedIsLocalDir = false; 312 323 } 313 324 … … 323 334 324 335 $installed = array(); 336 $copiedLocalDir = false; 325 337 326 338 if (self::$canGetVendors) { 339 $selfDir = strtr(__DIR__, '\\', '/'); 327 340 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { 341 $vendorDir = strtr($vendorDir, '\\', '/'); 328 342 if (isset(self::$installedByVendor[$vendorDir])) { 329 343 $installed[] = self::$installedByVendor[$vendorDir]; … … 331 345 /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ 332 346 $required = require $vendorDir.'/composer/installed.php'; 333 $installed[] = self::$installedByVendor[$vendorDir] = $required; 334 if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { 335 self::$installed = $installed[count($installed) - 1]; 347 self::$installedByVendor[$vendorDir] = $required; 348 $installed[] = $required; 349 if (self::$installed === null && $vendorDir.'/composer' === $selfDir) { 350 self::$installed = $required; 351 self::$installedIsLocalDir = true; 336 352 } 353 } 354 if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) { 355 $copiedLocalDir = true; 337 356 } 338 357 } … … 351 370 } 352 371 353 if (self::$installed !== array() ) {372 if (self::$installed !== array() && !$copiedLocalDir) { 354 373 $installed[] = self::$installed; 355 374 } -
interactive-globes/trunk/vendor/composer/LICENSE
r3207680 r3263746 1 1 2 Copyright (c) Nils Adermann, Jordi Boggiano 2 3 … … 18 19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 20 THE SOFTWARE. 21 -
interactive-globes/trunk/vendor/composer/autoload_classmap.php
r3207680 r3263746 7 7 8 8 return array( 9 'CSF' => $vendorDir . '/saltus/framework/lib/codestar-framework/classes/setup.class.php', 10 'CSF_Abstract' => $vendorDir . '/saltus/framework/lib/codestar-framework/classes/abstract.class.php', 11 'CSF_Comment_Metabox' => $vendorDir . '/saltus/framework/lib/codestar-framework/classes/comment-options.class.php', 12 'CSF_Customize_Options' => $vendorDir . '/saltus/framework/lib/codestar-framework/classes/customize-options.class.php', 13 'CSF_Field_accordion' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/accordion/accordion.php', 14 'CSF_Field_background' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/background/background.php', 15 'CSF_Field_backup' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/backup/backup.php', 16 'CSF_Field_border' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/border/border.php', 17 'CSF_Field_button_set' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/button_set/button_set.php', 18 'CSF_Field_callback' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/callback/callback.php', 19 'CSF_Field_checkbox' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/checkbox/checkbox.php', 20 'CSF_Field_code_editor' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/code_editor/code_editor.php', 21 'CSF_Field_color' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/color/color.php', 22 'CSF_Field_color_group' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/color_group/color_group.php', 23 'CSF_Field_content' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/content/content.php', 24 'CSF_Field_date' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/date/date.php', 25 'CSF_Field_datetime' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/datetime/datetime.php', 26 'CSF_Field_dimensions' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/dimensions/dimensions.php', 27 'CSF_Field_fieldset' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/fieldset/fieldset.php', 28 'CSF_Field_gallery' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/gallery/gallery.php', 29 'CSF_Field_group' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/group/group.php', 30 'CSF_Field_heading' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/heading/heading.php', 31 'CSF_Field_icon' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/icon/icon.php', 32 'CSF_Field_image_select' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/image_select/image_select.php', 33 'CSF_Field_link' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/link/link.php', 34 'CSF_Field_link_color' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/link_color/link_color.php', 35 'CSF_Field_map' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/map/map.php', 36 'CSF_Field_media' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/media/media.php', 37 'CSF_Field_notice' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/notice/notice.php', 38 'CSF_Field_number' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/number/number.php', 39 'CSF_Field_palette' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/palette/palette.php', 40 'CSF_Field_radio' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/radio/radio.php', 41 'CSF_Field_repeater' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/repeater/repeater.php', 42 'CSF_Field_select' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/select/select.php', 43 'CSF_Field_slider' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/slider/slider.php', 44 'CSF_Field_sortable' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/sortable/sortable.php', 45 'CSF_Field_sorter' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/sorter/sorter.php', 46 'CSF_Field_spacing' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/spacing/spacing.php', 47 'CSF_Field_spinner' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/spinner/spinner.php', 48 'CSF_Field_subheading' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/subheading/subheading.php', 49 'CSF_Field_submessage' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/submessage/submessage.php', 50 'CSF_Field_switcher' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/switcher/switcher.php', 51 'CSF_Field_tabbed' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/tabbed/tabbed.php', 52 'CSF_Field_text' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/text/text.php', 53 'CSF_Field_textarea' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/textarea/textarea.php', 54 'CSF_Field_typography' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/typography/typography.php', 55 'CSF_Field_upload' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/upload/upload.php', 56 'CSF_Field_wp_editor' => $vendorDir . '/saltus/framework/lib/codestar-framework/fields/wp_editor/wp_editor.php', 57 'CSF_Fields' => $vendorDir . '/saltus/framework/lib/codestar-framework/classes/fields.class.php', 58 'CSF_Metabox' => $vendorDir . '/saltus/framework/lib/codestar-framework/classes/metabox-options.class.php', 59 'CSF_Nav_Menu_Options' => $vendorDir . '/saltus/framework/lib/codestar-framework/classes/nav-menu-options.class.php', 60 'CSF_Options' => $vendorDir . '/saltus/framework/lib/codestar-framework/classes/admin-options.class.php', 61 'CSF_Profile_Options' => $vendorDir . '/saltus/framework/lib/codestar-framework/classes/profile-options.class.php', 62 'CSF_Setup' => $vendorDir . '/saltus/framework/lib/codestar-framework/classes/setup.class.php', 63 'CSF_Shortcoder' => $vendorDir . '/saltus/framework/lib/codestar-framework/classes/shortcode-options.class.php', 64 'CSF_Taxonomy_Options' => $vendorDir . '/saltus/framework/lib/codestar-framework/classes/taxonomy-options.class.php', 65 'CSF_Walker_Nav_Menu_Edit' => $vendorDir . '/saltus/framework/lib/codestar-framework/functions/walker.php', 66 'CSF_Welcome' => $vendorDir . '/saltus/framework/lib/codestar-framework/views/welcome.php', 67 'CSF_Widget' => $vendorDir . '/saltus/framework/lib/codestar-framework/classes/widget-options.class.php', 68 'ComposerAutoloaderInitc8718d2aa33a4293f290bf2a9e534956' => $baseDir . '/../vendor-prefixed/composer/autoload_real.php', 69 'Composer\\Autoload\\ClassLoader' => $baseDir . '/../vendor-prefixed/composer/ClassLoader.php', 70 'Composer\\Autoload\\ComposerStaticInitc8718d2aa33a4293f290bf2a9e534956' => $baseDir . '/../vendor-prefixed/composer/autoload_static.php', 9 71 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', 10 72 'Noodlehaus\\AbstractConfig' => $vendorDir . '/hassankhan/config/src/AbstractConfig.php', … … 83 145 'Saltus\\WP\\Framework\\Models\\PostType' => $vendorDir . '/saltus/framework/src/Models/PostType.php', 84 146 'Saltus\\WP\\Framework\\Models\\Taxonomy' => $vendorDir . '/saltus/framework/src/Models/Taxonomy.php', 85 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Core' => $baseDir . '/../src/Core.php', 86 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\CorePro' => $baseDir . '/../src/CorePro.php', 87 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Exception\\SaltusFrameworkThrowable' => $baseDir . '/../src/Exception/SaltusFrameworkThrowable.php', 88 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\ClickActionOption' => $baseDir . '/../src/Features/ClickActions/ClickActionOption.php', 89 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentAbove' => $baseDir . '/../src/Features/ClickActions/DisplayContentAbove.php', 90 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentBelow' => $baseDir . '/../src/Features/ClickActions/DisplayContentBelow.php', 91 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentBelowScroll' => $baseDir . '/../src/Features/ClickActions/DisplayContentBelowScroll.php', 92 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentLeft' => $baseDir . '/../src/Features/ClickActions/DisplayContentLeft.php', 93 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentLightbox' => $baseDir . '/../src/Features/ClickActions/DisplayContentLightbox.php', 94 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentRight' => $baseDir . '/../src/Features/ClickActions/DisplayContentRight.php', 95 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayIframeLightbox' => $baseDir . '/../src/Features/ClickActions/DisplayIframeLightbox.php', 96 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\CptManager\\CptManagerCore' => $baseDir . '/../src/Features/CptManager/CptManagerCore.php', 97 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\CptManager\\CptManagerFeature' => $baseDir . '/../src/Features/CptManager/CptManagerFeature.php', 98 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\DotLabel\\DotLabelProMeta' => $baseDir . '/../src/Features/DotLabel/DotLabelProMeta.php', 99 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Duplicate\\DuplicateCore' => $baseDir . '/../src/Features/Duplicate/DuplicateCore.php', 100 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Duplicate\\DuplicateFeature' => $baseDir . '/../src/Features/Duplicate/DuplicateFeature.php', 101 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\LiveFilter\\LiveFilterCore' => $baseDir . '/../src/Features/LiveFilter/LiveFilterCore.php', 102 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\LiveFilter\\LiveFilterFeature' => $baseDir . '/../src/Features/LiveFilter/LiveFilterFeature.php', 103 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Meta\\MetaCore' => $baseDir . '/../src/Features/Meta/MetaCore.php', 104 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Meta\\MetaFeature' => $baseDir . '/../src/Features/Meta/MetaFeature.php', 105 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Point\\PointProMeta' => $baseDir . '/../src/Features/Point/PointProMeta.php', 106 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Sales\\UpsellPage' => $baseDir . '/../src/Features/Sales/UpsellPage.php', 107 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Sales\\UpsellPageFeature' => $baseDir . '/../src/Features/Sales/UpsellPageFeature.php', 108 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\SearchDropdown\\SearchDropdownCore' => $baseDir . '/../src/Features/SearchDropdown/SearchDropdownCore.php', 109 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\SearchDropdown\\SearchDropdownFeature' => $baseDir . '/../src/Features/SearchDropdown/SearchDropdownFeature.php', 110 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Shortcode\\ShortcodeCore' => $baseDir . '/../src/Features/Shortcode/ShortcodeCore.php', 111 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Shortcode\\ShortcodeFeature' => $baseDir . '/../src/Features/Shortcode/ShortcodeFeature.php', 112 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\SinglePage\\SinglePageCore' => $baseDir . '/../src/Features/SinglePage/SinglePageCore.php', 113 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\SinglePage\\SinglePageFeature' => $baseDir . '/../src/Features/SinglePage/SinglePageFeature.php', 114 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Tooltip\\TooltipCore' => $baseDir . '/../src/Features/Tooltip/TooltipCore.php', 115 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Tooltip\\TooltipFeature' => $baseDir . '/../src/Features/Tooltip/TooltipFeature.php', 116 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Updater\\UpdateCore' => $baseDir . '/../src/Features/Updater/UpdateCore.php', 117 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Updater\\UpdateFeature' => $baseDir . '/../src/Features/Updater/UpdateFeature.php', 118 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Loader' => $baseDir . '/../src/Loader.php', 119 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Plugin\\Assets' => $baseDir . '/../src/Plugin/Assets.php', 120 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Plugin\\Freemius' => $baseDir . '/../src/Plugin/Freemius.php', 121 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Plugin\\I18n' => $baseDir . '/../src/Plugin/I18n.php', 122 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Plugin\\Lifecycle' => $baseDir . '/../src/Plugin/Lifecycle.php', 123 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Prepare' => $baseDir . '/../src/Prepare.php', 124 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Project' => $baseDir . '/../src/Project.php', 125 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Assets\\AssetsCore' => $baseDir . '/../src/Services/Assets/AssetsCore.php', 126 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Assets\\AssetsService' => $baseDir . '/../src/Services/Assets/AssetsService.php', 127 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Assets\\HasAssets' => $baseDir . '/../src/Services/Assets/HasAssets.php', 128 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Assembler' => $baseDir . '/../src/Services/Model/Assembler.php', 129 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\Features' => $baseDir . '/../src/Services/Model/Base/Features.php', 130 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\Labels' => $baseDir . '/../src/Services/Model/Base/Labels.php', 131 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\Meta' => $baseDir . '/../src/Services/Model/Base/Meta.php', 132 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\MetaDotLabel' => $baseDir . '/../src/Services/Model/Base/MetaDotLabel.php', 133 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\MetaPoint' => $baseDir . '/../src/Services/Model/Base/MetaPoint.php', 134 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\Model' => $baseDir . '/../src/Services/Model/Base/Model.php', 135 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\Options' => $baseDir . '/../src/Services/Model/Base/Options.php', 136 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\SafeNL2BR' => $baseDir . '/../src/Services/Model/Base/SafeNL2BR.php', 137 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\Settings' => $baseDir . '/../src/Services/Model/Base/Settings.php', 138 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\ClickActions' => $baseDir . '/../src/Services/Model/Pro/ClickActions.php', 139 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaColor' => $baseDir . '/../src/Services/Model/Pro/MetaColor.php', 140 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaDotLabel' => $baseDir . '/../src/Services/Model/Pro/MetaDotLabel.php', 141 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaLayers' => $baseDir . '/../src/Services/Model/Pro/MetaLayers.php', 142 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaLines' => $baseDir . '/../src/Services/Model/Pro/MetaLines.php', 143 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaPoint' => $baseDir . '/../src/Services/Model/Pro/MetaPoint.php', 144 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaRegions' => $baseDir . '/../src/Services/Model/Pro/MetaRegions.php', 145 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaRotate' => $baseDir . '/../src/Services/Model/Pro/MetaRotate.php', 146 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaSearch' => $baseDir . '/../src/Services/Model/Pro/MetaSearch.php', 147 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaTooltip' => $baseDir . '/../src/Services/Model/Pro/MetaTooltip.php', 148 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\Options' => $baseDir . '/../src/Services/Model/Pro/Options.php', 149 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\PluginSettings' => $baseDir . '/../src/Services/Model/Pro/PluginSettings.php', 147 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Core' => $baseDir . '/../src/Core.php', 148 'Saltus\\WP\\Plugin\\InteractiveGlobes\\CorePro' => $baseDir . '/../src/CorePro.php', 149 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Exception\\SaltusFrameworkThrowable' => $baseDir . '/../src/Exception/SaltusFrameworkThrowable.php', 150 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\ClickActions\\ClickActionOption' => $baseDir . '/../src/Features/ClickActions/ClickActionOption.php', 151 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentAbove' => $baseDir . '/../src/Features/ClickActions/DisplayContentAbove.php', 152 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentBelow' => $baseDir . '/../src/Features/ClickActions/DisplayContentBelow.php', 153 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentBelowScroll' => $baseDir . '/../src/Features/ClickActions/DisplayContentBelowScroll.php', 154 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentLeft' => $baseDir . '/../src/Features/ClickActions/DisplayContentLeft.php', 155 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentLightbox' => $baseDir . '/../src/Features/ClickActions/DisplayContentLightbox.php', 156 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentRight' => $baseDir . '/../src/Features/ClickActions/DisplayContentRight.php', 157 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\ClickActions\\DisplayIframeLightbox' => $baseDir . '/../src/Features/ClickActions/DisplayIframeLightbox.php', 158 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\CptManager\\CptManagerCore' => $baseDir . '/../src/Features/CptManager/CptManagerCore.php', 159 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\CptManager\\CptManagerFeature' => $baseDir . '/../src/Features/CptManager/CptManagerFeature.php', 160 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\DotLabel\\DotLabelProMeta' => $baseDir . '/../src/Features/DotLabel/DotLabelProMeta.php', 161 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\Duplicate\\DuplicateCore' => $baseDir . '/../src/Features/Duplicate/DuplicateCore.php', 162 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\Duplicate\\DuplicateFeature' => $baseDir . '/../src/Features/Duplicate/DuplicateFeature.php', 163 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\LiveFilter\\LiveFilterCore' => $baseDir . '/../src/Features/LiveFilter/LiveFilterCore.php', 164 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\LiveFilter\\LiveFilterFeature' => $baseDir . '/../src/Features/LiveFilter/LiveFilterFeature.php', 165 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\Meta\\MetaCore' => $baseDir . '/../src/Features/Meta/MetaCore.php', 166 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\Meta\\MetaFeature' => $baseDir . '/../src/Features/Meta/MetaFeature.php', 167 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\Point\\PointProMeta' => $baseDir . '/../src/Features/Point/PointProMeta.php', 168 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\RegionCounter\\RegionCounterCore' => $baseDir . '/../src/Features/RegionCounter/RegionCounterCore.php', 169 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\RegionCounter\\RegionCounterFeature' => $baseDir . '/../src/Features/RegionCounter/RegionCounterFeature.php', 170 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\Sales\\UpsellPage' => $baseDir . '/../src/Features/Sales/UpsellPage.php', 171 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\Sales\\UpsellPageFeature' => $baseDir . '/../src/Features/Sales/UpsellPageFeature.php', 172 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\SearchDropdown\\SearchDropdownCore' => $baseDir . '/../src/Features/SearchDropdown/SearchDropdownCore.php', 173 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\SearchDropdown\\SearchDropdownFeature' => $baseDir . '/../src/Features/SearchDropdown/SearchDropdownFeature.php', 174 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\Shortcode\\ShortcodeCore' => $baseDir . '/../src/Features/Shortcode/ShortcodeCore.php', 175 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\Shortcode\\ShortcodeFeature' => $baseDir . '/../src/Features/Shortcode/ShortcodeFeature.php', 176 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\SinglePage\\SinglePageCore' => $baseDir . '/../src/Features/SinglePage/SinglePageCore.php', 177 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\SinglePage\\SinglePageFeature' => $baseDir . '/../src/Features/SinglePage/SinglePageFeature.php', 178 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\Tooltip\\TooltipCore' => $baseDir . '/../src/Features/Tooltip/TooltipCore.php', 179 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\Tooltip\\TooltipFeature' => $baseDir . '/../src/Features/Tooltip/TooltipFeature.php', 180 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\Updater\\UpdateCore' => $baseDir . '/../src/Features/Updater/UpdateCore.php', 181 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\Updater\\UpdateFeature' => $baseDir . '/../src/Features/Updater/UpdateFeature.php', 182 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Loader' => $baseDir . '/../src/Loader.php', 183 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\AbstractConfig' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/AbstractConfig.php', 184 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Config' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/Config.php', 185 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\ConfigInterface' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/ConfigInterface.php', 186 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\ErrorException' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/ErrorException.php', 187 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Exception' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/Exception.php', 188 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Exception\\EmptyDirectoryException' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/Exception/EmptyDirectoryException.php', 189 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Exception\\FileNotFoundException' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/Exception/FileNotFoundException.php', 190 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Exception\\ParseException' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/Exception/ParseException.php', 191 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Exception\\UnsupportedFormatException' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/Exception/UnsupportedFormatException.php', 192 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Exception\\WriteException' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/Exception/WriteException.php', 193 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Parser\\AbstractParser' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/Parser/AbstractParser.php', 194 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Parser\\Ini' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/Parser/Ini.php', 195 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Parser\\Json' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/Parser/Json.php', 196 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Parser\\ParserInterface' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/Parser/ParserInterface.php', 197 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Parser\\Php' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/Parser/Php.php', 198 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Parser\\Properties' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/Parser/Properties.php', 199 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Parser\\Serialize' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/Parser/Serialize.php', 200 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Parser\\Xml' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/Parser/Xml.php', 201 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Parser\\Yaml' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/Parser/Yaml.php', 202 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Writer\\AbstractWriter' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/Writer/AbstractWriter.php', 203 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Writer\\Ini' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/Writer/Ini.php', 204 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Writer\\Json' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/Writer/Json.php', 205 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Writer\\Properties' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/Writer/Properties.php', 206 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Writer\\Serialize' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/Writer/Serialize.php', 207 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Writer\\WriterInterface' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/Writer/WriterInterface.php', 208 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Writer\\Xml' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/Writer/Xml.php', 209 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Writer\\Yaml' => $baseDir . '/../vendor-prefixed/hassankhan/config/src/Writer/Yaml.php', 210 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Plugin\\Assets' => $baseDir . '/../src/Plugin/Assets.php', 211 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Plugin\\Freemius' => $baseDir . '/../src/Plugin/Freemius.php', 212 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Plugin\\I18n' => $baseDir . '/../src/Plugin/I18n.php', 213 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Plugin\\Lifecycle' => $baseDir . '/../src/Plugin/Lifecycle.php', 214 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Prepare' => $baseDir . '/../src/Prepare.php', 215 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Project' => $baseDir . '/../src/Project.php', 216 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Core' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Core.php', 217 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Exception\\SaltusFrameworkThrowable' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Exception/SaltusFrameworkThrowable.php', 218 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\AdminCols\\AdminCols' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Features/AdminCols/AdminCols.php', 219 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\AdminCols\\SaltusAdminCols' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Features/AdminCols/SaltusAdminCols.php', 220 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\AdminFilters\\AdminFilters' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Features/AdminFilters/AdminFilters.php', 221 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\AdminFilters\\SaltusAdminFilters' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Features/AdminFilters/SaltusAdminFilters.php', 222 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\AdminFilters\\WalkerTaxonomyDropdown' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Features/AdminFilters/WalkerTaxonomyDropdown.php', 223 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\DragAndDrop\\DragAndDrop' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Features/DragAndDrop/DragAndDrop.php', 224 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\DragAndDrop\\SaltusDragAndDrop' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Features/DragAndDrop/SaltusDragAndDrop.php', 225 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\DragAndDrop\\UpdateMenuDragAndDrop' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Features/DragAndDrop/UpdateMenuDragAndDrop.php', 226 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\Duplicate\\Duplicate' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Features/Duplicate/Duplicate.php', 227 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\Duplicate\\SaltusDuplicate' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Features/Duplicate/SaltusDuplicate.php', 228 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\FeatureA\\FeatureA' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Features/FeatureA/FeatureA.php', 229 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\FeatureA\\SaltusFeatureA' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Features/FeatureA/SaltusFeatureA.php', 230 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\Meta\\CMB2Meta' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Features/Meta/CMB2Meta.php', 231 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\Meta\\CodestarMeta' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Features/Meta/CodestarMeta.php', 232 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\Meta\\Meta' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Features/Meta/Meta.php', 233 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\RememberTabs\\RememberTabs' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Features/RememberTabs/RememberTabs.php', 234 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\RememberTabs\\SaltusRememberTabs' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Features/RememberTabs/SaltusRememberTabs.php', 235 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\Settings\\CodestarSettings' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Features/Settings/CodestarSettings.php', 236 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\Settings\\Settings' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Features/Settings/Settings.php', 237 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\SingleExport\\SaltusSingleExport' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Features/SingleExport/SaltusSingleExport.php', 238 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\SingleExport\\SingleExport' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Features/SingleExport/SingleExport.php', 239 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Container\\CanRegister' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Container/CanRegister.php', 240 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Container\\Container' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Container/Container.php', 241 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Container\\ContainerAssembler' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Container/ContainerAssembler.php', 242 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Container\\FailedToMakeInstance' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Container/FailedToMakeInstance.php', 243 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Container\\GenericContainer' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Container/GenericContainer.php', 244 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Container\\Instantiator' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Container/Instantiator.php', 245 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Container\\Invalid' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Container/Invalid.php', 246 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Container\\ServiceContainer' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Container/ServiceContainer.php', 247 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Plugin\\Activateable' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Plugin/Activateable.php', 248 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Plugin\\Deactivateable' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Plugin/Deactivateable.php', 249 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Plugin\\Plugin' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Plugin/Plugin.php', 250 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Plugin\\Registerable' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Plugin/Registerable.php', 251 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Service\\Actionable' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Service/Actionable.php', 252 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Service\\App' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Service/App.php', 253 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Service\\Assembly' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Service/Assembly.php', 254 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Service\\Conditional' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Service/Conditional.php', 255 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Service\\Processable' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Service/Processable.php', 256 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Service\\Service' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Service/Service.php', 257 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Modeler' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Modeler.php', 258 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Models\\BaseModel' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Models/BaseModel.php', 259 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Models\\Config\\NoFile' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Models/Config/NoFile.php', 260 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Models\\Model' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Models/Model.php', 261 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Models\\ModelFactory' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Models/ModelFactory.php', 262 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Models\\PostType' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Models/PostType.php', 263 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Models\\Taxonomy' => $baseDir . '/../vendor-prefixed/saltus/framework/src/Models/Taxonomy.php', 264 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Assets\\AssetsCore' => $baseDir . '/../src/Services/Assets/AssetsCore.php', 265 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Assets\\AssetsService' => $baseDir . '/../src/Services/Assets/AssetsService.php', 266 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Assets\\HasAssets' => $baseDir . '/../src/Services/Assets/HasAssets.php', 267 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Creatable' => $baseDir . '/../src/Services/Creatable.php', 268 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Assembler' => $baseDir . '/../src/Services/Model/Assembler.php', 269 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Base\\Features' => $baseDir . '/../src/Services/Model/Base/Features.php', 270 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Base\\Labels' => $baseDir . '/../src/Services/Model/Base/Labels.php', 271 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Base\\Meta' => $baseDir . '/../src/Services/Model/Base/Meta.php', 272 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Base\\MetaDotLabel' => $baseDir . '/../src/Services/Model/Base/MetaDotLabel.php', 273 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Base\\MetaPoint' => $baseDir . '/../src/Services/Model/Base/MetaPoint.php', 274 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Base\\Model' => $baseDir . '/../src/Services/Model/Base/Model.php', 275 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Base\\Options' => $baseDir . '/../src/Services/Model/Base/Options.php', 276 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Base\\SafeNL2BR' => $baseDir . '/../src/Services/Model/Base/SafeNL2BR.php', 277 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Base\\Settings' => $baseDir . '/../src/Services/Model/Base/Settings.php', 278 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Pro\\ClickActions' => $baseDir . '/../src/Services/Model/Pro/ClickActions.php', 279 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Pro\\MetaColor' => $baseDir . '/../src/Services/Model/Pro/MetaColor.php', 280 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Pro\\MetaDotLabel' => $baseDir . '/../src/Services/Model/Pro/MetaDotLabel.php', 281 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Pro\\MetaHTML' => $baseDir . '/../src/Services/Model/Pro/MetaHTML.php', 282 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Pro\\MetaLayers' => $baseDir . '/../src/Services/Model/Pro/MetaLayers.php', 283 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Pro\\MetaLines' => $baseDir . '/../src/Services/Model/Pro/MetaLines.php', 284 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Pro\\MetaPoint' => $baseDir . '/../src/Services/Model/Pro/MetaPoint.php', 285 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Pro\\MetaRegions' => $baseDir . '/../src/Services/Model/Pro/MetaRegions.php', 286 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Pro\\MetaRotate' => $baseDir . '/../src/Services/Model/Pro/MetaRotate.php', 287 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Pro\\MetaSearch' => $baseDir . '/../src/Services/Model/Pro/MetaSearch.php', 288 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Pro\\MetaTooltip' => $baseDir . '/../src/Services/Model/Pro/MetaTooltip.php', 289 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Pro\\Options' => $baseDir . '/../src/Services/Model/Pro/Options.php', 290 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Pro\\PluginSettings' => $baseDir . '/../src/Services/Model/Pro/PluginSettings.php', 291 'Saltus_WP_Plugin_InteractiveGlobes_CSF' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/classes/setup.class.php', 292 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Abstract' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/classes/abstract.class.php', 293 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Comment_Metabox' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/classes/comment-options.class.php', 294 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Customize_Options' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/classes/customize-options.class.php', 295 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_accordion' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/accordion/accordion.php', 296 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_background' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php', 297 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_backup' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/backup/backup.php', 298 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_border' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/border/border.php', 299 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_button_set' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/button_set/button_set.php', 300 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_callback' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/callback/callback.php', 301 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_checkbox' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/checkbox/checkbox.php', 302 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_code_editor' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/code_editor/code_editor.php', 303 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_color' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/color/color.php', 304 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_color_group' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/color_group/color_group.php', 305 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_content' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/content/content.php', 306 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_date' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/date/date.php', 307 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_datetime' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/datetime/datetime.php', 308 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_dimensions' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/dimensions/dimensions.php', 309 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_fieldset' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/fieldset/fieldset.php', 310 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_gallery' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/gallery/gallery.php', 311 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_group' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/group/group.php', 312 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_heading' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/heading/heading.php', 313 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_icon' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/icon/icon.php', 314 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_image_select' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/image_select/image_select.php', 315 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_link' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/link/link.php', 316 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_link_color' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/link_color/link_color.php', 317 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_map' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/map/map.php', 318 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_media' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/media/media.php', 319 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_notice' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/notice/notice.php', 320 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_number' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/number/number.php', 321 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_palette' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/palette/palette.php', 322 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_radio' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/radio/radio.php', 323 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_repeater' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/repeater/repeater.php', 324 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_select' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/select/select.php', 325 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_slider' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/slider/slider.php', 326 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_sortable' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/sortable/sortable.php', 327 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_sorter' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/sorter/sorter.php', 328 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_spacing' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/spacing/spacing.php', 329 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_spinner' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/spinner/spinner.php', 330 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_subheading' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/subheading/subheading.php', 331 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_submessage' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/submessage/submessage.php', 332 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_switcher' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/switcher/switcher.php', 333 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_tabbed' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/tabbed/tabbed.php', 334 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_text' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/text/text.php', 335 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_textarea' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/textarea/textarea.php', 336 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_typography' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php', 337 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_upload' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/upload/upload.php', 338 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_wp_editor' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/wp_editor/wp_editor.php', 339 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Fields' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/classes/fields.class.php', 340 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Metabox' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/classes/metabox-options.class.php', 341 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Nav_Menu_Options' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/classes/nav-menu-options.class.php', 342 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Options' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/classes/admin-options.class.php', 343 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Profile_Options' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/classes/profile-options.class.php', 344 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Setup' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/classes/setup.class.php', 345 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Shortcoder' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/classes/shortcode-options.class.php', 346 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Taxonomy_Options' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/classes/taxonomy-options.class.php', 347 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Walker_Nav_Menu_Edit' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/functions/walker.php', 348 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Welcome' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/views/welcome.php', 349 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Widget' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/classes/widget-options.class.php', 350 'Saltus_WP_Plugin_InteractiveGlobes_WP_Customize_Control_CSF' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/functions/customize.php', 351 'Saltus_WP_Plugin_InteractiveGlobes_WP_Customize_Panel_CSF' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/functions/customize.php', 352 'Saltus_WP_Plugin_InteractiveGlobes_WP_Customize_Section_CSF' => $baseDir . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/functions/customize.php', 353 'WP_Customize_Control_CSF' => $vendorDir . '/saltus/framework/lib/codestar-framework/functions/customize.php', 354 'WP_Customize_Panel_CSF' => $vendorDir . '/saltus/framework/lib/codestar-framework/functions/customize.php', 355 'WP_Customize_Section_CSF' => $vendorDir . '/saltus/framework/lib/codestar-framework/functions/customize.php', 150 356 ); -
interactive-globes/trunk/vendor/composer/autoload_psr4.php
r2986425 r3263746 7 7 8 8 return array( 9 'Saltus\\WP\\Plugin\\ Saltus\\InteractiveGlobes\\' => array($baseDir . '/../src'),9 'Saltus\\WP\\Plugin\\InteractiveGlobes\\' => array($baseDir . '/../src'), 10 10 'Saltus\\WP\\Framework\\' => array($vendorDir . '/saltus/framework/src'), 11 11 'Noodlehaus\\' => array($vendorDir . '/hassankhan/config/src'), -
interactive-globes/trunk/vendor/composer/autoload_real.php
r3098987 r3263746 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit2 a3c1dd1c0353fd131878c23d1c156ec5 class ComposerAutoloaderInit25dbc9f91dd60cec63ebce8f5ddfa9d1 6 6 { 7 7 private static $loader; … … 23 23 } 24 24 25 spl_autoload_register(array('ComposerAutoloaderInit2 a3c1dd1c0353fd131878c23d1c156ec', 'loadClassLoader'), true, true);25 spl_autoload_register(array('ComposerAutoloaderInit25dbc9f91dd60cec63ebce8f5ddfa9d1', 'loadClassLoader'), true, true); 26 26 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 27 spl_autoload_unregister(array('ComposerAutoloaderInit2 a3c1dd1c0353fd131878c23d1c156ec', 'loadClassLoader'));27 spl_autoload_unregister(array('ComposerAutoloaderInit25dbc9f91dd60cec63ebce8f5ddfa9d1', 'loadClassLoader')); 28 28 29 29 require __DIR__ . '/autoload_static.php'; 30 call_user_func(\Composer\Autoload\ComposerStaticInit2 a3c1dd1c0353fd131878c23d1c156ec::getInitializer($loader));30 call_user_func(\Composer\Autoload\ComposerStaticInit25dbc9f91dd60cec63ebce8f5ddfa9d1::getInitializer($loader)); 31 31 32 32 $loader->register(true); 33 34 $filesToLoad = \Composer\Autoload\ComposerStaticInit2a3c1dd1c0353fd131878c23d1c156ec::$files;35 $requireFile = \Closure::bind(static function ($fileIdentifier, $file) {36 if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {37 $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;38 39 require $file;40 }41 }, null, null);42 foreach ($filesToLoad as $fileIdentifier => $file) {43 $requireFile($fileIdentifier, $file);44 }45 33 46 34 return $loader; -
interactive-globes/trunk/vendor/composer/autoload_static.php
r3207680 r3263746 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit2 a3c1dd1c0353fd131878c23d1c156ec7 class ComposerStaticInit25dbc9f91dd60cec63ebce8f5ddfa9d1 8 8 { 9 public static $files = array (10 '57aea4427272562eb78cf61f6733ec6a' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/codestar-framework.php',11 );12 13 9 public static $prefixLengthsPsr4 = array ( 14 10 'S' => 15 11 array ( 16 'Saltus\\WP\\Plugin\\ Saltus\\InteractiveGlobes\\' => 42,12 'Saltus\\WP\\Plugin\\InteractiveGlobes\\' => 35, 17 13 'Saltus\\WP\\Framework\\' => 20, 18 14 ), … … 24 20 25 21 public static $prefixDirsPsr4 = array ( 26 'Saltus\\WP\\Plugin\\ Saltus\\InteractiveGlobes\\' =>22 'Saltus\\WP\\Plugin\\InteractiveGlobes\\' => 27 23 array ( 28 24 0 => __DIR__ . '/../..'.'/build' . '/../src', … … 39 35 40 36 public static $classMap = array ( 37 'CSF' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/classes/setup.class.php', 38 'CSF_Abstract' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/classes/abstract.class.php', 39 'CSF_Comment_Metabox' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/classes/comment-options.class.php', 40 'CSF_Customize_Options' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/classes/customize-options.class.php', 41 'CSF_Field_accordion' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/accordion/accordion.php', 42 'CSF_Field_background' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/background/background.php', 43 'CSF_Field_backup' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/backup/backup.php', 44 'CSF_Field_border' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/border/border.php', 45 'CSF_Field_button_set' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/button_set/button_set.php', 46 'CSF_Field_callback' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/callback/callback.php', 47 'CSF_Field_checkbox' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/checkbox/checkbox.php', 48 'CSF_Field_code_editor' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/code_editor/code_editor.php', 49 'CSF_Field_color' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/color/color.php', 50 'CSF_Field_color_group' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/color_group/color_group.php', 51 'CSF_Field_content' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/content/content.php', 52 'CSF_Field_date' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/date/date.php', 53 'CSF_Field_datetime' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/datetime/datetime.php', 54 'CSF_Field_dimensions' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/dimensions/dimensions.php', 55 'CSF_Field_fieldset' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/fieldset/fieldset.php', 56 'CSF_Field_gallery' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/gallery/gallery.php', 57 'CSF_Field_group' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/group/group.php', 58 'CSF_Field_heading' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/heading/heading.php', 59 'CSF_Field_icon' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/icon/icon.php', 60 'CSF_Field_image_select' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/image_select/image_select.php', 61 'CSF_Field_link' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/link/link.php', 62 'CSF_Field_link_color' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/link_color/link_color.php', 63 'CSF_Field_map' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/map/map.php', 64 'CSF_Field_media' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/media/media.php', 65 'CSF_Field_notice' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/notice/notice.php', 66 'CSF_Field_number' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/number/number.php', 67 'CSF_Field_palette' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/palette/palette.php', 68 'CSF_Field_radio' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/radio/radio.php', 69 'CSF_Field_repeater' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/repeater/repeater.php', 70 'CSF_Field_select' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/select/select.php', 71 'CSF_Field_slider' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/slider/slider.php', 72 'CSF_Field_sortable' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/sortable/sortable.php', 73 'CSF_Field_sorter' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/sorter/sorter.php', 74 'CSF_Field_spacing' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/spacing/spacing.php', 75 'CSF_Field_spinner' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/spinner/spinner.php', 76 'CSF_Field_subheading' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/subheading/subheading.php', 77 'CSF_Field_submessage' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/submessage/submessage.php', 78 'CSF_Field_switcher' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/switcher/switcher.php', 79 'CSF_Field_tabbed' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/tabbed/tabbed.php', 80 'CSF_Field_text' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/text/text.php', 81 'CSF_Field_textarea' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/textarea/textarea.php', 82 'CSF_Field_typography' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/typography/typography.php', 83 'CSF_Field_upload' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/upload/upload.php', 84 'CSF_Field_wp_editor' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/fields/wp_editor/wp_editor.php', 85 'CSF_Fields' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/classes/fields.class.php', 86 'CSF_Metabox' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/classes/metabox-options.class.php', 87 'CSF_Nav_Menu_Options' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/classes/nav-menu-options.class.php', 88 'CSF_Options' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/classes/admin-options.class.php', 89 'CSF_Profile_Options' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/classes/profile-options.class.php', 90 'CSF_Setup' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/classes/setup.class.php', 91 'CSF_Shortcoder' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/classes/shortcode-options.class.php', 92 'CSF_Taxonomy_Options' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/classes/taxonomy-options.class.php', 93 'CSF_Walker_Nav_Menu_Edit' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/functions/walker.php', 94 'CSF_Welcome' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/views/welcome.php', 95 'CSF_Widget' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/classes/widget-options.class.php', 96 'ComposerAutoloaderInitc8718d2aa33a4293f290bf2a9e534956' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/composer/autoload_real.php', 97 'Composer\\Autoload\\ClassLoader' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/composer/ClassLoader.php', 98 'Composer\\Autoload\\ComposerStaticInitc8718d2aa33a4293f290bf2a9e534956' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/composer/autoload_static.php', 41 99 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 42 100 'Noodlehaus\\AbstractConfig' => __DIR__ . '/..' . '/hassankhan/config/src/AbstractConfig.php', … … 115 173 'Saltus\\WP\\Framework\\Models\\PostType' => __DIR__ . '/..' . '/saltus/framework/src/Models/PostType.php', 116 174 'Saltus\\WP\\Framework\\Models\\Taxonomy' => __DIR__ . '/..' . '/saltus/framework/src/Models/Taxonomy.php', 117 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Core' => __DIR__ . '/../..'.'/build' . '/../src/Core.php', 118 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\CorePro' => __DIR__ . '/../..'.'/build' . '/../src/CorePro.php', 119 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Exception\\SaltusFrameworkThrowable' => __DIR__ . '/../..'.'/build' . '/../src/Exception/SaltusFrameworkThrowable.php', 120 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\ClickActionOption' => __DIR__ . '/../..'.'/build' . '/../src/Features/ClickActions/ClickActionOption.php', 121 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentAbove' => __DIR__ . '/../..'.'/build' . '/../src/Features/ClickActions/DisplayContentAbove.php', 122 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentBelow' => __DIR__ . '/../..'.'/build' . '/../src/Features/ClickActions/DisplayContentBelow.php', 123 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentBelowScroll' => __DIR__ . '/../..'.'/build' . '/../src/Features/ClickActions/DisplayContentBelowScroll.php', 124 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentLeft' => __DIR__ . '/../..'.'/build' . '/../src/Features/ClickActions/DisplayContentLeft.php', 125 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentLightbox' => __DIR__ . '/../..'.'/build' . '/../src/Features/ClickActions/DisplayContentLightbox.php', 126 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentRight' => __DIR__ . '/../..'.'/build' . '/../src/Features/ClickActions/DisplayContentRight.php', 127 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayIframeLightbox' => __DIR__ . '/../..'.'/build' . '/../src/Features/ClickActions/DisplayIframeLightbox.php', 128 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\CptManager\\CptManagerCore' => __DIR__ . '/../..'.'/build' . '/../src/Features/CptManager/CptManagerCore.php', 129 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\CptManager\\CptManagerFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/CptManager/CptManagerFeature.php', 130 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\DotLabel\\DotLabelProMeta' => __DIR__ . '/../..'.'/build' . '/../src/Features/DotLabel/DotLabelProMeta.php', 131 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Duplicate\\DuplicateCore' => __DIR__ . '/../..'.'/build' . '/../src/Features/Duplicate/DuplicateCore.php', 132 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Duplicate\\DuplicateFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/Duplicate/DuplicateFeature.php', 133 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\LiveFilter\\LiveFilterCore' => __DIR__ . '/../..'.'/build' . '/../src/Features/LiveFilter/LiveFilterCore.php', 134 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\LiveFilter\\LiveFilterFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/LiveFilter/LiveFilterFeature.php', 135 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Meta\\MetaCore' => __DIR__ . '/../..'.'/build' . '/../src/Features/Meta/MetaCore.php', 136 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Meta\\MetaFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/Meta/MetaFeature.php', 137 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Point\\PointProMeta' => __DIR__ . '/../..'.'/build' . '/../src/Features/Point/PointProMeta.php', 138 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Sales\\UpsellPage' => __DIR__ . '/../..'.'/build' . '/../src/Features/Sales/UpsellPage.php', 139 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Sales\\UpsellPageFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/Sales/UpsellPageFeature.php', 140 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\SearchDropdown\\SearchDropdownCore' => __DIR__ . '/../..'.'/build' . '/../src/Features/SearchDropdown/SearchDropdownCore.php', 141 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\SearchDropdown\\SearchDropdownFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/SearchDropdown/SearchDropdownFeature.php', 142 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Shortcode\\ShortcodeCore' => __DIR__ . '/../..'.'/build' . '/../src/Features/Shortcode/ShortcodeCore.php', 143 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Shortcode\\ShortcodeFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/Shortcode/ShortcodeFeature.php', 144 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\SinglePage\\SinglePageCore' => __DIR__ . '/../..'.'/build' . '/../src/Features/SinglePage/SinglePageCore.php', 145 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\SinglePage\\SinglePageFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/SinglePage/SinglePageFeature.php', 146 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Tooltip\\TooltipCore' => __DIR__ . '/../..'.'/build' . '/../src/Features/Tooltip/TooltipCore.php', 147 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Tooltip\\TooltipFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/Tooltip/TooltipFeature.php', 148 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Updater\\UpdateCore' => __DIR__ . '/../..'.'/build' . '/../src/Features/Updater/UpdateCore.php', 149 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Updater\\UpdateFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/Updater/UpdateFeature.php', 150 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Loader' => __DIR__ . '/../..'.'/build' . '/../src/Loader.php', 151 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Plugin\\Assets' => __DIR__ . '/../..'.'/build' . '/../src/Plugin/Assets.php', 152 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Plugin\\Freemius' => __DIR__ . '/../..'.'/build' . '/../src/Plugin/Freemius.php', 153 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Plugin\\I18n' => __DIR__ . '/../..'.'/build' . '/../src/Plugin/I18n.php', 154 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Plugin\\Lifecycle' => __DIR__ . '/../..'.'/build' . '/../src/Plugin/Lifecycle.php', 155 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Prepare' => __DIR__ . '/../..'.'/build' . '/../src/Prepare.php', 156 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Project' => __DIR__ . '/../..'.'/build' . '/../src/Project.php', 157 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Assets\\AssetsCore' => __DIR__ . '/../..'.'/build' . '/../src/Services/Assets/AssetsCore.php', 158 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Assets\\AssetsService' => __DIR__ . '/../..'.'/build' . '/../src/Services/Assets/AssetsService.php', 159 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Assets\\HasAssets' => __DIR__ . '/../..'.'/build' . '/../src/Services/Assets/HasAssets.php', 160 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Assembler' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Assembler.php', 161 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\Features' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Base/Features.php', 162 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\Labels' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Base/Labels.php', 163 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\Meta' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Base/Meta.php', 164 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\MetaDotLabel' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Base/MetaDotLabel.php', 165 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\MetaPoint' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Base/MetaPoint.php', 166 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\Model' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Base/Model.php', 167 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\Options' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Base/Options.php', 168 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\SafeNL2BR' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Base/SafeNL2BR.php', 169 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\Settings' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Base/Settings.php', 170 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\ClickActions' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/ClickActions.php', 171 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaColor' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaColor.php', 172 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaDotLabel' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaDotLabel.php', 173 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaLayers' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaLayers.php', 174 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaLines' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaLines.php', 175 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaPoint' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaPoint.php', 176 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaRegions' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaRegions.php', 177 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaRotate' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaRotate.php', 178 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaSearch' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaSearch.php', 179 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaTooltip' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaTooltip.php', 180 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\Options' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/Options.php', 181 'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\PluginSettings' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/PluginSettings.php', 175 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Core' => __DIR__ . '/../..'.'/build' . '/../src/Core.php', 176 'Saltus\\WP\\Plugin\\InteractiveGlobes\\CorePro' => __DIR__ . '/../..'.'/build' . '/../src/CorePro.php', 177 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Exception\\SaltusFrameworkThrowable' => __DIR__ . '/../..'.'/build' . '/../src/Exception/SaltusFrameworkThrowable.php', 178 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\ClickActions\\ClickActionOption' => __DIR__ . '/../..'.'/build' . '/../src/Features/ClickActions/ClickActionOption.php', 179 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentAbove' => __DIR__ . '/../..'.'/build' . '/../src/Features/ClickActions/DisplayContentAbove.php', 180 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentBelow' => __DIR__ . '/../..'.'/build' . '/../src/Features/ClickActions/DisplayContentBelow.php', 181 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentBelowScroll' => __DIR__ . '/../..'.'/build' . '/../src/Features/ClickActions/DisplayContentBelowScroll.php', 182 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentLeft' => __DIR__ . '/../..'.'/build' . '/../src/Features/ClickActions/DisplayContentLeft.php', 183 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentLightbox' => __DIR__ . '/../..'.'/build' . '/../src/Features/ClickActions/DisplayContentLightbox.php', 184 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentRight' => __DIR__ . '/../..'.'/build' . '/../src/Features/ClickActions/DisplayContentRight.php', 185 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\ClickActions\\DisplayIframeLightbox' => __DIR__ . '/../..'.'/build' . '/../src/Features/ClickActions/DisplayIframeLightbox.php', 186 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\CptManager\\CptManagerCore' => __DIR__ . '/../..'.'/build' . '/../src/Features/CptManager/CptManagerCore.php', 187 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\CptManager\\CptManagerFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/CptManager/CptManagerFeature.php', 188 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\DotLabel\\DotLabelProMeta' => __DIR__ . '/../..'.'/build' . '/../src/Features/DotLabel/DotLabelProMeta.php', 189 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\Duplicate\\DuplicateCore' => __DIR__ . '/../..'.'/build' . '/../src/Features/Duplicate/DuplicateCore.php', 190 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\Duplicate\\DuplicateFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/Duplicate/DuplicateFeature.php', 191 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\LiveFilter\\LiveFilterCore' => __DIR__ . '/../..'.'/build' . '/../src/Features/LiveFilter/LiveFilterCore.php', 192 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\LiveFilter\\LiveFilterFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/LiveFilter/LiveFilterFeature.php', 193 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\Meta\\MetaCore' => __DIR__ . '/../..'.'/build' . '/../src/Features/Meta/MetaCore.php', 194 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\Meta\\MetaFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/Meta/MetaFeature.php', 195 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\Point\\PointProMeta' => __DIR__ . '/../..'.'/build' . '/../src/Features/Point/PointProMeta.php', 196 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\RegionCounter\\RegionCounterCore' => __DIR__ . '/../..'.'/build' . '/../src/Features/RegionCounter/RegionCounterCore.php', 197 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\RegionCounter\\RegionCounterFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/RegionCounter/RegionCounterFeature.php', 198 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\Sales\\UpsellPage' => __DIR__ . '/../..'.'/build' . '/../src/Features/Sales/UpsellPage.php', 199 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\Sales\\UpsellPageFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/Sales/UpsellPageFeature.php', 200 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\SearchDropdown\\SearchDropdownCore' => __DIR__ . '/../..'.'/build' . '/../src/Features/SearchDropdown/SearchDropdownCore.php', 201 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\SearchDropdown\\SearchDropdownFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/SearchDropdown/SearchDropdownFeature.php', 202 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\Shortcode\\ShortcodeCore' => __DIR__ . '/../..'.'/build' . '/../src/Features/Shortcode/ShortcodeCore.php', 203 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\Shortcode\\ShortcodeFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/Shortcode/ShortcodeFeature.php', 204 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\SinglePage\\SinglePageCore' => __DIR__ . '/../..'.'/build' . '/../src/Features/SinglePage/SinglePageCore.php', 205 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\SinglePage\\SinglePageFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/SinglePage/SinglePageFeature.php', 206 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\Tooltip\\TooltipCore' => __DIR__ . '/../..'.'/build' . '/../src/Features/Tooltip/TooltipCore.php', 207 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\Tooltip\\TooltipFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/Tooltip/TooltipFeature.php', 208 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\Updater\\UpdateCore' => __DIR__ . '/../..'.'/build' . '/../src/Features/Updater/UpdateCore.php', 209 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Features\\Updater\\UpdateFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/Updater/UpdateFeature.php', 210 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Loader' => __DIR__ . '/../..'.'/build' . '/../src/Loader.php', 211 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\AbstractConfig' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/AbstractConfig.php', 212 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Config' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/Config.php', 213 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\ConfigInterface' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/ConfigInterface.php', 214 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\ErrorException' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/ErrorException.php', 215 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Exception' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/Exception.php', 216 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Exception\\EmptyDirectoryException' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/Exception/EmptyDirectoryException.php', 217 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Exception\\FileNotFoundException' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/Exception/FileNotFoundException.php', 218 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Exception\\ParseException' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/Exception/ParseException.php', 219 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Exception\\UnsupportedFormatException' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/Exception/UnsupportedFormatException.php', 220 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Exception\\WriteException' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/Exception/WriteException.php', 221 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Parser\\AbstractParser' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/Parser/AbstractParser.php', 222 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Parser\\Ini' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/Parser/Ini.php', 223 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Parser\\Json' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/Parser/Json.php', 224 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Parser\\ParserInterface' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/Parser/ParserInterface.php', 225 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Parser\\Php' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/Parser/Php.php', 226 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Parser\\Properties' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/Parser/Properties.php', 227 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Parser\\Serialize' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/Parser/Serialize.php', 228 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Parser\\Xml' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/Parser/Xml.php', 229 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Parser\\Yaml' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/Parser/Yaml.php', 230 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Writer\\AbstractWriter' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/Writer/AbstractWriter.php', 231 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Writer\\Ini' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/Writer/Ini.php', 232 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Writer\\Json' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/Writer/Json.php', 233 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Writer\\Properties' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/Writer/Properties.php', 234 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Writer\\Serialize' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/Writer/Serialize.php', 235 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Writer\\WriterInterface' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/Writer/WriterInterface.php', 236 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Writer\\Xml' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/Writer/Xml.php', 237 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Noodlehaus\\Writer\\Yaml' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/hassankhan/config/src/Writer/Yaml.php', 238 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Plugin\\Assets' => __DIR__ . '/../..'.'/build' . '/../src/Plugin/Assets.php', 239 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Plugin\\Freemius' => __DIR__ . '/../..'.'/build' . '/../src/Plugin/Freemius.php', 240 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Plugin\\I18n' => __DIR__ . '/../..'.'/build' . '/../src/Plugin/I18n.php', 241 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Plugin\\Lifecycle' => __DIR__ . '/../..'.'/build' . '/../src/Plugin/Lifecycle.php', 242 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Prepare' => __DIR__ . '/../..'.'/build' . '/../src/Prepare.php', 243 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Project' => __DIR__ . '/../..'.'/build' . '/../src/Project.php', 244 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Core' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Core.php', 245 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Exception\\SaltusFrameworkThrowable' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Exception/SaltusFrameworkThrowable.php', 246 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\AdminCols\\AdminCols' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Features/AdminCols/AdminCols.php', 247 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\AdminCols\\SaltusAdminCols' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Features/AdminCols/SaltusAdminCols.php', 248 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\AdminFilters\\AdminFilters' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Features/AdminFilters/AdminFilters.php', 249 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\AdminFilters\\SaltusAdminFilters' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Features/AdminFilters/SaltusAdminFilters.php', 250 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\AdminFilters\\WalkerTaxonomyDropdown' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Features/AdminFilters/WalkerTaxonomyDropdown.php', 251 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\DragAndDrop\\DragAndDrop' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Features/DragAndDrop/DragAndDrop.php', 252 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\DragAndDrop\\SaltusDragAndDrop' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Features/DragAndDrop/SaltusDragAndDrop.php', 253 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\DragAndDrop\\UpdateMenuDragAndDrop' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Features/DragAndDrop/UpdateMenuDragAndDrop.php', 254 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\Duplicate\\Duplicate' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Features/Duplicate/Duplicate.php', 255 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\Duplicate\\SaltusDuplicate' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Features/Duplicate/SaltusDuplicate.php', 256 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\FeatureA\\FeatureA' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Features/FeatureA/FeatureA.php', 257 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\FeatureA\\SaltusFeatureA' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Features/FeatureA/SaltusFeatureA.php', 258 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\Meta\\CMB2Meta' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Features/Meta/CMB2Meta.php', 259 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\Meta\\CodestarMeta' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Features/Meta/CodestarMeta.php', 260 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\Meta\\Meta' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Features/Meta/Meta.php', 261 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\RememberTabs\\RememberTabs' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Features/RememberTabs/RememberTabs.php', 262 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\RememberTabs\\SaltusRememberTabs' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Features/RememberTabs/SaltusRememberTabs.php', 263 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\Settings\\CodestarSettings' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Features/Settings/CodestarSettings.php', 264 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\Settings\\Settings' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Features/Settings/Settings.php', 265 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\SingleExport\\SaltusSingleExport' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Features/SingleExport/SaltusSingleExport.php', 266 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Features\\SingleExport\\SingleExport' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Features/SingleExport/SingleExport.php', 267 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Container\\CanRegister' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Container/CanRegister.php', 268 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Container\\Container' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Container/Container.php', 269 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Container\\ContainerAssembler' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Container/ContainerAssembler.php', 270 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Container\\FailedToMakeInstance' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Container/FailedToMakeInstance.php', 271 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Container\\GenericContainer' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Container/GenericContainer.php', 272 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Container\\Instantiator' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Container/Instantiator.php', 273 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Container\\Invalid' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Container/Invalid.php', 274 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Container\\ServiceContainer' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Container/ServiceContainer.php', 275 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Plugin\\Activateable' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Plugin/Activateable.php', 276 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Plugin\\Deactivateable' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Plugin/Deactivateable.php', 277 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Plugin\\Plugin' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Plugin/Plugin.php', 278 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Plugin\\Registerable' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Plugin/Registerable.php', 279 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Service\\Actionable' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Service/Actionable.php', 280 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Service\\App' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Service/App.php', 281 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Service\\Assembly' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Service/Assembly.php', 282 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Service\\Conditional' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Service/Conditional.php', 283 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Service\\Processable' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Service/Processable.php', 284 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Infrastructure\\Service\\Service' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Infrastructure/Service/Service.php', 285 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Modeler' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Modeler.php', 286 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Models\\BaseModel' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Models/BaseModel.php', 287 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Models\\Config\\NoFile' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Models/Config/NoFile.php', 288 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Models\\Model' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Models/Model.php', 289 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Models\\ModelFactory' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Models/ModelFactory.php', 290 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Models\\PostType' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Models/PostType.php', 291 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Saltus\\WP\\Framework\\Models\\Taxonomy' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/src/Models/Taxonomy.php', 292 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Assets\\AssetsCore' => __DIR__ . '/../..'.'/build' . '/../src/Services/Assets/AssetsCore.php', 293 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Assets\\AssetsService' => __DIR__ . '/../..'.'/build' . '/../src/Services/Assets/AssetsService.php', 294 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Assets\\HasAssets' => __DIR__ . '/../..'.'/build' . '/../src/Services/Assets/HasAssets.php', 295 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Creatable' => __DIR__ . '/../..'.'/build' . '/../src/Services/Creatable.php', 296 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Assembler' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Assembler.php', 297 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Base\\Features' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Base/Features.php', 298 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Base\\Labels' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Base/Labels.php', 299 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Base\\Meta' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Base/Meta.php', 300 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Base\\MetaDotLabel' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Base/MetaDotLabel.php', 301 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Base\\MetaPoint' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Base/MetaPoint.php', 302 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Base\\Model' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Base/Model.php', 303 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Base\\Options' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Base/Options.php', 304 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Base\\SafeNL2BR' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Base/SafeNL2BR.php', 305 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Base\\Settings' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Base/Settings.php', 306 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Pro\\ClickActions' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/ClickActions.php', 307 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Pro\\MetaColor' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaColor.php', 308 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Pro\\MetaDotLabel' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaDotLabel.php', 309 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Pro\\MetaHTML' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaHTML.php', 310 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Pro\\MetaLayers' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaLayers.php', 311 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Pro\\MetaLines' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaLines.php', 312 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Pro\\MetaPoint' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaPoint.php', 313 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Pro\\MetaRegions' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaRegions.php', 314 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Pro\\MetaRotate' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaRotate.php', 315 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Pro\\MetaSearch' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaSearch.php', 316 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Pro\\MetaTooltip' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaTooltip.php', 317 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Pro\\Options' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/Options.php', 318 'Saltus\\WP\\Plugin\\InteractiveGlobes\\Services\\Model\\Pro\\PluginSettings' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/PluginSettings.php', 319 'Saltus_WP_Plugin_InteractiveGlobes_CSF' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/classes/setup.class.php', 320 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Abstract' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/classes/abstract.class.php', 321 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Comment_Metabox' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/classes/comment-options.class.php', 322 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Customize_Options' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/classes/customize-options.class.php', 323 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_accordion' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/accordion/accordion.php', 324 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_background' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/background/background.php', 325 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_backup' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/backup/backup.php', 326 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_border' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/border/border.php', 327 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_button_set' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/button_set/button_set.php', 328 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_callback' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/callback/callback.php', 329 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_checkbox' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/checkbox/checkbox.php', 330 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_code_editor' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/code_editor/code_editor.php', 331 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_color' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/color/color.php', 332 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_color_group' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/color_group/color_group.php', 333 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_content' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/content/content.php', 334 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_date' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/date/date.php', 335 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_datetime' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/datetime/datetime.php', 336 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_dimensions' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/dimensions/dimensions.php', 337 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_fieldset' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/fieldset/fieldset.php', 338 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_gallery' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/gallery/gallery.php', 339 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_group' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/group/group.php', 340 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_heading' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/heading/heading.php', 341 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_icon' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/icon/icon.php', 342 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_image_select' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/image_select/image_select.php', 343 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_link' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/link/link.php', 344 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_link_color' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/link_color/link_color.php', 345 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_map' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/map/map.php', 346 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_media' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/media/media.php', 347 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_notice' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/notice/notice.php', 348 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_number' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/number/number.php', 349 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_palette' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/palette/palette.php', 350 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_radio' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/radio/radio.php', 351 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_repeater' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/repeater/repeater.php', 352 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_select' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/select/select.php', 353 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_slider' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/slider/slider.php', 354 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_sortable' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/sortable/sortable.php', 355 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_sorter' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/sorter/sorter.php', 356 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_spacing' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/spacing/spacing.php', 357 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_spinner' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/spinner/spinner.php', 358 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_subheading' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/subheading/subheading.php', 359 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_submessage' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/submessage/submessage.php', 360 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_switcher' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/switcher/switcher.php', 361 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_tabbed' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/tabbed/tabbed.php', 362 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_text' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/text/text.php', 363 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_textarea' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/textarea/textarea.php', 364 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_typography' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/typography/typography.php', 365 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_upload' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/upload/upload.php', 366 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_wp_editor' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/fields/wp_editor/wp_editor.php', 367 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Fields' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/classes/fields.class.php', 368 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Metabox' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/classes/metabox-options.class.php', 369 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Nav_Menu_Options' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/classes/nav-menu-options.class.php', 370 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Options' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/classes/admin-options.class.php', 371 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Profile_Options' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/classes/profile-options.class.php', 372 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Setup' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/classes/setup.class.php', 373 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Shortcoder' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/classes/shortcode-options.class.php', 374 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Taxonomy_Options' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/classes/taxonomy-options.class.php', 375 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Walker_Nav_Menu_Edit' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/functions/walker.php', 376 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Welcome' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/views/welcome.php', 377 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Widget' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/classes/widget-options.class.php', 378 'Saltus_WP_Plugin_InteractiveGlobes_WP_Customize_Control_CSF' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/functions/customize.php', 379 'Saltus_WP_Plugin_InteractiveGlobes_WP_Customize_Panel_CSF' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/functions/customize.php', 380 'Saltus_WP_Plugin_InteractiveGlobes_WP_Customize_Section_CSF' => __DIR__ . '/../..'.'/build' . '/../vendor-prefixed/saltus/framework/lib/codestar-framework/functions/customize.php', 381 'WP_Customize_Control_CSF' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/functions/customize.php', 382 'WP_Customize_Panel_CSF' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/functions/customize.php', 383 'WP_Customize_Section_CSF' => __DIR__ . '/..' . '/saltus/framework/lib/codestar-framework/functions/customize.php', 182 384 ); 183 385 … … 185 387 { 186 388 return \Closure::bind(function () use ($loader) { 187 $loader->prefixLengthsPsr4 = ComposerStaticInit2 a3c1dd1c0353fd131878c23d1c156ec::$prefixLengthsPsr4;188 $loader->prefixDirsPsr4 = ComposerStaticInit2 a3c1dd1c0353fd131878c23d1c156ec::$prefixDirsPsr4;189 $loader->classMap = ComposerStaticInit2 a3c1dd1c0353fd131878c23d1c156ec::$classMap;389 $loader->prefixLengthsPsr4 = ComposerStaticInit25dbc9f91dd60cec63ebce8f5ddfa9d1::$prefixLengthsPsr4; 390 $loader->prefixDirsPsr4 = ComposerStaticInit25dbc9f91dd60cec63ebce8f5ddfa9d1::$prefixDirsPsr4; 391 $loader->classMap = ComposerStaticInit25dbc9f91dd60cec63ebce8f5ddfa9d1::$classMap; 190 392 191 393 }, null, ClassLoader::class); -
interactive-globes/trunk/vendor/composer/installed.json
r3207680 r3263746 3 3 { 4 4 "name": "freemius/wordpress-sdk", 5 "version": "2.9.0", 6 "version_normalized": "2.9.0.0", 7 "source": { 8 "type": "git", 9 "url": "https://github.com/Freemius/wordpress-sdk.git", 10 "reference": "56696717c5f0b7fb395618e88e1b592d1893e5dc" 11 }, 5 "version": "2.11.0", 6 "version_normalized": "2.11.0.0", 12 7 "dist": { 13 8 "type": "zip", 14 "url": "https://api.github.com/repos/Freemius/wordpress-sdk/zipball/56696717c5f0b7fb395618e88e1b592d1893e5dc", 15 "reference": "56696717c5f0b7fb395618e88e1b592d1893e5dc", 16 "shasum": "" 9 "url": "../lib/freemius/wordpress-sdk-2.11.0.zip" 17 10 }, 18 "require": {19 "php": ">=5.6"20 },21 "require-dev": {22 "dealerdirect/phpcodesniffer-composer-installer": "^1.0",23 "phpcompatibility/php-compatibility": "^9.3",24 "phpcompatibility/phpcompatibility-wp": "^2.1",25 "phpstan/extension-installer": "^1.3",26 "squizlabs/php_codesniffer": "^3.7",27 "szepeviktor/phpstan-wordpress": "^1.3",28 "wp-coding-standards/wpcs": "^2.3"29 },30 "time": "2024-10-21T10:21:58+00:00",31 11 "type": "library", 32 12 "installation-source": "dist", 33 "notification-url": "https://packagist.org/downloads/",34 "license": [35 "GPL-3.0-only"36 ],37 "description": "Freemius WordPress SDK",38 "homepage": "https://freemius.com",39 "keywords": [40 "freemius",41 "plugin",42 "sdk",43 "theme",44 "wordpress",45 "wordpress-plugin",46 "wordpress-theme"47 ],48 "support": {49 "issues": "https://github.com/Freemius/wordpress-sdk/issues",50 "source": "https://github.com/Freemius/wordpress-sdk/tree/2.9.0"51 },52 13 "install-path": "../freemius/wordpress-sdk" 53 14 }, … … 124 85 "type": "git", 125 86 "url": "https://github.com/SaltusDev/saltus-framework.git", 126 "reference": " dff0acfe679535ccbead90b3560d2ca045d532ae"87 "reference": "930112677d90dbf2c783698d800d8234594fa836" 127 88 }, 128 89 "dist": { 129 90 "type": "zip", 130 "url": "https://api.github.com/repos/SaltusDev/saltus-framework/zipball/ dff0acfe679535ccbead90b3560d2ca045d532ae",131 "reference": " dff0acfe679535ccbead90b3560d2ca045d532ae",91 "url": "https://api.github.com/repos/SaltusDev/saltus-framework/zipball/930112677d90dbf2c783698d800d8234594fa836", 92 "reference": "930112677d90dbf2c783698d800d8234594fa836", 132 93 "shasum": "" 133 94 }, … … 140 101 "squizlabs/php_codesniffer": "^3.10.3" 141 102 }, 142 "time": "202 4-12-10T16:29:46+00:00",103 "time": "2025-02-18T13:11:29+00:00", 143 104 "type": "project", 144 105 "installation-source": "dist", … … 147 108 "Saltus\\WP\\Framework\\": "src/" 148 109 }, 149 " files": [150 "lib/codestar-framework/ codestar-framework.php"110 "classmap": [ 111 "lib/codestar-framework/" 151 112 ] 152 113 }, -
interactive-globes/trunk/vendor/composer/installed.php
r3207712 r3263746 4 4 'pretty_version' => 'dev-main', 5 5 'version' => 'dev-main', 6 'reference' => ' 27ca84c2de25a85f29acfd4a887414a8bd0e8852',6 'reference' => '6d8e9facadab1618087b9ee35d536b5718331549', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../build', … … 12 12 'versions' => array( 13 13 'freemius/wordpress-sdk' => array( 14 'pretty_version' => '2. 9.0',15 'version' => '2. 9.0.0',16 'reference' => '56696717c5f0b7fb395618e88e1b592d1893e5dc',14 'pretty_version' => '2.11.0', 15 'version' => '2.11.0.0', 16 'reference' => null, 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../freemius/wordpress-sdk', … … 32 32 'pretty_version' => 'dev-dev', 33 33 'version' => 'dev-dev', 34 'reference' => ' dff0acfe679535ccbead90b3560d2ca045d532ae',34 'reference' => '930112677d90dbf2c783698d800d8234594fa836', 35 35 'type' => 'project', 36 36 'install_path' => __DIR__ . '/../saltus/framework', … … 41 41 'pretty_version' => 'dev-main', 42 42 'version' => 'dev-main', 43 'reference' => ' 27ca84c2de25a85f29acfd4a887414a8bd0e8852',43 'reference' => '6d8e9facadab1618087b9ee35d536b5718331549', 44 44 'type' => 'wordpress-plugin', 45 45 'install_path' => __DIR__ . '/../../build', -
interactive-globes/trunk/vendor/saltus/framework/README.md
r3207680 r3263746 4 4 We built it to make things easier and faster for developers with different skills. Add metaboxes, settings pages and other enhancements with just a few lines of code. 5 5 6 **Version 1.1.2** 6 ## Version 7 ## [1.1.4] - 2025-02-18 8 See [change log file](CHANGELOG.md) for full details. 7 9 8 10 ### Features … … 132 134 * Clone [github-updater](https://github.com/afragen/github-updater) to your sites plugins/ folder 133 135 * Activate via WordPress 136 137 ## Building 138 139 ### Disadvantages of classmap 140 As we move from 'files' to 'classmap', heed this: 141 > Manual Updates: If you add new classes, you must regenerate the classmap by running composer dump-autoload. -
interactive-globes/trunk/vendor/saltus/framework/composer.json
r3207680 r3263746 25 25 "Saltus\\WP\\Framework\\": "src/" 26 26 }, 27 " files": [28 "lib/codestar-framework/ codestar-framework.php"27 "classmap": [ 28 "lib/codestar-framework/" 29 29 ] 30 30 }, -
interactive-globes/trunk/vendor/saltus/framework/composer.lock
r3207680 r3263746 9 9 { 10 10 "name": "hassankhan/config", 11 "version": "3. 1.0",11 "version": "3.2.0", 12 12 "source": { 13 13 "type": "git", 14 14 "url": "https://github.com/hassankhan/config.git", 15 "reference": " 8e1c07f4fdc2b986b8a781f0dcba155af2a579b6"16 }, 17 "dist": { 18 "type": "zip", 19 "url": "https://api.github.com/repos/hassankhan/config/zipball/ 8e1c07f4fdc2b986b8a781f0dcba155af2a579b6",20 "reference": " 8e1c07f4fdc2b986b8a781f0dcba155af2a579b6",15 "reference": "cf63da451c4d226df983017932b9cef1b6d49db5" 16 }, 17 "dist": { 18 "type": "zip", 19 "url": "https://api.github.com/repos/hassankhan/config/zipball/cf63da451c4d226df983017932b9cef1b6d49db5", 20 "reference": "cf63da451c4d226df983017932b9cef1b6d49db5", 21 21 "shasum": "" 22 22 }, … … 65 65 "support": { 66 66 "issues": "https://github.com/hassankhan/config/issues", 67 "source": "https://github.com/hassankhan/config/tree/3. 1.0"68 }, 69 "time": "202 2-12-20T19:48:37+00:00"67 "source": "https://github.com/hassankhan/config/tree/3.2.0" 68 }, 69 "time": "2024-12-09T16:20:44+00:00" 70 70 } 71 71 ], … … 73 73 { 74 74 "name": "myclabs/deep-copy", 75 "version": "1.1 2.0",75 "version": "1.13.0", 76 76 "source": { 77 77 "type": "git", 78 78 "url": "https://github.com/myclabs/DeepCopy.git", 79 "reference": " 3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c"80 }, 81 "dist": { 82 "type": "zip", 83 "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/ 3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c",84 "reference": " 3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c",79 "reference": "024473a478be9df5fdaca2c793f2232fe788e414" 80 }, 81 "dist": { 82 "type": "zip", 83 "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414", 84 "reference": "024473a478be9df5fdaca2c793f2232fe788e414", 85 85 "shasum": "" 86 86 }, … … 121 121 "support": { 122 122 "issues": "https://github.com/myclabs/DeepCopy/issues", 123 "source": "https://github.com/myclabs/DeepCopy/tree/1.1 2.0"123 "source": "https://github.com/myclabs/DeepCopy/tree/1.13.0" 124 124 }, 125 125 "funding": [ … … 129 129 } 130 130 ], 131 "time": "202 4-06-12T14:39:25+00:00"131 "time": "2025-02-12T12:17:51+00:00" 132 132 }, 133 133 { 134 134 "name": "nikic/php-parser", 135 "version": "v5. 3.1",135 "version": "v5.4.0", 136 136 "source": { 137 137 "type": "git", 138 138 "url": "https://github.com/nikic/PHP-Parser.git", 139 "reference": " 8eea230464783aa9671db8eea6f8c6ac5285794b"140 }, 141 "dist": { 142 "type": "zip", 143 "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/ 8eea230464783aa9671db8eea6f8c6ac5285794b",144 "reference": " 8eea230464783aa9671db8eea6f8c6ac5285794b",139 "reference": "447a020a1f875a434d62f2a401f53b82a396e494" 140 }, 141 "dist": { 142 "type": "zip", 143 "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", 144 "reference": "447a020a1f875a434d62f2a401f53b82a396e494", 145 145 "shasum": "" 146 146 }, … … 185 185 "support": { 186 186 "issues": "https://github.com/nikic/PHP-Parser/issues", 187 "source": "https://github.com/nikic/PHP-Parser/tree/v5. 3.1"188 }, 189 "time": "2024-1 0-08T18:51:32+00:00"187 "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" 188 }, 189 "time": "2024-12-30T11:07:19+00:00" 190 190 }, 191 191 { … … 309 309 { 310 310 "name": "phpunit/php-code-coverage", 311 "version": "11.0. 7",311 "version": "11.0.8", 312 312 "source": { 313 313 "type": "git", 314 314 "url": "https://github.com/sebastianbergmann/php-code-coverage.git", 315 "reference": " f7f08030e8811582cc459871d28d6f5a1a4d35ca"316 }, 317 "dist": { 318 "type": "zip", 319 "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ f7f08030e8811582cc459871d28d6f5a1a4d35ca",320 "reference": " f7f08030e8811582cc459871d28d6f5a1a4d35ca",315 "reference": "418c59fd080954f8c4aa5631d9502ecda2387118" 316 }, 317 "dist": { 318 "type": "zip", 319 "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/418c59fd080954f8c4aa5631d9502ecda2387118", 320 "reference": "418c59fd080954f8c4aa5631d9502ecda2387118", 321 321 "shasum": "" 322 322 }, … … 337 337 }, 338 338 "require-dev": { 339 "phpunit/phpunit": "^11. 4.1"339 "phpunit/phpunit": "^11.5.0" 340 340 }, 341 341 "suggest": { … … 375 375 "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", 376 376 "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", 377 "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/11.0. 7"378 }, 379 "funding": [ 380 { 381 "url": "https://github.com/sebastianbergmann", 382 "type": "github" 383 } 384 ], 385 "time": "2024-1 0-09T06:21:38+00:00"377 "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/11.0.8" 378 }, 379 "funding": [ 380 { 381 "url": "https://github.com/sebastianbergmann", 382 "type": "github" 383 } 384 ], 385 "time": "2024-12-11T12:34:27+00:00" 386 386 }, 387 387 { … … 632 632 { 633 633 "name": "phpunit/phpunit", 634 "version": "11. 4.3",634 "version": "11.5.7", 635 635 "source": { 636 636 "type": "git", 637 637 "url": "https://github.com/sebastianbergmann/phpunit.git", 638 "reference": "e 8e8ed1854de5d36c088ec1833beae40d2dedd76"639 }, 640 "dist": { 641 "type": "zip", 642 "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e 8e8ed1854de5d36c088ec1833beae40d2dedd76",643 "reference": "e 8e8ed1854de5d36c088ec1833beae40d2dedd76",638 "reference": "e1cb706f019e2547039ca2c839898cd5f557ee5d" 639 }, 640 "dist": { 641 "type": "zip", 642 "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e1cb706f019e2547039ca2c839898cd5f557ee5d", 643 "reference": "e1cb706f019e2547039ca2c839898cd5f557ee5d", 644 644 "shasum": "" 645 645 }, … … 651 651 "ext-xml": "*", 652 652 "ext-xmlwriter": "*", 653 "myclabs/deep-copy": "^1.12. 0",653 "myclabs/deep-copy": "^1.12.1", 654 654 "phar-io/manifest": "^2.0.4", 655 655 "phar-io/version": "^3.2.1", 656 656 "php": ">=8.2", 657 "phpunit/php-code-coverage": "^11.0. 7",657 "phpunit/php-code-coverage": "^11.0.8", 658 658 "phpunit/php-file-iterator": "^5.1.0", 659 659 "phpunit/php-invoker": "^5.0.1", … … 661 661 "phpunit/php-timer": "^7.0.1", 662 662 "sebastian/cli-parser": "^3.0.2", 663 "sebastian/code-unit": "^3.0. 1",664 "sebastian/comparator": "^6. 1.1",663 "sebastian/code-unit": "^3.0.2", 664 "sebastian/comparator": "^6.3.0", 665 665 "sebastian/diff": "^6.0.2", 666 666 "sebastian/environment": "^7.2.0", 667 "sebastian/exporter": "^6. 1.3",667 "sebastian/exporter": "^6.3.0", 668 668 "sebastian/global-state": "^7.0.2", 669 669 "sebastian/object-enumerator": "^6.0.1", 670 670 "sebastian/type": "^5.1.0", 671 "sebastian/version": "^5.0.2" 671 "sebastian/version": "^5.0.2", 672 "staabm/side-effects-detector": "^1.0.5" 672 673 }, 673 674 "suggest": { … … 680 681 "extra": { 681 682 "branch-alias": { 682 "dev-main": "11. 4-dev"683 "dev-main": "11.5-dev" 683 684 } 684 685 }, … … 712 713 "issues": "https://github.com/sebastianbergmann/phpunit/issues", 713 714 "security": "https://github.com/sebastianbergmann/phpunit/security/policy", 714 "source": "https://github.com/sebastianbergmann/phpunit/tree/11. 4.3"715 "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.7" 715 716 }, 716 717 "funding": [ … … 728 729 } 729 730 ], 730 "time": "202 4-10-28T13:07:50+00:00"731 "time": "2025-02-06T16:10:05+00:00" 731 732 }, 732 733 { … … 789 790 { 790 791 "name": "sebastian/code-unit", 791 "version": "3.0. 1",792 "version": "3.0.2", 792 793 "source": { 793 794 "type": "git", 794 795 "url": "https://github.com/sebastianbergmann/code-unit.git", 795 "reference": " 6bb7d09d6623567178cf54126afa9c2310114268"796 }, 797 "dist": { 798 "type": "zip", 799 "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/ 6bb7d09d6623567178cf54126afa9c2310114268",800 "reference": " 6bb7d09d6623567178cf54126afa9c2310114268",796 "reference": "ee88b0cdbe74cf8dd3b54940ff17643c0d6543ca" 797 }, 798 "dist": { 799 "type": "zip", 800 "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/ee88b0cdbe74cf8dd3b54940ff17643c0d6543ca", 801 "reference": "ee88b0cdbe74cf8dd3b54940ff17643c0d6543ca", 801 802 "shasum": "" 802 803 }, … … 805 806 }, 806 807 "require-dev": { 807 "phpunit/phpunit": "^11. 0"808 "phpunit/phpunit": "^11.5" 808 809 }, 809 810 "type": "library", … … 834 835 "issues": "https://github.com/sebastianbergmann/code-unit/issues", 835 836 "security": "https://github.com/sebastianbergmann/code-unit/security/policy", 836 "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0. 1"837 }, 838 "funding": [ 839 { 840 "url": "https://github.com/sebastianbergmann", 841 "type": "github" 842 } 843 ], 844 "time": "2024- 07-03T04:44:28+00:00"837 "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.2" 838 }, 839 "funding": [ 840 { 841 "url": "https://github.com/sebastianbergmann", 842 "type": "github" 843 } 844 ], 845 "time": "2024-12-12T09:59:06+00:00" 845 846 }, 846 847 { … … 902 903 { 903 904 "name": "sebastian/comparator", 904 "version": "6. 2.1",905 "version": "6.3.0", 905 906 "source": { 906 907 "type": "git", 907 908 "url": "https://github.com/sebastianbergmann/comparator.git", 908 "reference": " 43d129d6a0f81c78bee378b46688293eb7ea3739"909 }, 910 "dist": { 911 "type": "zip", 912 "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/ 43d129d6a0f81c78bee378b46688293eb7ea3739",913 "reference": " 43d129d6a0f81c78bee378b46688293eb7ea3739",909 "reference": "d4e47a769525c4dd38cea90e5dcd435ddbbc7115" 910 }, 911 "dist": { 912 "type": "zip", 913 "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/d4e47a769525c4dd38cea90e5dcd435ddbbc7115", 914 "reference": "d4e47a769525c4dd38cea90e5dcd435ddbbc7115", 914 915 "shasum": "" 915 916 }, … … 923 924 "require-dev": { 924 925 "phpunit/phpunit": "^11.4" 926 }, 927 "suggest": { 928 "ext-bcmath": "For comparing BcMath\\Number objects" 925 929 }, 926 930 "type": "library", … … 967 971 "issues": "https://github.com/sebastianbergmann/comparator/issues", 968 972 "security": "https://github.com/sebastianbergmann/comparator/security/policy", 969 "source": "https://github.com/sebastianbergmann/comparator/tree/6. 2.1"970 }, 971 "funding": [ 972 { 973 "url": "https://github.com/sebastianbergmann", 974 "type": "github" 975 } 976 ], 977 "time": "202 4-10-31T05:30:08+00:00"973 "source": "https://github.com/sebastianbergmann/comparator/tree/6.3.0" 974 }, 975 "funding": [ 976 { 977 "url": "https://github.com/sebastianbergmann", 978 "type": "github" 979 } 980 ], 981 "time": "2025-01-06T10:28:19+00:00" 978 982 }, 979 983 { … … 1168 1172 { 1169 1173 "name": "sebastian/exporter", 1170 "version": "6. 1.3",1174 "version": "6.3.0", 1171 1175 "source": { 1172 1176 "type": "git", 1173 1177 "url": "https://github.com/sebastianbergmann/exporter.git", 1174 "reference": " c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e"1175 }, 1176 "dist": { 1177 "type": "zip", 1178 "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e",1179 "reference": " c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e",1178 "reference": "3473f61172093b2da7de1fb5782e1f24cc036dc3" 1179 }, 1180 "dist": { 1181 "type": "zip", 1182 "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/3473f61172093b2da7de1fb5782e1f24cc036dc3", 1183 "reference": "3473f61172093b2da7de1fb5782e1f24cc036dc3", 1180 1184 "shasum": "" 1181 1185 }, … … 1186 1190 }, 1187 1191 "require-dev": { 1188 "phpunit/phpunit": "^11. 2"1192 "phpunit/phpunit": "^11.3" 1189 1193 }, 1190 1194 "type": "library", … … 1234 1238 "issues": "https://github.com/sebastianbergmann/exporter/issues", 1235 1239 "security": "https://github.com/sebastianbergmann/exporter/security/policy", 1236 "source": "https://github.com/sebastianbergmann/exporter/tree/6. 1.3"1237 }, 1238 "funding": [ 1239 { 1240 "url": "https://github.com/sebastianbergmann", 1241 "type": "github" 1242 } 1243 ], 1244 "time": "2024- 07-03T04:56:19+00:00"1240 "source": "https://github.com/sebastianbergmann/exporter/tree/6.3.0" 1241 }, 1242 "funding": [ 1243 { 1244 "url": "https://github.com/sebastianbergmann", 1245 "type": "github" 1246 } 1247 ], 1248 "time": "2024-12-05T09:17:50+00:00" 1245 1249 }, 1246 1250 { … … 1655 1659 { 1656 1660 "name": "squizlabs/php_codesniffer", 1657 "version": "3.1 0.3",1661 "version": "3.11.3", 1658 1662 "source": { 1659 1663 "type": "git", 1660 1664 "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", 1661 "reference": " 62d32998e820bddc40f99f8251958aed187a5c9c"1662 }, 1663 "dist": { 1664 "type": "zip", 1665 "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/ 62d32998e820bddc40f99f8251958aed187a5c9c",1666 "reference": " 62d32998e820bddc40f99f8251958aed187a5c9c",1665 "reference": "ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10" 1666 }, 1667 "dist": { 1668 "type": "zip", 1669 "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10", 1670 "reference": "ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10", 1667 1671 "shasum": "" 1668 1672 }, … … 1729 1733 "url": "https://opencollective.com/php_codesniffer", 1730 1734 "type": "open_collective" 1731 } 1732 ], 1733 "time": "2024-09-18T10:38:58+00:00" 1735 }, 1736 { 1737 "url": "https://thanks.dev/phpcsstandards", 1738 "type": "thanks_dev" 1739 } 1740 ], 1741 "time": "2025-01-23T17:04:15+00:00" 1742 }, 1743 { 1744 "name": "staabm/side-effects-detector", 1745 "version": "1.0.5", 1746 "source": { 1747 "type": "git", 1748 "url": "https://github.com/staabm/side-effects-detector.git", 1749 "reference": "d8334211a140ce329c13726d4a715adbddd0a163" 1750 }, 1751 "dist": { 1752 "type": "zip", 1753 "url": "https://api.github.com/repos/staabm/side-effects-detector/zipball/d8334211a140ce329c13726d4a715adbddd0a163", 1754 "reference": "d8334211a140ce329c13726d4a715adbddd0a163", 1755 "shasum": "" 1756 }, 1757 "require": { 1758 "ext-tokenizer": "*", 1759 "php": "^7.4 || ^8.0" 1760 }, 1761 "require-dev": { 1762 "phpstan/extension-installer": "^1.4.3", 1763 "phpstan/phpstan": "^1.12.6", 1764 "phpunit/phpunit": "^9.6.21", 1765 "symfony/var-dumper": "^5.4.43", 1766 "tomasvotruba/type-coverage": "1.0.0", 1767 "tomasvotruba/unused-public": "1.0.0" 1768 }, 1769 "type": "library", 1770 "autoload": { 1771 "classmap": [ 1772 "lib/" 1773 ] 1774 }, 1775 "notification-url": "https://packagist.org/downloads/", 1776 "license": [ 1777 "MIT" 1778 ], 1779 "description": "A static analysis tool to detect side effects in PHP code", 1780 "keywords": [ 1781 "static analysis" 1782 ], 1783 "support": { 1784 "issues": "https://github.com/staabm/side-effects-detector/issues", 1785 "source": "https://github.com/staabm/side-effects-detector/tree/1.0.5" 1786 }, 1787 "funding": [ 1788 { 1789 "url": "https://github.com/staabm", 1790 "type": "github" 1791 } 1792 ], 1793 "time": "2024-10-20T05:08:20+00:00" 1734 1794 }, 1735 1795 { -
interactive-globes/trunk/vendor/saltus/framework/lib/codestar-framework/classes/setup.class.php
r3207680 r3263746 8 8 * 9 9 */ 10 if ( ! class_exists( ' CSF_Setup' ) ) {11 class CSF_Setup {10 if ( ! class_exists( 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Setup' ) ) { 11 class Saltus_WP_Plugin_InteractiveGlobes_CSF_Setup { 12 12 13 13 // Default constants … … 71 71 self::textdomain(); 72 72 73 add_action( 'after_setup_theme', array( ' CSF', 'setup' ) );74 add_action( 'init', array( ' CSF', 'setup' ) );75 add_action( 'switch_theme', array( ' CSF', 'setup' ) );76 add_action( 'admin_enqueue_scripts', array( ' CSF', 'add_admin_enqueue_scripts' ) );77 add_action( 'wp_enqueue_scripts', array( ' CSF', 'add_typography_enqueue_styles' ), 80 );78 add_action( 'wp_head', array( ' CSF', 'add_custom_css' ), 80 );79 add_filter( 'admin_body_class', array( ' CSF', 'add_admin_body_class' ) );73 add_action( 'after_setup_theme', array( 'Saltus_WP_Plugin_InteractiveGlobes_CSF', 'setup' ) ); 74 add_action( 'init', array( 'Saltus_WP_Plugin_InteractiveGlobes_CSF', 'setup' ) ); 75 add_action( 'switch_theme', array( 'Saltus_WP_Plugin_InteractiveGlobes_CSF', 'setup' ) ); 76 add_action( 'admin_enqueue_scripts', array( 'Saltus_WP_Plugin_InteractiveGlobes_CSF', 'add_admin_enqueue_scripts' ) ); 77 add_action( 'wp_enqueue_scripts', array( 'Saltus_WP_Plugin_InteractiveGlobes_CSF', 'add_typography_enqueue_styles' ), 80 ); 78 add_action( 'wp_head', array( 'Saltus_WP_Plugin_InteractiveGlobes_CSF', 'add_custom_css' ), 80 ); 79 add_filter( 'admin_body_class', array( 'Saltus_WP_Plugin_InteractiveGlobes_CSF', 'add_admin_body_class' ) ); 80 80 81 81 } … … 89 89 // Setup admin option framework 90 90 $params = array(); 91 if ( class_exists( ' CSF_Options' ) && ! empty( self::$args['admin_options'] ) ) {91 if ( class_exists( 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Options' ) && ! empty( self::$args['admin_options'] ) ) { 92 92 foreach ( self::$args['admin_options'] as $key => $value ) { 93 93 if ( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) { … … 97 97 self::$inited[$key] = true; 98 98 99 CSF_Options::instance( $key, $params );99 Saltus_WP_Plugin_InteractiveGlobes_CSF_Options::instance( $key, $params ); 100 100 101 101 if ( ! empty( $value['show_in_customizer'] ) ) { … … 112 112 // Setup customize option framework 113 113 $params = array(); 114 if ( class_exists( ' CSF_Customize_Options' ) && ! empty( self::$args['customize_options'] ) ) {114 if ( class_exists( 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Customize_Options' ) && ! empty( self::$args['customize_options'] ) ) { 115 115 foreach ( self::$args['customize_options'] as $key => $value ) { 116 116 if ( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) { … … 120 120 self::$inited[$key] = true; 121 121 122 CSF_Customize_Options::instance( $key, $params );122 Saltus_WP_Plugin_InteractiveGlobes_CSF_Customize_Options::instance( $key, $params ); 123 123 124 124 } … … 128 128 // Setup metabox option framework 129 129 $params = array(); 130 if ( class_exists( ' CSF_Metabox' ) && ! empty( self::$args['metabox_options'] ) ) {130 if ( class_exists( 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Metabox' ) && ! empty( self::$args['metabox_options'] ) ) { 131 131 foreach ( self::$args['metabox_options'] as $key => $value ) { 132 132 if ( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) { … … 136 136 self::$inited[$key] = true; 137 137 138 CSF_Metabox::instance( $key, $params );138 Saltus_WP_Plugin_InteractiveGlobes_CSF_Metabox::instance( $key, $params ); 139 139 140 140 } … … 144 144 // Setup nav menu option framework 145 145 $params = array(); 146 if ( class_exists( ' CSF_Nav_Menu_Options' ) && ! empty( self::$args['nav_menu_options'] ) ) {146 if ( class_exists( 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Nav_Menu_Options' ) && ! empty( self::$args['nav_menu_options'] ) ) { 147 147 foreach ( self::$args['nav_menu_options'] as $key => $value ) { 148 148 if ( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) { … … 152 152 self::$inited[$key] = true; 153 153 154 CSF_Nav_Menu_Options::instance( $key, $params );154 Saltus_WP_Plugin_InteractiveGlobes_CSF_Nav_Menu_Options::instance( $key, $params ); 155 155 156 156 } … … 160 160 // Setup profile option framework 161 161 $params = array(); 162 if ( class_exists( ' CSF_Profile_Options' ) && ! empty( self::$args['profile_options'] ) ) {162 if ( class_exists( 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Profile_Options' ) && ! empty( self::$args['profile_options'] ) ) { 163 163 foreach ( self::$args['profile_options'] as $key => $value ) { 164 164 if ( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) { … … 168 168 self::$inited[$key] = true; 169 169 170 CSF_Profile_Options::instance( $key, $params );170 Saltus_WP_Plugin_InteractiveGlobes_CSF_Profile_Options::instance( $key, $params ); 171 171 172 172 } … … 176 176 // Setup taxonomy option framework 177 177 $params = array(); 178 if ( class_exists( ' CSF_Taxonomy_Options' ) && ! empty( self::$args['taxonomy_options'] ) ) {178 if ( class_exists( 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Taxonomy_Options' ) && ! empty( self::$args['taxonomy_options'] ) ) { 179 179 $taxonomy = ( isset( $_GET['taxonomy'] ) ) ? sanitize_text_field( wp_unslash( $_GET['taxonomy'] ) ) : ''; 180 180 foreach ( self::$args['taxonomy_options'] as $key => $value ) { … … 185 185 self::$inited[$key] = true; 186 186 187 CSF_Taxonomy_Options::instance( $key, $params );187 Saltus_WP_Plugin_InteractiveGlobes_CSF_Taxonomy_Options::instance( $key, $params ); 188 188 189 189 } … … 192 192 193 193 // Setup widget option framework 194 if ( class_exists( ' CSF_Widget' ) && class_exists( 'WP_Widget_Factory' ) && ! empty( self::$args['widget_options'] ) ) {194 if ( class_exists( 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Widget' ) && class_exists( 'WP_Widget_Factory' ) && ! empty( self::$args['widget_options'] ) ) { 195 195 $wp_widget_factory = new WP_Widget_Factory(); 196 196 global $wp_widget_factory; … … 199 199 200 200 self::$inited[$key] = true; 201 $wp_widget_factory->register( CSF_Widget::instance( $key, $value ) );201 $wp_widget_factory->register( Saltus_WP_Plugin_InteractiveGlobes_CSF_Widget::instance( $key, $value ) ); 202 202 203 203 } … … 207 207 // Setup comment option framework 208 208 $params = array(); 209 if ( class_exists( ' CSF_Comment_Metabox' ) && ! empty( self::$args['comment_options'] ) ) {209 if ( class_exists( 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Comment_Metabox' ) && ! empty( self::$args['comment_options'] ) ) { 210 210 foreach ( self::$args['comment_options'] as $key => $value ) { 211 211 if ( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) { … … 215 215 self::$inited[$key] = true; 216 216 217 CSF_Comment_Metabox::instance( $key, $params );217 Saltus_WP_Plugin_InteractiveGlobes_CSF_Comment_Metabox::instance( $key, $params ); 218 218 219 219 } … … 223 223 // Setup shortcode option framework 224 224 $params = array(); 225 if ( class_exists( ' CSF_Shortcoder' ) && ! empty( self::$args['shortcode_options'] ) ) {225 if ( class_exists( 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Shortcoder' ) && ! empty( self::$args['shortcode_options'] ) ) { 226 226 foreach ( self::$args['shortcode_options'] as $key => $value ) { 227 227 if ( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) { … … 231 231 self::$inited[$key] = true; 232 232 233 CSF_Shortcoder::instance( $key, $params );233 Saltus_WP_Plugin_InteractiveGlobes_CSF_Shortcoder::instance( $key, $params ); 234 234 235 235 } … … 237 237 238 238 // Once editor setup for gutenberg and media buttons 239 if ( class_exists( ' CSF_Shortcoder' ) && ! empty( self::$shortcode_instances ) ) {239 if ( class_exists( 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Shortcoder' ) && ! empty( self::$shortcode_instances ) ) { 240 240 foreach ( self::$shortcode_instances as $instance ) { 241 241 if ( ! empty( $instance['show_in_editor'] ) ) { 242 CSF_Shortcoder::once_editor_setup();242 Saltus_WP_Plugin_InteractiveGlobes_CSF_Shortcoder::once_editor_setup(); 243 243 break; 244 244 } … … 454 454 if ( ! empty( $fields ) ) { 455 455 foreach ( $fields as $field ) { 456 if ( ! class_exists( ' CSF_Field_'. $field ) && class_exists( 'CSF_Fields' ) ) {456 if ( ! class_exists( 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_'. $field ) && class_exists( 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Fields' ) ) { 457 457 self::include_plugin_file( 'fields/'. $field .'/'. $field .'.php' ); 458 458 } … … 617 617 foreach ( self::$fields as $field ) { 618 618 if ( ! empty( $field['type'] ) ) { 619 $classname = ' CSF_Field_' . $field['type'];619 $classname = 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_' . $field['type']; 620 620 if ( class_exists( $classname ) && method_exists( $classname, 'enqueue' ) ) { 621 621 $instance = new $classname( $field ); … … 770 770 $value = ( isset( $field['value'] ) ) ? $field['value'] : $value; 771 771 772 $classname = ' CSF_Field_'. $field_type;772 $classname = 'Saltus_WP_Plugin_InteractiveGlobes_CSF_Field_'. $field_type; 773 773 774 774 if ( class_exists( $classname ) ) { … … 793 793 } 794 794 795 CSF_Setup::init( __FILE__, true );795 Saltus_WP_Plugin_InteractiveGlobes_CSF_Setup::init( __FILE__, true ); 796 796 797 797 /** … … 803 803 * 804 804 */ 805 if ( ! class_exists( ' CSF' ) ) {806 class CSF extendsCSF_Setup{}805 if ( ! class_exists( 'Saltus_WP_Plugin_InteractiveGlobes_CSF' ) ) { 806 class Saltus_WP_Plugin_InteractiveGlobes_CSF extends Saltus_WP_Plugin_InteractiveGlobes_CSF_Setup{} 807 807 } -
interactive-globes/trunk/vendor/saltus/framework/lib/codestar-framework/functions/actions.php
r2986425 r3263746 8 8 * 9 9 */ 10 if ( ! function_exists( ' csf_get_icons' ) ) {11 function csf_get_icons() {10 if ( ! function_exists( 'saltus_wp_plugin_interactiveglobes_csf_get_icons' ) ) { 11 function saltus_wp_plugin_interactiveglobes_csf_get_icons() { 12 12 13 13 $nonce = ( ! empty( $_POST[ 'nonce' ] ) ) ? sanitize_text_field( wp_unslash( $_POST[ 'nonce' ] ) ) : ''; … … 21 21 $icon_library = ( apply_filters( 'csf_fa4', false ) ) ? 'fa4' : 'fa5'; 22 22 23 CSF::include_plugin_file( 'fields/icon/'. $icon_library .'-icons.php' );23 Saltus_WP_Plugin_InteractiveGlobes_CSF::include_plugin_file( 'fields/icon/'. $icon_library .'-icons.php' ); 24 24 25 $icon_lists = apply_filters( 'csf_field_icon_add_icons', csf_get_default_icons() );25 $icon_lists = apply_filters( 'csf_field_icon_add_icons', saltus_wp_plugin_interactiveglobes_csf_get_default_icons() ); 26 26 27 27 if ( ! empty( $icon_lists ) ) { … … 48 48 49 49 } 50 add_action( 'wp_ajax_csf-get-icons', ' csf_get_icons' );50 add_action( 'wp_ajax_csf-get-icons', 'saltus_wp_plugin_interactiveglobes_csf_get_icons' ); 51 51 } 52 52 … … 59 59 * 60 60 */ 61 if ( ! function_exists( ' csf_export' ) ) {62 function csf_export() {61 if ( ! function_exists( 'saltus_wp_plugin_interactiveglobes_csf_export' ) ) { 62 function saltus_wp_plugin_interactiveglobes_csf_export() { 63 63 64 64 $nonce = ( ! empty( $_GET[ 'nonce' ] ) ) ? sanitize_text_field( wp_unslash( $_GET[ 'nonce' ] ) ) : ''; … … 85 85 86 86 } 87 add_action( 'wp_ajax_csf-export', ' csf_export' );87 add_action( 'wp_ajax_csf-export', 'saltus_wp_plugin_interactiveglobes_csf_export' ); 88 88 } 89 89 … … 96 96 * 97 97 */ 98 if ( ! function_exists( ' csf_import_ajax' ) ) {99 function csf_import_ajax() {98 if ( ! function_exists( 'saltus_wp_plugin_interactiveglobes_csf_import_ajax' ) ) { 99 function saltus_wp_plugin_interactiveglobes_csf_import_ajax() { 100 100 101 101 $nonce = ( ! empty( $_POST[ 'nonce' ] ) ) ? sanitize_text_field( wp_unslash( $_POST[ 'nonce' ] ) ) : ''; … … 121 121 122 122 } 123 add_action( 'wp_ajax_csf-import', ' csf_import_ajax' );123 add_action( 'wp_ajax_csf-import', 'saltus_wp_plugin_interactiveglobes_csf_import_ajax' ); 124 124 } 125 125 … … 132 132 * 133 133 */ 134 if ( ! function_exists( ' csf_reset_ajax' ) ) {135 function csf_reset_ajax() {134 if ( ! function_exists( 'saltus_wp_plugin_interactiveglobes_csf_reset_ajax' ) ) { 135 function saltus_wp_plugin_interactiveglobes_csf_reset_ajax() { 136 136 137 137 $nonce = ( ! empty( $_POST[ 'nonce' ] ) ) ? sanitize_text_field( wp_unslash( $_POST[ 'nonce' ] ) ) : ''; … … 148 148 149 149 } 150 add_action( 'wp_ajax_csf-reset', ' csf_reset_ajax' );150 add_action( 'wp_ajax_csf-reset', 'saltus_wp_plugin_interactiveglobes_csf_reset_ajax' ); 151 151 } 152 152 … … 159 159 * 160 160 */ 161 if ( ! function_exists( ' csf_chosen_ajax' ) ) {162 function csf_chosen_ajax() {161 if ( ! function_exists( 'saltus_wp_plugin_interactiveglobes_csf_chosen_ajax' ) ) { 162 function saltus_wp_plugin_interactiveglobes_csf_chosen_ajax() { 163 163 164 164 $nonce = ( ! empty( $_POST[ 'nonce' ] ) ) ? sanitize_text_field( wp_unslash( $_POST[ 'nonce' ] ) ) : ''; … … 182 182 183 183 // Success 184 $options = CSF_Fields::field_data( $type, $term, $query );184 $options = Saltus_WP_Plugin_InteractiveGlobes_CSF_Fields::field_data( $type, $term, $query ); 185 185 186 186 wp_send_json_success( $options ); 187 187 188 188 } 189 add_action( 'wp_ajax_csf-chosen', ' csf_chosen_ajax' );189 add_action( 'wp_ajax_csf-chosen', 'saltus_wp_plugin_interactiveglobes_csf_chosen_ajax' ); 190 190 }
Note: See TracChangeset
for help on using the changeset viewer.